From 74c6e2ca3368154e485e9a1584eb8bf00432cb0f Mon Sep 17 00:00:00 2001 From: h3n4l Date: Tue, 20 Jan 2026 15:59:23 +0800 Subject: [PATCH] feat(mongodb): extend parser to support all mongosh commands Extend the MongoDB Shell parser grammar to recognize all mongosh commands with comprehensive test coverage. Grammar additions: - Collection methods: write operations, index/schema management - Database methods: createCollection, dropDatabase, stats, serverStatus, etc. - Cursor methods: batchSize, collation, hint, maxTimeMS, toArray, etc. - Bulk operations: initializeOrderedBulkOp, Bulk.find, Bulk.insert, etc. - Connection methods: Mongo(), connect(), getDB, setReadPref, etc. - Replication methods: rs.status, rs.initiate, rs.add, rs.reconfig, etc. - Sharding methods: sh.status, sh.enableSharding, sh.shardCollection, etc. - Encryption methods: KeyVault, ClientEncryption via db.getMongo() - Native shell functions: cat, load, quit, pwd, sleep, etc. - Query plan cache: db.collection.getPlanCache().list/clear/etc. - Atlas-specific: Search Index methods, Stream Processing (sp.*) - Object constructors: BinData, Binary, BSONRegExp, HexData Test files: 300+ test files covering all command categories Co-Authored-By: Claude Opus 4.5 --- mongodb/MongoShellLexer.g4 | 122 + mongodb/MongoShellParser.g4 | 566 +- mongodb/examples/atlas-createSearchIndex.js | 65 + mongodb/examples/atlas-createSearchIndexes.js | 70 + mongodb/examples/atlas-dropSearchIndex.js | 19 + mongodb/examples/atlas-updateSearchIndex.js | 60 + mongodb/examples/bulk-arrayFilters.js | 16 + mongodb/examples/bulk-arrayInsert.js | 16 + mongodb/examples/bulk-collation.js | 16 + mongodb/examples/bulk-execute.js | 16 + mongodb/examples/bulk-find.js | 16 + mongodb/examples/bulk-getOperations.js | 16 + mongodb/examples/bulk-hint.js | 16 + .../examples/bulk-initializeOrderedBulkOp.js | 16 + .../bulk-initializeUnorderedBulkOp.js | 16 + mongodb/examples/bulk-insert.js | 19 + mongodb/examples/bulk-mixed.js | 19 + mongodb/examples/bulk-remove.js | 16 + mongodb/examples/bulk-removeOne.js | 16 + mongodb/examples/bulk-replaceOne.js | 16 + mongodb/examples/bulk-toString.js | 16 + mongodb/examples/bulk-tojson.js | 16 + mongodb/examples/bulk-update.js | 16 + mongodb/examples/bulk-updateOne.js | 16 + .../bulk-updateOneWithArrayFilters.js | 16 + mongodb/examples/bulk-updateOneWithHint.js | 16 + mongodb/examples/bulk-upsert.js | 16 + .../examples/collection-analyzeShardKey.js | 43 + mongodb/examples/collection-bulkWrite.js | 53 + ...lection-compactStructuredEncryptionData.js | 21 + .../collection-configureQueryAnalyzer.js | 32 + mongodb/examples/collection-count.js | 36 + mongodb/examples/collection-createIndex.js | 40 + mongodb/examples/collection-createIndexes.js | 31 + mongodb/examples/collection-dataSize.js | 13 + mongodb/examples/collection-deleteMany.js | 20 + mongodb/examples/collection-deleteOne.js | 17 + mongodb/examples/collection-drop.js | 15 + mongodb/examples/collection-dropIndex.js | 19 + mongodb/examples/collection-dropIndexes.js | 20 + mongodb/examples/collection-explain.js | 49 + mongodb/examples/collection-findAndModify.js | 96 + .../examples/collection-findOneAndDelete.js | 20 + .../examples/collection-findOneAndReplace.js | 20 + .../examples/collection-findOneAndUpdate.js | 20 + .../collection-getShardDistribution.js | 22 + .../examples/collection-getShardVersion.js | 22 + mongodb/examples/collection-hideIndex.js | 31 + mongodb/examples/collection-insert.js | 77 + mongodb/examples/collection-insertMany.js | 19 + mongodb/examples/collection-insertOne.js | 21 + mongodb/examples/collection-isCapped.js | 17 + mongodb/examples/collection-latencyStats.js | 17 + mongodb/examples/collection-mapReduce.js | 129 + mongodb/examples/collection-reIndex.js | 21 + mongodb/examples/collection-remove.js | 53 + .../examples/collection-renameCollection.js | 18 + mongodb/examples/collection-replaceOne.js | 17 + mongodb/examples/collection-stats.js | 22 + mongodb/examples/collection-storageSize.js | 13 + mongodb/examples/collection-totalIndexSize.js | 13 + mongodb/examples/collection-totalSize.js | 13 + mongodb/examples/collection-unhideIndex.js | 31 + mongodb/examples/collection-update.js | 75 + mongodb/examples/collection-updateMany.js | 17 + mongodb/examples/collection-updateOne.js | 17 + mongodb/examples/collection-validate.js | 26 + mongodb/examples/collection-watch.js | 60 + mongodb/examples/connection-Mongo.js | 26 + mongodb/examples/connection-adminCommand.js | 28 + mongodb/examples/connection-close.js | 12 + mongodb/examples/connection-connect.js | 22 + mongodb/examples/connection-getDB.js | 18 + mongodb/examples/connection-getDBNames.js | 13 + mongodb/examples/connection-getReadConcern.js | 12 + mongodb/examples/connection-getReadPref.js | 13 + .../examples/connection-getReadPrefMode.js | 13 + .../examples/connection-getReadPrefTagSet.js | 13 + .../examples/connection-getWriteConcern.js | 13 + mongodb/examples/connection-setReadConcern.js | 20 + mongodb/examples/connection-setReadPref.js | 24 + .../examples/connection-setWriteConcern.js | 25 + mongodb/examples/connection-startSession.js | 23 + mongodb/examples/connection-watch.js | 27 + mongodb/examples/cursor-addOption.js | 34 + mongodb/examples/cursor-allowDiskUse.js | 30 + mongodb/examples/cursor-batchSize.js | 24 + mongodb/examples/cursor-close.js | 18 + mongodb/examples/cursor-collation.js | 31 + mongodb/examples/cursor-comment.js | 20 + mongodb/examples/cursor-count.js | 22 + mongodb/examples/cursor-explain.js | 28 + mongodb/examples/cursor-forEach.js | 20 + mongodb/examples/cursor-hasNext.js | 21 + mongodb/examples/cursor-hint.js | 24 + mongodb/examples/cursor-isClosed.js | 20 + mongodb/examples/cursor-isExhausted.js | 21 + mongodb/examples/cursor-itcount.js | 24 + mongodb/examples/cursor-limit.js | 21 + mongodb/examples/cursor-map.js | 20 + mongodb/examples/cursor-max.js | 23 + mongodb/examples/cursor-maxAwaitTimeMS.js | 21 + mongodb/examples/cursor-maxTimeMS.js | 27 + mongodb/examples/cursor-min.js | 26 + mongodb/examples/cursor-next.js | 24 + mongodb/examples/cursor-noCursorTimeout.js | 24 + mongodb/examples/cursor-objsLeftInBatch.js | 24 + mongodb/examples/cursor-pretty.js | 24 + mongodb/examples/cursor-projection.js | 27 + mongodb/examples/cursor-readConcern.js | 29 + mongodb/examples/cursor-readPref.js | 35 + mongodb/examples/cursor-returnKey.js | 25 + mongodb/examples/cursor-showRecordId.js | 26 + mongodb/examples/cursor-size.js | 28 + mongodb/examples/cursor-skip.js | 22 + mongodb/examples/cursor-sort.js | 27 + mongodb/examples/cursor-tailable.js | 30 + mongodb/examples/cursor-toArray.js | 28 + mongodb/examples/cursor-tryNext.js | 26 + mongodb/examples/db-adminCommand.js | 44 + mongodb/examples/db-aggregate.js | 21 + mongodb/examples/db-auth.js | 24 + mongodb/examples/db-changeUserPassword.js | 6 + mongodb/examples/db-cloneDatabase.js | 6 + mongodb/examples/db-commandHelp.js | 11 + mongodb/examples/db-copyDatabase.js | 9 + mongodb/examples/db-createCollection.js | 49 + mongodb/examples/db-createRole.js | 42 + mongodb/examples/db-createUser.js | 52 + mongodb/examples/db-createView.js | 40 + mongodb/examples/db-currentOp.js | 34 + mongodb/examples/db-dropAllRoles.js | 8 + mongodb/examples/db-dropAllUsers.js | 8 + mongodb/examples/db-dropDatabase.js | 4 + mongodb/examples/db-dropRole.js | 10 + mongodb/examples/db-dropUser.js | 10 + mongodb/examples/db-fsyncLock.js | 4 + mongodb/examples/db-fsyncUnlock.js | 4 + mongodb/examples/db-getLogComponents.js | 4 + mongodb/examples/db-getMongo.js | 4 + mongodb/examples/db-getName.js | 4 + mongodb/examples/db-getProfilingLevel.js | 4 + mongodb/examples/db-getProfilingStatus.js | 4 + mongodb/examples/db-getReplicationInfo.js | 4 + mongodb/examples/db-getRole.js | 16 + mongodb/examples/db-getRoles.js | 16 + mongodb/examples/db-getSiblingDB.js | 13 + mongodb/examples/db-getUser.js | 18 + mongodb/examples/db-getUsers.js | 18 + mongodb/examples/db-grantPrivilegesToRole.js | 22 + mongodb/examples/db-grantRolesToRole.js | 16 + mongodb/examples/db-grantRolesToUser.js | 16 + mongodb/examples/db-hello.js | 4 + mongodb/examples/db-hostInfo.js | 4 + mongodb/examples/db-isMaster.js | 4 + mongodb/examples/db-killOp.js | 8 + mongodb/examples/db-listCommands.js | 4 + mongodb/examples/db-logout.js | 4 + mongodb/examples/db-printCollectionStats.js | 8 + mongodb/examples/db-printReplicationInfo.js | 4 + .../db-printSecondaryReplicationInfo.js | 4 + mongodb/examples/db-printShardingStatus.js | 7 + .../examples/db-printSlaveReplicationInfo.js | 4 + .../examples/db-revokePrivilegesFromRole.js | 17 + mongodb/examples/db-revokeRolesFromRole.js | 16 + mongodb/examples/db-revokeRolesFromUser.js | 16 + mongodb/examples/db-rotateCertificates.js | 7 + mongodb/examples/db-runCommand.js | 52 + mongodb/examples/db-serverBuildInfo.js | 4 + mongodb/examples/db-serverStatus.js | 18 + mongodb/examples/db-setLogLevel.js | 13 + mongodb/examples/db-setProfilingLevel.js | 21 + mongodb/examples/db-setSecondaryOk.js | 6 + mongodb/examples/db-setWriteConcern.js | 16 + mongodb/examples/db-shutdownServer.js | 9 + mongodb/examples/db-stats.js | 17 + mongodb/examples/db-updateRole.js | 38 + mongodb/examples/db-updateUser.js | 43 + mongodb/examples/db-version.js | 4 + mongodb/examples/db-watch.js | 42 + .../encryption-addKeyAlternateName.js | 10 + .../encryption-createEncryptedCollection.js | 66 + mongodb/examples/encryption-createKey.js | 33 + mongodb/examples/encryption-decrypt.js | 10 + mongodb/examples/encryption-deleteKey.js | 10 + mongodb/examples/encryption-encrypt.js | 36 + .../examples/encryption-encryptExpression.js | 30 + .../encryption-getClientEncryption.js | 10 + mongodb/examples/encryption-getKey.js | 10 + .../examples/encryption-getKeyByAltName.js | 13 + mongodb/examples/encryption-getKeyVault.js | 10 + mongodb/examples/encryption-getKeys.js | 10 + .../encryption-removeKeyAlternateName.js | 10 + .../examples/encryption-rewrapManyDataKey.js | 36 + mongodb/examples/native-cat.js | 11 + mongodb/examples/native-cd.js | 10 + mongodb/examples/native-getHostName.js | 4 + mongodb/examples/native-getMemInfo.js | 4 + mongodb/examples/native-hostname.js | 4 + mongodb/examples/native-isInteractive.js | 4 + mongodb/examples/native-listFiles.js | 9 + mongodb/examples/native-load.js | 10 + mongodb/examples/native-ls.js | 9 + mongodb/examples/native-md5sumFile.js | 6 + mongodb/examples/native-mkdir.js | 6 + mongodb/examples/native-pwd.js | 4 + mongodb/examples/native-quit.js | 8 + mongodb/examples/native-removeFile.js | 6 + mongodb/examples/native-sleep.js | 7 + mongodb/examples/native-version.js | 4 + .../examples/objectConstructor-BSONRegExp.js | 47 + mongodb/examples/objectConstructor-BinData.js | 36 + mongodb/examples/objectConstructor-Binary.js | 60 + mongodb/examples/objectConstructor-HexData.js | 42 + mongodb/examples/plancache-clear.js | 13 + .../examples/plancache-clearPlansByQuery.js | 26 + mongodb/examples/plancache-getPlanCache.js | 13 + mongodb/examples/plancache-help.js | 12 + mongodb/examples/plancache-list.js | 24 + mongodb/examples/rs-add.js | 27 + mongodb/examples/rs-addArb.js | 7 + mongodb/examples/rs-conf.js | 4 + mongodb/examples/rs-config.js | 4 + mongodb/examples/rs-freeze.js | 10 + mongodb/examples/rs-hello.js | 4 + mongodb/examples/rs-help.js | 4 + mongodb/examples/rs-initiate.js | 34 + mongodb/examples/rs-isMaster.js | 4 + mongodb/examples/rs-printReplicationInfo.js | 4 + .../rs-printSecondaryReplicationInfo.js | 4 + mongodb/examples/rs-reconfig.js | 44 + mongodb/examples/rs-remove.js | 7 + mongodb/examples/rs-status.js | 7 + mongodb/examples/sh-abortReshardCollection.js | 7 + mongodb/examples/sh-addShard.js | 13 + mongodb/examples/sh-addShardTag.js | 11 + mongodb/examples/sh-addShardToZone.js | 14 + mongodb/examples/sh-addTagRange.js | 15 + mongodb/examples/sh-analyzeShardKey.js | 13 + .../examples/sh-balancerCollectionStatus.js | 10 + .../examples/sh-checkMetadataConsistency.js | 7 + mongodb/examples/sh-clearBalancerWindow.js | 4 + .../examples/sh-commitReshardCollection.js | 7 + mongodb/examples/sh-configureQueryAnalyzer.js | 10 + mongodb/examples/sh-disableAutoMerger.js | 4 + mongodb/examples/sh-disableAutoSplit.js | 4 + mongodb/examples/sh-disableBalancing.js | 10 + mongodb/examples/sh-enableAutoMerger.js | 4 + mongodb/examples/sh-enableAutoSplit.js | 4 + mongodb/examples/sh-enableBalancing.js | 10 + mongodb/examples/sh-enableSharding.js | 13 + mongodb/examples/sh-flushRouterConfig.js | 7 + mongodb/examples/sh-getBalancerHost.js | 4 + mongodb/examples/sh-getBalancerLockDetails.js | 4 + mongodb/examples/sh-getBalancerState.js | 4 + mongodb/examples/sh-getBalancerWindow.js | 4 + mongodb/examples/sh-getRecentFailedRounds.js | 4 + mongodb/examples/sh-getRecentMigrations.js | 7 + .../examples/sh-getShardedDataDistribution.js | 4 + mongodb/examples/sh-getShouldAutoSplit.js | 4 + mongodb/examples/sh-help.js | 4 + mongodb/examples/sh-isBalancerRunning.js | 4 + mongodb/examples/sh-listShards.js | 4 + mongodb/examples/sh-moveChunk.js | 10 + mongodb/examples/sh-moveRange.js | 19 + .../examples/sh-refineCollectionShardKey.js | 10 + mongodb/examples/sh-removeShard.js | 10 + mongodb/examples/sh-removeShardFromZone.js | 10 + mongodb/examples/sh-removeShardTag.js | 10 + mongodb/examples/sh-removeTagRange.js | 12 + mongodb/examples/sh-reshardCollection.js | 24 + mongodb/examples/sh-setBalancerState.js | 7 + mongodb/examples/sh-setBalancerWindow.js | 10 + mongodb/examples/sh-shardCollection.js | 33 + mongodb/examples/sh-splitAt.js | 13 + mongodb/examples/sh-splitFind.js | 10 + mongodb/examples/sh-startBalancer.js | 10 + mongodb/examples/sh-status.js | 13 + mongodb/examples/sh-stopBalancer.js | 10 + .../sh-transitionFromDedicatedConfigServer.js | 4 + .../sh-transitionToDedicatedConfigServer.js | 4 + mongodb/examples/sh-unshardCollection.js | 10 + mongodb/examples/sh-updateZoneKeyRange.js | 23 + mongodb/examples/sh-waitForBalancer.js | 10 + mongodb/examples/sh-waitForBalancerOff.js | 7 + mongodb/examples/sh-waitForPingChange.js | 10 + mongodb/examples/sp-createStreamProcessor.js | 59 + mongodb/examples/sp-drop.js | 24 + mongodb/examples/sp-getProcessor.js | 17 + mongodb/examples/sp-listStreamProcessors.js | 18 + mongodb/examples/sp-process.js | 40 + mongodb/examples/sp-processor.js | 28 + mongodb/examples/sp-sample.js | 24 + mongodb/examples/sp-start.js | 20 + mongodb/examples/sp-stop.js | 24 + mongodb/mongoshell_lexer.go | 1427 +- mongodb/mongoshell_parser.go | 29558 +++++++++++++--- mongodb/mongoshellparser_base_listener.go | 668 + mongodb/mongoshellparser_base_visitor.go | 436 + mongodb/mongoshellparser_listener.go | 654 + mongodb/mongoshellparser_visitor.go | 327 + 301 files changed, 34095 insertions(+), 5234 deletions(-) create mode 100644 mongodb/examples/atlas-createSearchIndex.js create mode 100644 mongodb/examples/atlas-createSearchIndexes.js create mode 100644 mongodb/examples/atlas-dropSearchIndex.js create mode 100644 mongodb/examples/atlas-updateSearchIndex.js create mode 100644 mongodb/examples/bulk-arrayFilters.js create mode 100644 mongodb/examples/bulk-arrayInsert.js create mode 100644 mongodb/examples/bulk-collation.js create mode 100644 mongodb/examples/bulk-execute.js create mode 100644 mongodb/examples/bulk-find.js create mode 100644 mongodb/examples/bulk-getOperations.js create mode 100644 mongodb/examples/bulk-hint.js create mode 100644 mongodb/examples/bulk-initializeOrderedBulkOp.js create mode 100644 mongodb/examples/bulk-initializeUnorderedBulkOp.js create mode 100644 mongodb/examples/bulk-insert.js create mode 100644 mongodb/examples/bulk-mixed.js create mode 100644 mongodb/examples/bulk-remove.js create mode 100644 mongodb/examples/bulk-removeOne.js create mode 100644 mongodb/examples/bulk-replaceOne.js create mode 100644 mongodb/examples/bulk-toString.js create mode 100644 mongodb/examples/bulk-tojson.js create mode 100644 mongodb/examples/bulk-update.js create mode 100644 mongodb/examples/bulk-updateOne.js create mode 100644 mongodb/examples/bulk-updateOneWithArrayFilters.js create mode 100644 mongodb/examples/bulk-updateOneWithHint.js create mode 100644 mongodb/examples/bulk-upsert.js create mode 100644 mongodb/examples/collection-analyzeShardKey.js create mode 100644 mongodb/examples/collection-bulkWrite.js create mode 100644 mongodb/examples/collection-compactStructuredEncryptionData.js create mode 100644 mongodb/examples/collection-configureQueryAnalyzer.js create mode 100644 mongodb/examples/collection-count.js create mode 100644 mongodb/examples/collection-createIndex.js create mode 100644 mongodb/examples/collection-createIndexes.js create mode 100644 mongodb/examples/collection-dataSize.js create mode 100644 mongodb/examples/collection-deleteMany.js create mode 100644 mongodb/examples/collection-deleteOne.js create mode 100644 mongodb/examples/collection-drop.js create mode 100644 mongodb/examples/collection-dropIndex.js create mode 100644 mongodb/examples/collection-dropIndexes.js create mode 100644 mongodb/examples/collection-explain.js create mode 100644 mongodb/examples/collection-findAndModify.js create mode 100644 mongodb/examples/collection-findOneAndDelete.js create mode 100644 mongodb/examples/collection-findOneAndReplace.js create mode 100644 mongodb/examples/collection-findOneAndUpdate.js create mode 100644 mongodb/examples/collection-getShardDistribution.js create mode 100644 mongodb/examples/collection-getShardVersion.js create mode 100644 mongodb/examples/collection-hideIndex.js create mode 100644 mongodb/examples/collection-insert.js create mode 100644 mongodb/examples/collection-insertMany.js create mode 100644 mongodb/examples/collection-insertOne.js create mode 100644 mongodb/examples/collection-isCapped.js create mode 100644 mongodb/examples/collection-latencyStats.js create mode 100644 mongodb/examples/collection-mapReduce.js create mode 100644 mongodb/examples/collection-reIndex.js create mode 100644 mongodb/examples/collection-remove.js create mode 100644 mongodb/examples/collection-renameCollection.js create mode 100644 mongodb/examples/collection-replaceOne.js create mode 100644 mongodb/examples/collection-stats.js create mode 100644 mongodb/examples/collection-storageSize.js create mode 100644 mongodb/examples/collection-totalIndexSize.js create mode 100644 mongodb/examples/collection-totalSize.js create mode 100644 mongodb/examples/collection-unhideIndex.js create mode 100644 mongodb/examples/collection-update.js create mode 100644 mongodb/examples/collection-updateMany.js create mode 100644 mongodb/examples/collection-updateOne.js create mode 100644 mongodb/examples/collection-validate.js create mode 100644 mongodb/examples/collection-watch.js create mode 100644 mongodb/examples/connection-Mongo.js create mode 100644 mongodb/examples/connection-adminCommand.js create mode 100644 mongodb/examples/connection-close.js create mode 100644 mongodb/examples/connection-connect.js create mode 100644 mongodb/examples/connection-getDB.js create mode 100644 mongodb/examples/connection-getDBNames.js create mode 100644 mongodb/examples/connection-getReadConcern.js create mode 100644 mongodb/examples/connection-getReadPref.js create mode 100644 mongodb/examples/connection-getReadPrefMode.js create mode 100644 mongodb/examples/connection-getReadPrefTagSet.js create mode 100644 mongodb/examples/connection-getWriteConcern.js create mode 100644 mongodb/examples/connection-setReadConcern.js create mode 100644 mongodb/examples/connection-setReadPref.js create mode 100644 mongodb/examples/connection-setWriteConcern.js create mode 100644 mongodb/examples/connection-startSession.js create mode 100644 mongodb/examples/connection-watch.js create mode 100644 mongodb/examples/cursor-addOption.js create mode 100644 mongodb/examples/cursor-allowDiskUse.js create mode 100644 mongodb/examples/cursor-batchSize.js create mode 100644 mongodb/examples/cursor-close.js create mode 100644 mongodb/examples/cursor-collation.js create mode 100644 mongodb/examples/cursor-comment.js create mode 100644 mongodb/examples/cursor-count.js create mode 100644 mongodb/examples/cursor-explain.js create mode 100644 mongodb/examples/cursor-forEach.js create mode 100644 mongodb/examples/cursor-hasNext.js create mode 100644 mongodb/examples/cursor-hint.js create mode 100644 mongodb/examples/cursor-isClosed.js create mode 100644 mongodb/examples/cursor-isExhausted.js create mode 100644 mongodb/examples/cursor-itcount.js create mode 100644 mongodb/examples/cursor-limit.js create mode 100644 mongodb/examples/cursor-map.js create mode 100644 mongodb/examples/cursor-max.js create mode 100644 mongodb/examples/cursor-maxAwaitTimeMS.js create mode 100644 mongodb/examples/cursor-maxTimeMS.js create mode 100644 mongodb/examples/cursor-min.js create mode 100644 mongodb/examples/cursor-next.js create mode 100644 mongodb/examples/cursor-noCursorTimeout.js create mode 100644 mongodb/examples/cursor-objsLeftInBatch.js create mode 100644 mongodb/examples/cursor-pretty.js create mode 100644 mongodb/examples/cursor-projection.js create mode 100644 mongodb/examples/cursor-readConcern.js create mode 100644 mongodb/examples/cursor-readPref.js create mode 100644 mongodb/examples/cursor-returnKey.js create mode 100644 mongodb/examples/cursor-showRecordId.js create mode 100644 mongodb/examples/cursor-size.js create mode 100644 mongodb/examples/cursor-skip.js create mode 100644 mongodb/examples/cursor-sort.js create mode 100644 mongodb/examples/cursor-tailable.js create mode 100644 mongodb/examples/cursor-toArray.js create mode 100644 mongodb/examples/cursor-tryNext.js create mode 100644 mongodb/examples/db-adminCommand.js create mode 100644 mongodb/examples/db-aggregate.js create mode 100644 mongodb/examples/db-auth.js create mode 100644 mongodb/examples/db-changeUserPassword.js create mode 100644 mongodb/examples/db-cloneDatabase.js create mode 100644 mongodb/examples/db-commandHelp.js create mode 100644 mongodb/examples/db-copyDatabase.js create mode 100644 mongodb/examples/db-createCollection.js create mode 100644 mongodb/examples/db-createRole.js create mode 100644 mongodb/examples/db-createUser.js create mode 100644 mongodb/examples/db-createView.js create mode 100644 mongodb/examples/db-currentOp.js create mode 100644 mongodb/examples/db-dropAllRoles.js create mode 100644 mongodb/examples/db-dropAllUsers.js create mode 100644 mongodb/examples/db-dropDatabase.js create mode 100644 mongodb/examples/db-dropRole.js create mode 100644 mongodb/examples/db-dropUser.js create mode 100644 mongodb/examples/db-fsyncLock.js create mode 100644 mongodb/examples/db-fsyncUnlock.js create mode 100644 mongodb/examples/db-getLogComponents.js create mode 100644 mongodb/examples/db-getMongo.js create mode 100644 mongodb/examples/db-getName.js create mode 100644 mongodb/examples/db-getProfilingLevel.js create mode 100644 mongodb/examples/db-getProfilingStatus.js create mode 100644 mongodb/examples/db-getReplicationInfo.js create mode 100644 mongodb/examples/db-getRole.js create mode 100644 mongodb/examples/db-getRoles.js create mode 100644 mongodb/examples/db-getSiblingDB.js create mode 100644 mongodb/examples/db-getUser.js create mode 100644 mongodb/examples/db-getUsers.js create mode 100644 mongodb/examples/db-grantPrivilegesToRole.js create mode 100644 mongodb/examples/db-grantRolesToRole.js create mode 100644 mongodb/examples/db-grantRolesToUser.js create mode 100644 mongodb/examples/db-hello.js create mode 100644 mongodb/examples/db-hostInfo.js create mode 100644 mongodb/examples/db-isMaster.js create mode 100644 mongodb/examples/db-killOp.js create mode 100644 mongodb/examples/db-listCommands.js create mode 100644 mongodb/examples/db-logout.js create mode 100644 mongodb/examples/db-printCollectionStats.js create mode 100644 mongodb/examples/db-printReplicationInfo.js create mode 100644 mongodb/examples/db-printSecondaryReplicationInfo.js create mode 100644 mongodb/examples/db-printShardingStatus.js create mode 100644 mongodb/examples/db-printSlaveReplicationInfo.js create mode 100644 mongodb/examples/db-revokePrivilegesFromRole.js create mode 100644 mongodb/examples/db-revokeRolesFromRole.js create mode 100644 mongodb/examples/db-revokeRolesFromUser.js create mode 100644 mongodb/examples/db-rotateCertificates.js create mode 100644 mongodb/examples/db-runCommand.js create mode 100644 mongodb/examples/db-serverBuildInfo.js create mode 100644 mongodb/examples/db-serverStatus.js create mode 100644 mongodb/examples/db-setLogLevel.js create mode 100644 mongodb/examples/db-setProfilingLevel.js create mode 100644 mongodb/examples/db-setSecondaryOk.js create mode 100644 mongodb/examples/db-setWriteConcern.js create mode 100644 mongodb/examples/db-shutdownServer.js create mode 100644 mongodb/examples/db-stats.js create mode 100644 mongodb/examples/db-updateRole.js create mode 100644 mongodb/examples/db-updateUser.js create mode 100644 mongodb/examples/db-version.js create mode 100644 mongodb/examples/db-watch.js create mode 100644 mongodb/examples/encryption-addKeyAlternateName.js create mode 100644 mongodb/examples/encryption-createEncryptedCollection.js create mode 100644 mongodb/examples/encryption-createKey.js create mode 100644 mongodb/examples/encryption-decrypt.js create mode 100644 mongodb/examples/encryption-deleteKey.js create mode 100644 mongodb/examples/encryption-encrypt.js create mode 100644 mongodb/examples/encryption-encryptExpression.js create mode 100644 mongodb/examples/encryption-getClientEncryption.js create mode 100644 mongodb/examples/encryption-getKey.js create mode 100644 mongodb/examples/encryption-getKeyByAltName.js create mode 100644 mongodb/examples/encryption-getKeyVault.js create mode 100644 mongodb/examples/encryption-getKeys.js create mode 100644 mongodb/examples/encryption-removeKeyAlternateName.js create mode 100644 mongodb/examples/encryption-rewrapManyDataKey.js create mode 100644 mongodb/examples/native-cat.js create mode 100644 mongodb/examples/native-cd.js create mode 100644 mongodb/examples/native-getHostName.js create mode 100644 mongodb/examples/native-getMemInfo.js create mode 100644 mongodb/examples/native-hostname.js create mode 100644 mongodb/examples/native-isInteractive.js create mode 100644 mongodb/examples/native-listFiles.js create mode 100644 mongodb/examples/native-load.js create mode 100644 mongodb/examples/native-ls.js create mode 100644 mongodb/examples/native-md5sumFile.js create mode 100644 mongodb/examples/native-mkdir.js create mode 100644 mongodb/examples/native-pwd.js create mode 100644 mongodb/examples/native-quit.js create mode 100644 mongodb/examples/native-removeFile.js create mode 100644 mongodb/examples/native-sleep.js create mode 100644 mongodb/examples/native-version.js create mode 100644 mongodb/examples/objectConstructor-BSONRegExp.js create mode 100644 mongodb/examples/objectConstructor-BinData.js create mode 100644 mongodb/examples/objectConstructor-Binary.js create mode 100644 mongodb/examples/objectConstructor-HexData.js create mode 100644 mongodb/examples/plancache-clear.js create mode 100644 mongodb/examples/plancache-clearPlansByQuery.js create mode 100644 mongodb/examples/plancache-getPlanCache.js create mode 100644 mongodb/examples/plancache-help.js create mode 100644 mongodb/examples/plancache-list.js create mode 100644 mongodb/examples/rs-add.js create mode 100644 mongodb/examples/rs-addArb.js create mode 100644 mongodb/examples/rs-conf.js create mode 100644 mongodb/examples/rs-config.js create mode 100644 mongodb/examples/rs-freeze.js create mode 100644 mongodb/examples/rs-hello.js create mode 100644 mongodb/examples/rs-help.js create mode 100644 mongodb/examples/rs-initiate.js create mode 100644 mongodb/examples/rs-isMaster.js create mode 100644 mongodb/examples/rs-printReplicationInfo.js create mode 100644 mongodb/examples/rs-printSecondaryReplicationInfo.js create mode 100644 mongodb/examples/rs-reconfig.js create mode 100644 mongodb/examples/rs-remove.js create mode 100644 mongodb/examples/rs-status.js create mode 100644 mongodb/examples/sh-abortReshardCollection.js create mode 100644 mongodb/examples/sh-addShard.js create mode 100644 mongodb/examples/sh-addShardTag.js create mode 100644 mongodb/examples/sh-addShardToZone.js create mode 100644 mongodb/examples/sh-addTagRange.js create mode 100644 mongodb/examples/sh-analyzeShardKey.js create mode 100644 mongodb/examples/sh-balancerCollectionStatus.js create mode 100644 mongodb/examples/sh-checkMetadataConsistency.js create mode 100644 mongodb/examples/sh-clearBalancerWindow.js create mode 100644 mongodb/examples/sh-commitReshardCollection.js create mode 100644 mongodb/examples/sh-configureQueryAnalyzer.js create mode 100644 mongodb/examples/sh-disableAutoMerger.js create mode 100644 mongodb/examples/sh-disableAutoSplit.js create mode 100644 mongodb/examples/sh-disableBalancing.js create mode 100644 mongodb/examples/sh-enableAutoMerger.js create mode 100644 mongodb/examples/sh-enableAutoSplit.js create mode 100644 mongodb/examples/sh-enableBalancing.js create mode 100644 mongodb/examples/sh-enableSharding.js create mode 100644 mongodb/examples/sh-flushRouterConfig.js create mode 100644 mongodb/examples/sh-getBalancerHost.js create mode 100644 mongodb/examples/sh-getBalancerLockDetails.js create mode 100644 mongodb/examples/sh-getBalancerState.js create mode 100644 mongodb/examples/sh-getBalancerWindow.js create mode 100644 mongodb/examples/sh-getRecentFailedRounds.js create mode 100644 mongodb/examples/sh-getRecentMigrations.js create mode 100644 mongodb/examples/sh-getShardedDataDistribution.js create mode 100644 mongodb/examples/sh-getShouldAutoSplit.js create mode 100644 mongodb/examples/sh-help.js create mode 100644 mongodb/examples/sh-isBalancerRunning.js create mode 100644 mongodb/examples/sh-listShards.js create mode 100644 mongodb/examples/sh-moveChunk.js create mode 100644 mongodb/examples/sh-moveRange.js create mode 100644 mongodb/examples/sh-refineCollectionShardKey.js create mode 100644 mongodb/examples/sh-removeShard.js create mode 100644 mongodb/examples/sh-removeShardFromZone.js create mode 100644 mongodb/examples/sh-removeShardTag.js create mode 100644 mongodb/examples/sh-removeTagRange.js create mode 100644 mongodb/examples/sh-reshardCollection.js create mode 100644 mongodb/examples/sh-setBalancerState.js create mode 100644 mongodb/examples/sh-setBalancerWindow.js create mode 100644 mongodb/examples/sh-shardCollection.js create mode 100644 mongodb/examples/sh-splitAt.js create mode 100644 mongodb/examples/sh-splitFind.js create mode 100644 mongodb/examples/sh-startBalancer.js create mode 100644 mongodb/examples/sh-status.js create mode 100644 mongodb/examples/sh-stopBalancer.js create mode 100644 mongodb/examples/sh-transitionFromDedicatedConfigServer.js create mode 100644 mongodb/examples/sh-transitionToDedicatedConfigServer.js create mode 100644 mongodb/examples/sh-unshardCollection.js create mode 100644 mongodb/examples/sh-updateZoneKeyRange.js create mode 100644 mongodb/examples/sh-waitForBalancer.js create mode 100644 mongodb/examples/sh-waitForBalancerOff.js create mode 100644 mongodb/examples/sh-waitForPingChange.js create mode 100644 mongodb/examples/sp-createStreamProcessor.js create mode 100644 mongodb/examples/sp-drop.js create mode 100644 mongodb/examples/sp-getProcessor.js create mode 100644 mongodb/examples/sp-listStreamProcessors.js create mode 100644 mongodb/examples/sp-process.js create mode 100644 mongodb/examples/sp-processor.js create mode 100644 mongodb/examples/sp-sample.js create mode 100644 mongodb/examples/sp-start.js create mode 100644 mongodb/examples/sp-stop.js diff --git a/mongodb/MongoShellLexer.g4 b/mongodb/MongoShellLexer.g4 index 521878f..e8d6250 100644 --- a/mongodb/MongoShellLexer.g4 +++ b/mongodb/MongoShellLexer.g4 @@ -34,6 +34,12 @@ NUMBER_DECIMAL: 'NumberDecimal'; TIMESTAMP: 'Timestamp'; REG_EXP: 'RegExp'; +// Additional object constructors +BIN_DATA: 'BinData'; +BINARY: 'Binary'; +BSON_REG_EXP: 'BSONRegExp'; +HEX_DATA: 'HexData'; + // Collection methods FIND: 'find'; FIND_ONE: 'findOne'; @@ -43,6 +49,81 @@ DISTINCT: 'distinct'; AGGREGATE: 'aggregate'; GET_INDEXES: 'getIndexes'; +// Collection write methods (M2) +INSERT_ONE: 'insertOne'; +INSERT_MANY: 'insertMany'; +UPDATE_ONE: 'updateOne'; +UPDATE_MANY: 'updateMany'; +DELETE_ONE: 'deleteOne'; +DELETE_MANY: 'deleteMany'; +REPLACE_ONE: 'replaceOne'; +FIND_ONE_AND_UPDATE: 'findOneAndUpdate'; +FIND_ONE_AND_REPLACE: 'findOneAndReplace'; +FIND_ONE_AND_DELETE: 'findOneAndDelete'; + +// Collection index/schema methods (M3) +CREATE_INDEX: 'createIndex'; +CREATE_INDEXES: 'createIndexes'; +DROP_INDEX: 'dropIndex'; +DROP_INDEXES: 'dropIndexes'; +DROP: 'drop'; +RENAME_COLLECTION: 'renameCollection'; +STATS: 'stats'; +STORAGE_SIZE: 'storageSize'; +TOTAL_INDEX_SIZE: 'totalIndexSize'; +TOTAL_SIZE: 'totalSize'; +DATA_SIZE: 'dataSize'; +IS_CAPPED: 'isCapped'; +VALIDATE: 'validate'; +LATENCY_STATS: 'latencyStats'; + +// Database methods (M4) +CREATE_COLLECTION: 'createCollection'; +DROP_DATABASE: 'dropDatabase'; +HOST_INFO: 'hostInfo'; +LIST_COMMANDS: 'listCommands'; +SERVER_BUILD_INFO: 'serverBuildInfo'; +SERVER_STATUS: 'serverStatus'; +VERSION: 'version'; +RUN_COMMAND: 'runCommand'; +ADMIN_COMMAND: 'adminCommand'; +GET_NAME: 'getName'; +GET_MONGO: 'getMongo'; +GET_SIBLING_DB: 'getSiblingDB'; + +// Connection methods +MONGO: 'Mongo'; +CONNECT: 'connect'; + +// Replication methods +RS: 'rs'; + +// Sharding methods +SH: 'sh'; + +// Atlas stream processing +SP: 'sp'; + +GET_DB: 'getDB'; +GET_READ_CONCERN: 'getReadConcern'; +GET_READ_PREF: 'getReadPref'; +GET_READ_PREF_MODE: 'getReadPrefMode'; +GET_READ_PREF_TAG_SET: 'getReadPrefTagSet'; +GET_WRITE_CONCERN: 'getWriteConcern'; +SET_READ_PREF: 'setReadPref'; +SET_READ_CONCERN: 'setReadConcern'; +SET_WRITE_CONCERN: 'setWriteConcern'; +START_SESSION: 'startSession'; +WATCH: 'watch'; +GET_DB_NAMES: 'getDBNames'; + +// Encryption methods +GET_KEY_VAULT: 'getKeyVault'; +GET_CLIENT_ENCRYPTION: 'getClientEncryption'; + +// Plan cache methods +GET_PLAN_CACHE: 'getPlanCache'; + // Cursor modifiers (methods) SORT: 'sort'; LIMIT: 'limit'; @@ -51,6 +132,47 @@ PROJECTION: 'projection'; PROJECT: 'project'; COUNT: 'count'; +// Bulk operation methods +INITIALIZE_ORDERED_BULK_OP: 'initializeOrderedBulkOp'; +INITIALIZE_UNORDERED_BULK_OP: 'initializeUnorderedBulkOp'; +EXECUTE: 'execute'; +GET_OPERATIONS: 'getOperations'; +TO_STRING: 'toString'; +INSERT: 'insert'; +REMOVE: 'remove'; + +// Additional cursor methods +BATCH_SIZE: 'batchSize'; +CLOSE: 'close'; +COLLATION: 'collation'; +COMMENT: 'comment'; +EXPLAIN: 'explain'; +FOR_EACH: 'forEach'; +HAS_NEXT: 'hasNext'; +HINT: 'hint'; +IS_CLOSED: 'isClosed'; +IS_EXHAUSTED: 'isExhausted'; +IT_COUNT: 'itcount'; +MAP: 'map'; +MAX: 'max'; +MAX_AWAIT_TIME_MS: 'maxAwaitTimeMS'; +MAX_TIME_MS: 'maxTimeMS'; +MIN: 'min'; +NEXT: 'next'; +NO_CURSOR_TIMEOUT: 'noCursorTimeout'; +OBJS_LEFT_IN_BATCH: 'objsLeftInBatch'; +PRETTY: 'pretty'; +READ_CONCERN: 'readConcern'; +READ_PREF: 'readPref'; +RETURN_KEY: 'returnKey'; +SHOW_RECORD_ID: 'showRecordId'; +SIZE: 'size'; +TAILABLE: 'tailable'; +TO_ARRAY: 'toArray'; +TRY_NEXT: 'tryNext'; +ALLOW_DISK_USE: 'allowDiskUse'; +ADD_OPTION: 'addOption'; + // Punctuation LPAREN: '('; RPAREN: ')'; diff --git a/mongodb/MongoShellParser.g4 b/mongodb/MongoShellParser.g4 index 3b4631d..6ac16c6 100644 --- a/mongodb/MongoShellParser.g4 +++ b/mongodb/MongoShellParser.g4 @@ -2,14 +2,22 @@ * MongoDB Shell (mongosh) Parser Grammar * For use with ANTLR 4 * - * Milestone 1: Read Operations + Utility + Aggregation + * Supports all mongosh commands: + * - Collection methods (48): find, insertOne, updateMany, aggregate, etc. + * - Cursor methods (34): sort, limit, skip, forEach, toArray, etc. + * - Database methods (39): createCollection, dropDatabase, stats, etc. + * - Bulk operations (21): initializeOrderedBulkOp, Bulk.insert, etc. + * - Connection methods (16): Mongo, connect, getDB, setReadPref, etc. + * - Replication methods (14): rs.status, rs.initiate, rs.add, etc. + * - Sharding methods (52): sh.status, sh.enableSharding, sh.shardCollection, etc. + * - User management (12): createUser, dropUser, auth, etc. + * - Role management (10): createRole, dropRole, grantRolesToUser, etc. + * - Encryption methods (17): KeyVault, ClientEncryption, getKeyVault, etc. + * - Native methods (16): cat, load, quit, pwd, etc. + * - Object constructors (18): ObjectId, ISODate, UUID, BinData, etc. + * - Query plan cache (5): getPlanCache, clear, list, etc. + * - Atlas-specific (13): Search Index (4), Stream Processing (9) * - Shell commands: show dbs, show databases, show collections - * - Utility: db.getCollectionNames(), db.getCollectionInfos() - * - Collection info: db.collection.getIndexes() - * - Read methods: find(), findOne(), countDocuments(), estimatedDocumentCount(), distinct() - * - Aggregation: db.collection.aggregate() - * - Cursor modifiers: sort(), limit(), skip(), count(), projection(), project() - * - Object constructors: ObjectId(), ISODate(), UUID(), NumberInt(), NumberLong(), NumberDecimal() * - Document syntax with unquoted keys and trailing commas */ @@ -22,10 +30,18 @@ program : statement* EOF ; -// A statement is either a shell command or a database statement +// A statement is either a shell command, a database statement, a bulk statement, a connection statement, a replica set statement, a sharding statement, an encryption statement, a plan cache statement, a stream processing statement, or a native function call statement : shellCommand SEMI? | dbStatement SEMI? + | bulkStatement SEMI? + | connectionStatement SEMI? + | rsStatement SEMI? + | shStatement SEMI? + | encryptionStatement SEMI? + | planCacheStatement SEMI? + | spStatement SEMI? + | nativeFunctionCall SEMI? ; // Shell commands: show dbs, show databases, show collections @@ -38,9 +54,116 @@ shellCommand dbStatement : DB DOT GET_COLLECTION_NAMES LPAREN RPAREN methodChain? # getCollectionNames | DB DOT GET_COLLECTION_INFOS LPAREN arguments? RPAREN methodChain? # getCollectionInfos + | DB DOT CREATE_COLLECTION LPAREN arguments RPAREN # createCollection + | DB DOT DROP_DATABASE LPAREN RPAREN # dropDatabase + | DB DOT STATS LPAREN argument? RPAREN # dbStats + | DB DOT SERVER_STATUS LPAREN argument? RPAREN # serverStatus + | DB DOT SERVER_BUILD_INFO LPAREN RPAREN # serverBuildInfo + | DB DOT VERSION LPAREN RPAREN # dbVersion + | DB DOT HOST_INFO LPAREN RPAREN # hostInfo + | DB DOT LIST_COMMANDS LPAREN RPAREN # listCommands + | DB DOT RUN_COMMAND LPAREN arguments RPAREN # runCommand + | DB DOT ADMIN_COMMAND LPAREN arguments RPAREN # adminCommand + | DB DOT GET_NAME LPAREN RPAREN # getName + | DB DOT GET_MONGO LPAREN RPAREN # getMongo + | DB DOT GET_SIBLING_DB LPAREN argument RPAREN # getSiblingDB + | DB DOT genericDbMethod # dbGenericMethod | DB collectionAccess methodChain # collectionOperation ; +// Generic database method for extensibility (unsupported methods) +genericDbMethod + : identifier LPAREN arguments? RPAREN + ; + +// Bulk operation statements +// Pattern: db.collection.initializeOrderedBulkOp().find(...).update(...).execute() +bulkStatement + : DB collectionAccess DOT bulkInitMethod bulkMethodChain? + ; + +bulkInitMethod + : INITIALIZE_ORDERED_BULK_OP LPAREN RPAREN + | INITIALIZE_UNORDERED_BULK_OP LPAREN RPAREN + ; + +bulkMethodChain + : (DOT bulkMethod)+ + ; + +bulkMethod + : FIND LPAREN argument RPAREN # bulkFind + | INSERT LPAREN argument RPAREN # bulkInsert + | REMOVE LPAREN RPAREN # bulkRemove + | EXECUTE LPAREN argument? RPAREN # bulkExecute + | GET_OPERATIONS LPAREN RPAREN # bulkGetOperations + | TO_STRING LPAREN RPAREN # bulkToString + | identifier LPAREN arguments? RPAREN # bulkGenericMethod + ; + +// Connection statements - top-level Mongo() constructor and connect() function +connectionStatement + : MONGO LPAREN arguments? RPAREN connectionMethodChain? # mongoConnection + | CONNECT LPAREN arguments? RPAREN connectionMethodChain? # connectCall + | DB DOT GET_MONGO LPAREN RPAREN connectionMethodChain # dbGetMongoChain + ; + +// Connection method chain for chaining methods on a connection +connectionMethodChain + : (DOT connectionMethod)+ + ; + +// Replication (replica set) statements - rs.method() +rsStatement + : RS DOT identifier LPAREN arguments? RPAREN + ; + +// Sharding statements - sh.method() +shStatement + : SH DOT identifier LPAREN arguments? RPAREN + ; + +// Encryption statements - db.getMongo().getKeyVault().xxx() or db.getMongo().getClientEncryption().xxx() +encryptionStatement + : DB DOT GET_MONGO LPAREN RPAREN DOT GET_KEY_VAULT LPAREN RPAREN (DOT identifier LPAREN arguments? RPAREN)* # keyVaultStatement + | DB DOT GET_MONGO LPAREN RPAREN DOT GET_CLIENT_ENCRYPTION LPAREN RPAREN (DOT identifier LPAREN arguments? RPAREN)* # clientEncryptionStatement + ; + +// Plan cache statements - db.collection.getPlanCache().xxx() +planCacheStatement + : DB collectionAccess DOT GET_PLAN_CACHE LPAREN RPAREN (DOT identifier LPAREN arguments? RPAREN)* + ; + +// Stream processing statements - sp.method() or sp.processor.method() +spStatement + : SP DOT identifier LPAREN arguments? RPAREN + | SP DOT identifier DOT identifier LPAREN arguments? RPAREN + ; + +// Native shell function calls - top-level functions like cat(), load(), quit() +nativeFunctionCall + : identifier LPAREN arguments? RPAREN + ; + +// Connection methods that can be called on a Mongo connection object +connectionMethod + : GET_DB LPAREN argument RPAREN # connGetDB + | GET_READ_CONCERN LPAREN RPAREN # connGetReadConcern + | GET_READ_PREF LPAREN RPAREN # connGetReadPref + | GET_READ_PREF_MODE LPAREN RPAREN # connGetReadPrefMode + | GET_READ_PREF_TAG_SET LPAREN RPAREN # connGetReadPrefTagSet + | GET_WRITE_CONCERN LPAREN RPAREN # connGetWriteConcern + | SET_READ_PREF LPAREN arguments RPAREN # connSetReadPref + | SET_READ_CONCERN LPAREN argument RPAREN # connSetReadConcern + | SET_WRITE_CONCERN LPAREN argument RPAREN # connSetWriteConcern + | START_SESSION LPAREN argument? RPAREN # connStartSession + | WATCH LPAREN arguments? RPAREN # connWatch + | CLOSE LPAREN RPAREN # connClose + | ADMIN_COMMAND LPAREN arguments RPAREN # connAdminCommand + | GET_DB_NAMES LPAREN RPAREN # connGetDBNames + | identifier LPAREN arguments? RPAREN # connGenericMethod + ; + // Collection access patterns collectionAccess : DOT identifier # dotAccess @@ -62,11 +185,65 @@ methodCall | distinctMethod | aggregateMethod | getIndexesMethod + | insertOneMethod + | insertManyMethod + | updateOneMethod + | updateManyMethod + | deleteOneMethod + | deleteManyMethod + | replaceOneMethod + | findOneAndUpdateMethod + | findOneAndReplaceMethod + | findOneAndDeleteMethod + | createIndexMethod + | createIndexesMethod + | dropIndexMethod + | dropIndexesMethod + | dropMethod + | renameCollectionMethod + | statsMethod + | storageSizeMethod + | totalIndexSizeMethod + | totalSizeMethod + | dataSizeMethod + | isCappedMethod + | validateMethod + | latencyStatsMethod | sortMethod | limitMethod | skipMethod | countMethod | projectionMethod + | batchSizeMethod + | closeMethod + | collationMethod + | commentMethod + | explainMethod + | forEachMethod + | hasNextMethod + | hintMethod + | isClosedMethod + | isExhaustedMethod + | itcountMethod + | mapMethod + | maxMethod + | maxAwaitTimeMSMethod + | maxTimeMSMethod + | minMethod + | nextMethod + | noCursorTimeoutMethod + | objsLeftInBatchMethod + | prettyMethod + | readConcernMethod + | readPrefMethod + | returnKeyMethod + | showRecordIdMethod + | sizeMethod + | tailableMethod + | toArrayMethod + | tryNextMethod + | allowDiskUseMethod + | addOptionMethod | genericMethod ; @@ -104,6 +281,126 @@ getIndexesMethod : GET_INDEXES LPAREN RPAREN ; +// insertOne(document, options?) +insertOneMethod + : INSERT_ONE LPAREN arguments RPAREN + ; + +// insertMany(documents, options?) +insertManyMethod + : INSERT_MANY LPAREN arguments RPAREN + ; + +// updateOne(filter, update, options?) +updateOneMethod + : UPDATE_ONE LPAREN arguments RPAREN + ; + +// updateMany(filter, update, options?) +updateManyMethod + : UPDATE_MANY LPAREN arguments RPAREN + ; + +// deleteOne(filter, options?) +deleteOneMethod + : DELETE_ONE LPAREN arguments RPAREN + ; + +// deleteMany(filter, options?) +deleteManyMethod + : DELETE_MANY LPAREN arguments RPAREN + ; + +// replaceOne(filter, replacement, options?) +replaceOneMethod + : REPLACE_ONE LPAREN arguments RPAREN + ; + +// findOneAndUpdate(filter, update, options?) +findOneAndUpdateMethod + : FIND_ONE_AND_UPDATE LPAREN arguments RPAREN + ; + +// findOneAndReplace(filter, replacement, options?) +findOneAndReplaceMethod + : FIND_ONE_AND_REPLACE LPAREN arguments RPAREN + ; + +// findOneAndDelete(filter, options?) +findOneAndDeleteMethod + : FIND_ONE_AND_DELETE LPAREN arguments RPAREN + ; + +// createIndex(keys, options?) +createIndexMethod + : CREATE_INDEX LPAREN arguments RPAREN + ; + +// createIndexes(keyPatterns, options?) +createIndexesMethod + : CREATE_INDEXES LPAREN arguments RPAREN + ; + +// dropIndex(index) +dropIndexMethod + : DROP_INDEX LPAREN argument RPAREN + ; + +// dropIndexes(indexes?) +dropIndexesMethod + : DROP_INDEXES LPAREN argument? RPAREN + ; + +// drop(options?) +dropMethod + : DROP LPAREN argument? RPAREN + ; + +// renameCollection(newName, dropTarget?) +renameCollectionMethod + : RENAME_COLLECTION LPAREN arguments RPAREN + ; + +// stats(options?) +statsMethod + : STATS LPAREN argument? RPAREN + ; + +// storageSize() +storageSizeMethod + : STORAGE_SIZE LPAREN RPAREN + ; + +// totalIndexSize() +totalIndexSizeMethod + : TOTAL_INDEX_SIZE LPAREN RPAREN + ; + +// totalSize() +totalSizeMethod + : TOTAL_SIZE LPAREN RPAREN + ; + +// dataSize() +dataSizeMethod + : DATA_SIZE LPAREN RPAREN + ; + +// isCapped() +isCappedMethod + : IS_CAPPED LPAREN RPAREN + ; + +// validate(options?) +validateMethod + : VALIDATE LPAREN argument? RPAREN + ; + +// latencyStats(options?) +latencyStatsMethod + : LATENCY_STATS LPAREN argument? RPAREN + ; + sortMethod : SORT LPAREN document RPAREN ; @@ -125,6 +422,127 @@ projectionMethod : (PROJECTION | PROJECT) LPAREN document RPAREN ; +// Cursor methods +batchSizeMethod + : BATCH_SIZE LPAREN NUMBER RPAREN + ; + +closeMethod + : CLOSE LPAREN RPAREN + ; + +collationMethod + : COLLATION LPAREN document RPAREN + ; + +commentMethod + : COMMENT LPAREN stringLiteral RPAREN + ; + +explainMethod + : EXPLAIN LPAREN stringLiteral? RPAREN + ; + +forEachMethod + : FOR_EACH LPAREN argument RPAREN + ; + +hasNextMethod + : HAS_NEXT LPAREN RPAREN + ; + +hintMethod + : HINT LPAREN argument RPAREN + ; + +isClosedMethod + : IS_CLOSED LPAREN RPAREN + ; + +isExhaustedMethod + : IS_EXHAUSTED LPAREN RPAREN + ; + +itcountMethod + : IT_COUNT LPAREN RPAREN + ; + +mapMethod + : MAP LPAREN argument RPAREN + ; + +maxMethod + : MAX LPAREN document RPAREN + ; + +maxAwaitTimeMSMethod + : MAX_AWAIT_TIME_MS LPAREN NUMBER RPAREN + ; + +maxTimeMSMethod + : MAX_TIME_MS LPAREN NUMBER RPAREN + ; + +minMethod + : MIN LPAREN document RPAREN + ; + +nextMethod + : NEXT LPAREN RPAREN + ; + +noCursorTimeoutMethod + : NO_CURSOR_TIMEOUT LPAREN RPAREN + ; + +objsLeftInBatchMethod + : OBJS_LEFT_IN_BATCH LPAREN RPAREN + ; + +prettyMethod + : PRETTY LPAREN RPAREN + ; + +readConcernMethod + : READ_CONCERN LPAREN document RPAREN + ; + +readPrefMethod + : READ_PREF LPAREN arguments RPAREN + ; + +returnKeyMethod + : RETURN_KEY LPAREN (TRUE | FALSE) RPAREN + ; + +showRecordIdMethod + : SHOW_RECORD_ID LPAREN (TRUE | FALSE) RPAREN + ; + +sizeMethod + : SIZE LPAREN RPAREN + ; + +tailableMethod + : TAILABLE LPAREN (TRUE | FALSE)? RPAREN + ; + +toArrayMethod + : TO_ARRAY LPAREN RPAREN + ; + +tryNextMethod + : TRY_NEXT LPAREN RPAREN + ; + +allowDiskUseMethod + : ALLOW_DISK_USE LPAREN (TRUE | FALSE)? RPAREN + ; + +addOptionMethod + : ADD_OPTION LPAREN NUMBER RPAREN + ; + // Generic method for extensibility (other methods will be caught here) genericMethod : identifier LPAREN arguments? RPAREN @@ -168,7 +586,7 @@ value // Catch 'new' keyword usage and provide helpful error message newKeywordError - : NEW (OBJECT_ID | ISO_DATE | DATE | UUID | LONG | NUMBER_LONG | INT32 | NUMBER_INT | DOUBLE | DECIMAL128 | NUMBER_DECIMAL | TIMESTAMP | REG_EXP) + : NEW (OBJECT_ID | ISO_DATE | DATE | UUID | LONG | NUMBER_LONG | INT32 | NUMBER_INT | DOUBLE | DECIMAL128 | NUMBER_DECIMAL | TIMESTAMP | REG_EXP | BIN_DATA | BINARY | BSON_REG_EXP | HEX_DATA) { p.NotifyErrorListeners("'new' keyword is not supported. Use ObjectId(), ISODate(), UUID(), etc. directly without 'new'", nil, nil) } LPAREN arguments? RPAREN ; @@ -190,6 +608,10 @@ helperFunction | doubleHelper | decimal128Helper | timestampHelper + | binDataHelper + | binaryHelper + | bsonRegExpHelper + | hexDataHelper ; // ObjectId("hex") or ObjectId() @@ -243,6 +665,27 @@ regExpConstructor : REG_EXP LPAREN stringLiteral (COMMA stringLiteral)? RPAREN ; +// BinData(subtype, base64) - Binary data with subtype +binDataHelper + : BIN_DATA LPAREN NUMBER COMMA stringLiteral RPAREN + ; + +// Binary(buffer, subtype) or Binary.createFromBase64(base64, subtype) +binaryHelper + : BINARY LPAREN arguments RPAREN + | BINARY DOT identifier LPAREN arguments RPAREN + ; + +// BSONRegExp(pattern, flags) +bsonRegExpHelper + : BSON_REG_EXP LPAREN arguments RPAREN + ; + +// HexData(subtype, hex) +hexDataHelper + : HEX_DATA LPAREN NUMBER COMMA stringLiteral RPAREN + ; + // Literals literal : stringLiteral # stringLiteralValue @@ -280,6 +723,30 @@ identifier | DISTINCT | AGGREGATE | GET_INDEXES + | INSERT_ONE + | INSERT_MANY + | UPDATE_ONE + | UPDATE_MANY + | DELETE_ONE + | DELETE_MANY + | REPLACE_ONE + | FIND_ONE_AND_UPDATE + | FIND_ONE_AND_REPLACE + | FIND_ONE_AND_DELETE + | CREATE_INDEX + | CREATE_INDEXES + | DROP_INDEX + | DROP_INDEXES + | DROP + | RENAME_COLLECTION + | STATS + | STORAGE_SIZE + | TOTAL_INDEX_SIZE + | TOTAL_SIZE + | DATA_SIZE + | IS_CAPPED + | VALIDATE + | LATENCY_STATS | SORT | LIMIT | SKIP_ @@ -289,6 +756,18 @@ identifier | GET_COLLECTION | GET_COLLECTION_NAMES | GET_COLLECTION_INFOS + | CREATE_COLLECTION + | DROP_DATABASE + | HOST_INFO + | LIST_COMMANDS + | SERVER_BUILD_INFO + | SERVER_STATUS + | VERSION + | RUN_COMMAND + | ADMIN_COMMAND + | GET_NAME + | GET_MONGO + | GET_SIBLING_DB | OBJECT_ID | ISO_DATE | DATE @@ -302,4 +781,73 @@ identifier | NUMBER_DECIMAL | TIMESTAMP | REG_EXP + | BIN_DATA + | BINARY + | BSON_REG_EXP + | HEX_DATA + // Cursor method tokens + | BATCH_SIZE + | CLOSE + | COLLATION + | COMMENT + | EXPLAIN + | FOR_EACH + | HAS_NEXT + | HINT + | IS_CLOSED + | IS_EXHAUSTED + | IT_COUNT + | MAP + | MAX + | MAX_AWAIT_TIME_MS + | MAX_TIME_MS + | MIN + | NEXT + | NO_CURSOR_TIMEOUT + | OBJS_LEFT_IN_BATCH + | PRETTY + | READ_CONCERN + | READ_PREF + | RETURN_KEY + | SHOW_RECORD_ID + | SIZE + | TAILABLE + | TO_ARRAY + | TRY_NEXT + | ALLOW_DISK_USE + | ADD_OPTION + // Bulk operation tokens + | INITIALIZE_ORDERED_BULK_OP + | INITIALIZE_UNORDERED_BULK_OP + | EXECUTE + | GET_OPERATIONS + | TO_STRING + | INSERT + | REMOVE + // Connection method tokens + | MONGO + | CONNECT + | GET_DB + | GET_READ_CONCERN + | GET_READ_PREF + | GET_READ_PREF_MODE + | GET_READ_PREF_TAG_SET + | GET_WRITE_CONCERN + | SET_READ_PREF + | SET_READ_CONCERN + | SET_WRITE_CONCERN + | START_SESSION + | WATCH + | GET_DB_NAMES + // Replication method tokens + | RS + // Sharding method tokens + | SH + // Stream processing token + | SP + // Encryption method tokens + | GET_KEY_VAULT + | GET_CLIENT_ENCRYPTION + // Plan cache method tokens + | GET_PLAN_CACHE ; diff --git a/mongodb/examples/atlas-createSearchIndex.js b/mongodb/examples/atlas-createSearchIndex.js new file mode 100644 index 0000000..03efadd --- /dev/null +++ b/mongodb/examples/atlas-createSearchIndex.js @@ -0,0 +1,65 @@ +// db.collection.createSearchIndex() - Create an Atlas Search index + +// Basic search index +db.movies.createSearchIndex({ + name: "default", + definition: { mappings: { dynamic: true } } +}) + +// Search index with specific mappings +db.products.createSearchIndex({ + name: "product_search", + definition: { + mappings: { + dynamic: false, + fields: { + name: { type: "string", analyzer: "lucene.standard" }, + description: { type: "string" }, + category: { type: "token" } + } + } + } +}) + +// Search index with analyzers +db.articles.createSearchIndex({ + name: "article_search", + definition: { + analyzer: "lucene.standard", + searchAnalyzer: "lucene.standard", + mappings: { + dynamic: true + } + } +}) + +// Search index with synonyms +db.products.createSearchIndex({ + name: "synonym_search", + definition: { + mappings: { dynamic: true }, + synonyms: [{ + name: "product_synonyms", + source: { collection: "synonyms" }, + analyzer: "lucene.standard" + }] + } +}) + +// Vector search index +db.embeddings.createSearchIndex({ + name: "vector_index", + type: "vectorSearch", + definition: { + fields: [{ + type: "vector", + path: "embedding", + numDimensions: 1536, + similarity: "cosine" + }] + } +}) + +// Collection access patterns +db["movies"].createSearchIndex({ name: "search" }) +db.getCollection("movies").createSearchIndex({ name: "search" }) diff --git a/mongodb/examples/atlas-createSearchIndexes.js b/mongodb/examples/atlas-createSearchIndexes.js new file mode 100644 index 0000000..6f9007f --- /dev/null +++ b/mongodb/examples/atlas-createSearchIndexes.js @@ -0,0 +1,70 @@ +// db.collection.createSearchIndexes() - Create multiple Atlas Search indexes + +// Create multiple search indexes at once +db.movies.createSearchIndexes([ + { + name: "default", + definition: { mappings: { dynamic: true } } + }, + { + name: "title_search", + definition: { + mappings: { + dynamic: false, + fields: { + title: { type: "string", analyzer: "lucene.standard" } + } + } + } + } +]) + +// Create text and vector search indexes together +db.products.createSearchIndexes([ + { + name: "text_search", + definition: { + mappings: { + dynamic: false, + fields: { + name: { type: "string" }, + description: { type: "string" } + } + } + } + }, + { + name: "vector_search", + type: "vectorSearch", + definition: { + fields: [{ + type: "vector", + path: "embedding", + numDimensions: 768, + similarity: "dotProduct" + }] + } + } +]) + +// Create search indexes with different analyzers +db.articles.createSearchIndexes([ + { + name: "english_search", + definition: { + analyzer: "lucene.english", + mappings: { dynamic: true } + } + }, + { + name: "french_search", + definition: { + analyzer: "lucene.french", + mappings: { dynamic: true } + } + } +]) + +// Collection access patterns +db["movies"].createSearchIndexes([{ name: "idx1" }]) +db.getCollection("movies").createSearchIndexes([{ name: "idx1" }]) diff --git a/mongodb/examples/atlas-dropSearchIndex.js b/mongodb/examples/atlas-dropSearchIndex.js new file mode 100644 index 0000000..014868a --- /dev/null +++ b/mongodb/examples/atlas-dropSearchIndex.js @@ -0,0 +1,19 @@ +// db.collection.dropSearchIndex() - Drop an Atlas Search index + +// Drop search index by name +db.movies.dropSearchIndex("default") + +// Drop text search index +db.products.dropSearchIndex("product_search") + +// Drop vector search index +db.embeddings.dropSearchIndex("vector_index") + +// Drop search index with various names +db.articles.dropSearchIndex("english_search") +db.articles.dropSearchIndex("french_search") +db.users.dropSearchIndex("user_profile_search") + +// Collection access patterns +db["movies"].dropSearchIndex("default") +db.getCollection("movies").dropSearchIndex("default") diff --git a/mongodb/examples/atlas-updateSearchIndex.js b/mongodb/examples/atlas-updateSearchIndex.js new file mode 100644 index 0000000..8964be5 --- /dev/null +++ b/mongodb/examples/atlas-updateSearchIndex.js @@ -0,0 +1,60 @@ +// db.collection.updateSearchIndex() - Update an Atlas Search index + +// Update search index definition +db.movies.updateSearchIndex("default", { + definition: { + mappings: { dynamic: true } + } +}) + +// Update search index with specific field mappings +db.products.updateSearchIndex("product_search", { + definition: { + mappings: { + dynamic: false, + fields: { + name: { type: "string", analyzer: "lucene.standard" }, + description: { type: "string", analyzer: "lucene.english" }, + category: { type: "token" }, + price: { type: "number" } + } + } + } +}) + +// Update vector search index +db.embeddings.updateSearchIndex("vector_index", { + definition: { + fields: [{ + type: "vector", + path: "embedding", + numDimensions: 1536, + similarity: "euclidean" + }] + } +}) + +// Update search index with new analyzer +db.articles.updateSearchIndex("article_search", { + definition: { + analyzer: "lucene.english", + searchAnalyzer: "lucene.english", + mappings: { dynamic: true } + } +}) + +// Update search index with synonyms +db.products.updateSearchIndex("synonym_search", { + definition: { + mappings: { dynamic: true }, + synonyms: [{ + name: "updated_synonyms", + source: { collection: "new_synonyms" }, + analyzer: "lucene.standard" + }] + } +}) + +// Collection access patterns +db["movies"].updateSearchIndex("default", { definition: { mappings: { dynamic: true } } }) +db.getCollection("movies").updateSearchIndex("default", { definition: { mappings: { dynamic: true } } }) diff --git a/mongodb/examples/bulk-arrayFilters.js b/mongodb/examples/bulk-arrayFilters.js new file mode 100644 index 0000000..c29474b --- /dev/null +++ b/mongodb/examples/bulk-arrayFilters.js @@ -0,0 +1,16 @@ +// Bulk.find().arrayFilters() - Specify array filters for bulk update operations + +// Basic arrayFilters with updateOne +db.users.initializeUnorderedBulkOp().find({ _id: ObjectId("507f1f77bcf86cd799439011") }).arrayFilters([{ "elem.grade": { $gte: 85 } }]).updateOne({ $set: { "grades.$[elem].passed": true } }) + +// ArrayFilters with update (all matching) +db.students.initializeOrderedBulkOp().find({ semester: 1 }).arrayFilters([{ "x.grade": { $gte: 90 } }]).update({ $set: { "grades.$[x].honors": true } }) + +// Multiple array filters +db.orders.initializeUnorderedBulkOp().find({ status: "processing" }).arrayFilters([{ "item.qty": { $gt: 10 } }, { "item.price": { $lt: 50 } }]).updateOne({ $set: { "items.$[item].discount": 0.1 } }) + +// ArrayFilters with nested arrays +db.inventory.initializeOrderedBulkOp().find({ warehouse: "A" }).arrayFilters([{ "loc.qty": { $gt: 0 } }]).update({ $inc: { "locations.$[loc].qty": -1 } }) + +// ArrayFilters and execute +db.products.initializeUnorderedBulkOp().find({ category: "electronics" }).arrayFilters([{ "v.rating": { $gte: 4 } }]).updateOne({ $set: { "variants.$[v].featured": true } }).execute() diff --git a/mongodb/examples/bulk-arrayInsert.js b/mongodb/examples/bulk-arrayInsert.js new file mode 100644 index 0000000..018f3b8 --- /dev/null +++ b/mongodb/examples/bulk-arrayInsert.js @@ -0,0 +1,16 @@ +// Bulk array insert pattern - Multiple inserts using bulk operations + +// Multiple inserts in sequence +db.users.initializeUnorderedBulkOp().insert({ name: "alice" }).insert({ name: "bob" }).insert({ name: "charlie" }) + +// Insert array of documents pattern +db.products.initializeOrderedBulkOp().insert({ sku: "A001", name: "Widget" }).insert({ sku: "A002", name: "Gadget" }).insert({ sku: "A003", name: "Gizmo" }).execute() + +// Insert with varying document structures +db.logs.initializeUnorderedBulkOp().insert({ level: "info", message: "Started" }).insert({ level: "warn", message: "Slow query", duration: 500 }).insert({ level: "error", message: "Failed", stack: "..." }) + +// Bulk insert with IDs +db.users.initializeOrderedBulkOp().insert({ _id: ObjectId(), name: "dave" }).insert({ _id: ObjectId(), name: "eve" }) + +// Insert documents with helper functions +db.events.initializeUnorderedBulkOp().insert({ type: "login", timestamp: ISODate() }).insert({ type: "logout", timestamp: ISODate() }).execute() diff --git a/mongodb/examples/bulk-collation.js b/mongodb/examples/bulk-collation.js new file mode 100644 index 0000000..42c6c7e --- /dev/null +++ b/mongodb/examples/bulk-collation.js @@ -0,0 +1,16 @@ +// Bulk.find().collation() - Specify collation for bulk operations + +// Collation with update +db.users.initializeUnorderedBulkOp().find({ name: "cafe" }).collation({ locale: "fr", strength: 1 }).update({ $set: { found: true } }) + +// Collation with remove +db.users.initializeOrderedBulkOp().find({ city: "munchen" }).collation({ locale: "de" }).remove() + +// Collation with updateOne +db.products.initializeUnorderedBulkOp().find({ name: "WIDGET" }).collation({ locale: "en", strength: 2 }).updateOne({ $set: { normalized: true } }) + +// Collation with case insensitive search +db.users.initializeOrderedBulkOp().find({ lastName: "smith" }).collation({ locale: "en", strength: 1 }).update({ $set: { processed: true } }) + +// Multiple operations with collation +db.inventory.initializeUnorderedBulkOp().find({ item: "abc" }).collation({ locale: "en", strength: 2 }).updateOne({ $inc: { qty: 1 } }).execute() diff --git a/mongodb/examples/bulk-execute.js b/mongodb/examples/bulk-execute.js new file mode 100644 index 0000000..d7eb2de --- /dev/null +++ b/mongodb/examples/bulk-execute.js @@ -0,0 +1,16 @@ +// Bulk.execute() - Execute all bulk operations + +// Basic execute +db.users.initializeUnorderedBulkOp().insert({ name: "alice" }).execute() + +// Execute with write concern +db.users.initializeOrderedBulkOp().insert({ name: "bob" }).execute({ w: "majority" }) + +// Chained operations then execute +db.users.initializeUnorderedBulkOp().find({ status: "inactive" }).remove().execute() + +// Execute ordered operations +db.orders.initializeOrderedBulkOp().insert({ item: "apple" }).insert({ item: "banana" }).execute() + +// Execute with detailed write concern +db.users.initializeOrderedBulkOp().insert({ name: "charlie" }).execute({ w: 1, j: true }) diff --git a/mongodb/examples/bulk-find.js b/mongodb/examples/bulk-find.js new file mode 100644 index 0000000..edee135 --- /dev/null +++ b/mongodb/examples/bulk-find.js @@ -0,0 +1,16 @@ +// Bulk.find() - Specify a query for bulk update/remove operations + +// Basic find for bulk update +db.users.initializeUnorderedBulkOp().find({ status: "inactive" }) + +// Find with complex query +db.users.initializeOrderedBulkOp().find({ age: { $gt: 18 } }) + +// Find with multiple conditions +db.users.initializeUnorderedBulkOp().find({ status: "active", role: "user" }) + +// Find with ObjectId +db.users.initializeOrderedBulkOp().find({ _id: ObjectId("507f1f77bcf86cd799439011") }) + +// Find with nested document query +db.orders.initializeUnorderedBulkOp().find({ "address.city": "NYC" }) diff --git a/mongodb/examples/bulk-getOperations.js b/mongodb/examples/bulk-getOperations.js new file mode 100644 index 0000000..d028ea5 --- /dev/null +++ b/mongodb/examples/bulk-getOperations.js @@ -0,0 +1,16 @@ +// Bulk.getOperations() - Get the list of queued operations + +// Get operations after inserts +db.users.initializeUnorderedBulkOp().insert({ name: "alice" }).getOperations() + +// Get operations after updates +db.users.initializeOrderedBulkOp().find({ status: "inactive" }).update({ $set: { status: "archived" } }).getOperations() + +// Get operations after mixed operations +db.users.initializeUnorderedBulkOp().insert({ name: "bob" }).find({ old: true }).remove().getOperations() + +// Get operations for ordered bulk +db.products.initializeOrderedBulkOp().insert({ sku: "A001" }).insert({ sku: "A002" }).getOperations() + +// Get operations before execute +db.orders.initializeUnorderedBulkOp().find({ status: "pending" }).updateOne({ $set: { status: "processing" } }).getOperations() diff --git a/mongodb/examples/bulk-hint.js b/mongodb/examples/bulk-hint.js new file mode 100644 index 0000000..ae88005 --- /dev/null +++ b/mongodb/examples/bulk-hint.js @@ -0,0 +1,16 @@ +// Bulk.find().hint() - Specify index hint for bulk operations + +// Hint with index name +db.users.initializeUnorderedBulkOp().find({ status: "active" }).hint("status_1").update({ $set: { checked: true } }) + +// Hint with index document +db.users.initializeOrderedBulkOp().find({ email: "alice@example.com" }).hint({ email: 1 }).updateOne({ $set: { verified: true } }) + +// Hint with compound index +db.orders.initializeUnorderedBulkOp().find({ customerId: "C001", status: "pending" }).hint({ customerId: 1, status: 1 }).update({ $set: { reviewed: true } }) + +// Hint with remove +db.logs.initializeOrderedBulkOp().find({ level: "debug" }).hint("level_1_timestamp_1").remove() + +// Hint and execute +db.products.initializeUnorderedBulkOp().find({ category: "electronics" }).hint({ category: 1 }).updateOne({ $inc: { viewCount: 1 } }).execute() diff --git a/mongodb/examples/bulk-initializeOrderedBulkOp.js b/mongodb/examples/bulk-initializeOrderedBulkOp.js new file mode 100644 index 0000000..f4dc62b --- /dev/null +++ b/mongodb/examples/bulk-initializeOrderedBulkOp.js @@ -0,0 +1,16 @@ +// Bulk.initializeOrderedBulkOp() - Initialize ordered bulk operation + +// Basic initialization +db.users.initializeOrderedBulkOp() + +// Initialize and assign to variable +db.users.initializeOrderedBulkOp() + +// Initialize with bracket notation +db["users"].initializeOrderedBulkOp() + +// Initialize with getCollection +db.getCollection("users").initializeOrderedBulkOp() + +// Ordered bulk operations execute in order +db.orders.initializeOrderedBulkOp() diff --git a/mongodb/examples/bulk-initializeUnorderedBulkOp.js b/mongodb/examples/bulk-initializeUnorderedBulkOp.js new file mode 100644 index 0000000..516af06 --- /dev/null +++ b/mongodb/examples/bulk-initializeUnorderedBulkOp.js @@ -0,0 +1,16 @@ +// Bulk.initializeUnorderedBulkOp() - Initialize unordered bulk operation + +// Basic initialization +db.users.initializeUnorderedBulkOp() + +// Initialize and assign to variable +db.users.initializeUnorderedBulkOp() + +// Initialize with bracket notation +db["users"].initializeUnorderedBulkOp() + +// Initialize with getCollection +db.getCollection("users").initializeUnorderedBulkOp() + +// Unordered bulk operations may execute in any order for efficiency +db.orders.initializeUnorderedBulkOp() diff --git a/mongodb/examples/bulk-insert.js b/mongodb/examples/bulk-insert.js new file mode 100644 index 0000000..c30284a --- /dev/null +++ b/mongodb/examples/bulk-insert.js @@ -0,0 +1,19 @@ +// Bulk.insert() - Queue an insert operation + +// Basic insert +db.users.initializeUnorderedBulkOp().insert({ name: "alice", age: 25 }) + +// Multiple inserts +db.users.initializeOrderedBulkOp().insert({ name: "bob" }).insert({ name: "charlie" }) + +// Insert with nested document +db.users.initializeUnorderedBulkOp().insert({ name: "dave", address: { city: "NYC", zip: "10001" } }) + +// Insert with array +db.users.initializeOrderedBulkOp().insert({ name: "eve", tags: ["admin", "user"] }) + +// Insert with helper functions +db.users.initializeUnorderedBulkOp().insert({ name: "frank", createdAt: ISODate(), id: UUID("550e8400-e29b-41d4-a716-446655440000") }) + +// Insert and execute +db.users.initializeOrderedBulkOp().insert({ name: "grace" }).execute() diff --git a/mongodb/examples/bulk-mixed.js b/mongodb/examples/bulk-mixed.js new file mode 100644 index 0000000..537ed95 --- /dev/null +++ b/mongodb/examples/bulk-mixed.js @@ -0,0 +1,19 @@ +// Bulk mixed operations - Combining insert, update, and remove in one bulk + +// Mixed insert and update +db.users.initializeOrderedBulkOp().insert({ name: "alice", status: "new" }).find({ status: "inactive" }).update({ $set: { status: "archived" } }) + +// Mixed insert, update, and remove +db.products.initializeUnorderedBulkOp().insert({ sku: "NEW001", name: "New Product" }).find({ discontinued: true }).remove().find({ price: { $lt: 10 } }).updateOne({ $set: { onSale: true } }) + +// Complex mixed operations with execute +db.orders.initializeOrderedBulkOp().insert({ orderId: "ORD100", status: "pending" }).find({ status: "shipped" }).updateOne({ $set: { status: "delivered" } }).find({ status: "cancelled" }).remove().execute() + +// Multiple operations of each type +db.inventory.initializeUnorderedBulkOp().insert({ item: "apple", qty: 100 }).insert({ item: "banana", qty: 50 }).find({ qty: 0 }).remove().find({ qty: { $lt: 10 } }).update({ $set: { lowStock: true } }).execute() + +// Mixed with upsert +db.users.initializeOrderedBulkOp().find({ email: "new@example.com" }).upsert().updateOne({ $set: { name: "New User", email: "new@example.com" } }).insert({ email: "another@example.com", name: "Another User" }).find({ deleted: true }).remove() + +// Mixed ordered operations (execute in sequence) +db.logs.initializeOrderedBulkOp().insert({ level: "info", message: "Process started" }).find({ level: "debug" }).remove().insert({ level: "info", message: "Process completed" }).execute({ w: "majority" }) diff --git a/mongodb/examples/bulk-remove.js b/mongodb/examples/bulk-remove.js new file mode 100644 index 0000000..86c5450 --- /dev/null +++ b/mongodb/examples/bulk-remove.js @@ -0,0 +1,16 @@ +// Bulk.find().remove() - Queue a remove operation for matching documents + +// Remove all matching documents +db.users.initializeUnorderedBulkOp().find({ status: "inactive" }).remove() + +// Remove with complex query +db.users.initializeOrderedBulkOp().find({ age: { $lt: 18 } }).remove() + +// Remove and execute +db.users.initializeUnorderedBulkOp().find({ deleted: true }).remove().execute() + +// Multiple removes +db.users.initializeOrderedBulkOp().find({ role: "guest" }).remove().find({ expired: true }).remove() + +// Remove with date condition +db.logs.initializeUnorderedBulkOp().find({ createdAt: { $lt: ISODate("2023-01-01") } }).remove() diff --git a/mongodb/examples/bulk-removeOne.js b/mongodb/examples/bulk-removeOne.js new file mode 100644 index 0000000..bc9f9fa --- /dev/null +++ b/mongodb/examples/bulk-removeOne.js @@ -0,0 +1,16 @@ +// Bulk.find().removeOne() - Queue a remove operation for one matching document + +// Remove one matching document +db.users.initializeUnorderedBulkOp().find({ status: "inactive" }).removeOne() + +// Remove one with complex query +db.users.initializeOrderedBulkOp().find({ age: { $lt: 18 } }).removeOne() + +// Remove one and execute +db.users.initializeUnorderedBulkOp().find({ deleted: true }).removeOne().execute() + +// Multiple remove ones +db.users.initializeOrderedBulkOp().find({ role: "guest" }).removeOne().find({ expired: true }).removeOne() + +// Remove one with ObjectId +db.users.initializeUnorderedBulkOp().find({ _id: ObjectId("507f1f77bcf86cd799439011") }).removeOne() diff --git a/mongodb/examples/bulk-replaceOne.js b/mongodb/examples/bulk-replaceOne.js new file mode 100644 index 0000000..15d9f04 --- /dev/null +++ b/mongodb/examples/bulk-replaceOne.js @@ -0,0 +1,16 @@ +// Bulk.find().replaceOne() - Queue a replace operation for one matching document + +// Basic replaceOne +db.users.initializeUnorderedBulkOp().find({ _id: ObjectId("507f1f77bcf86cd799439011") }).replaceOne({ name: "Alice Updated", email: "alice@example.com", age: 26 }) + +// ReplaceOne with query +db.users.initializeOrderedBulkOp().find({ email: "bob@example.com" }).replaceOne({ name: "Bob New", email: "bob@example.com", role: "admin" }) + +// ReplaceOne and execute +db.products.initializeUnorderedBulkOp().find({ sku: "ABC123" }).replaceOne({ sku: "ABC123", name: "Widget", price: 19.99 }).execute() + +// Multiple replaceOnes +db.users.initializeOrderedBulkOp().find({ name: "alice" }).replaceOne({ name: "Alice", status: "active" }).find({ name: "bob" }).replaceOne({ name: "Bob", status: "inactive" }) + +// ReplaceOne with nested document +db.orders.initializeUnorderedBulkOp().find({ orderId: "ORD001" }).replaceOne({ orderId: "ORD001", items: [{ name: "apple", qty: 5 }], total: 25.00 }) diff --git a/mongodb/examples/bulk-toString.js b/mongodb/examples/bulk-toString.js new file mode 100644 index 0000000..3ef9870 --- /dev/null +++ b/mongodb/examples/bulk-toString.js @@ -0,0 +1,16 @@ +// Bulk.toString() - Get string representation of bulk operation + +// Basic toString +db.users.initializeUnorderedBulkOp().toString() + +// ToString after inserts +db.users.initializeOrderedBulkOp().insert({ name: "alice" }).toString() + +// ToString after updates +db.users.initializeUnorderedBulkOp().find({ status: "inactive" }).update({ $set: { status: "archived" } }).toString() + +// ToString for ordered bulk +db.products.initializeOrderedBulkOp().insert({ sku: "A001" }).insert({ sku: "A002" }).toString() + +// ToString after mixed operations +db.orders.initializeUnorderedBulkOp().insert({ item: "apple" }).find({ qty: 0 }).remove().toString() diff --git a/mongodb/examples/bulk-tojson.js b/mongodb/examples/bulk-tojson.js new file mode 100644 index 0000000..b23d3b9 --- /dev/null +++ b/mongodb/examples/bulk-tojson.js @@ -0,0 +1,16 @@ +// Bulk.tojson() - Get JSON representation of bulk operation + +// Basic tojson +db.users.initializeUnorderedBulkOp().tojson() + +// Tojson after inserts +db.users.initializeOrderedBulkOp().insert({ name: "alice" }).tojson() + +// Tojson after updates +db.users.initializeUnorderedBulkOp().find({ status: "inactive" }).update({ $set: { status: "archived" } }).tojson() + +// Tojson for ordered bulk +db.products.initializeOrderedBulkOp().insert({ sku: "A001" }).insert({ sku: "A002" }).tojson() + +// Tojson after mixed operations +db.orders.initializeUnorderedBulkOp().insert({ item: "apple" }).find({ qty: 0 }).remove().tojson() diff --git a/mongodb/examples/bulk-update.js b/mongodb/examples/bulk-update.js new file mode 100644 index 0000000..6d47bfd --- /dev/null +++ b/mongodb/examples/bulk-update.js @@ -0,0 +1,16 @@ +// Bulk.find().update() - Queue an update operation for matching documents + +// Update all matching documents +db.users.initializeUnorderedBulkOp().find({ status: "inactive" }).update({ $set: { status: "archived" } }) + +// Update with multiple operators +db.users.initializeOrderedBulkOp().find({ role: "user" }).update({ $set: { verified: true }, $inc: { loginCount: 1 } }) + +// Update and execute +db.users.initializeUnorderedBulkOp().find({ needsUpdate: true }).update({ $set: { updated: true } }).execute() + +// Multiple updates +db.users.initializeOrderedBulkOp().find({ tier: "free" }).update({ $set: { tier: "basic" } }).find({ tier: "basic" }).update({ $set: { tier: "premium" } }) + +// Update with array operators +db.users.initializeUnorderedBulkOp().find({ _id: ObjectId("507f1f77bcf86cd799439011") }).update({ $push: { tags: "active" } }) diff --git a/mongodb/examples/bulk-updateOne.js b/mongodb/examples/bulk-updateOne.js new file mode 100644 index 0000000..153bbf9 --- /dev/null +++ b/mongodb/examples/bulk-updateOne.js @@ -0,0 +1,16 @@ +// Bulk.find().updateOne() - Queue an update operation for one matching document + +// Update one matching document +db.users.initializeUnorderedBulkOp().find({ status: "inactive" }).updateOne({ $set: { status: "active" } }) + +// Update one with complex query +db.users.initializeOrderedBulkOp().find({ email: "alice@example.com" }).updateOne({ $set: { verified: true } }) + +// Update one and execute +db.users.initializeUnorderedBulkOp().find({ _id: ObjectId("507f1f77bcf86cd799439011") }).updateOne({ $inc: { count: 1 } }).execute() + +// Multiple update ones +db.users.initializeOrderedBulkOp().find({ name: "alice" }).updateOne({ $set: { active: true } }).find({ name: "bob" }).updateOne({ $set: { active: false } }) + +// Update one with unset +db.users.initializeUnorderedBulkOp().find({ tempField: { $exists: true } }).updateOne({ $unset: { tempField: "" } }) diff --git a/mongodb/examples/bulk-updateOneWithArrayFilters.js b/mongodb/examples/bulk-updateOneWithArrayFilters.js new file mode 100644 index 0000000..0934743 --- /dev/null +++ b/mongodb/examples/bulk-updateOneWithArrayFilters.js @@ -0,0 +1,16 @@ +// Bulk.find().arrayFilters().updateOne() - UpdateOne with array filters + +// Basic updateOne with arrayFilters +db.users.initializeUnorderedBulkOp().find({ _id: ObjectId("507f1f77bcf86cd799439011") }).arrayFilters([{ "elem.status": "pending" }]).updateOne({ $set: { "tasks.$[elem].status": "completed" } }) + +// UpdateOne with multiple array filters +db.orders.initializeOrderedBulkOp().find({ customerId: "C001" }).arrayFilters([{ "item.qty": { $gt: 5 } }, { "item.price": { $gte: 100 } }]).updateOne({ $set: { "items.$[item].priority": "high" } }) + +// UpdateOne with nested array filter +db.inventory.initializeUnorderedBulkOp().find({ warehouse: "main" }).arrayFilters([{ "bin.count": { $lt: 10 } }]).updateOne({ $set: { "bins.$[bin].needsRestock": true } }) + +// Chained operations with arrayFilters +db.students.initializeOrderedBulkOp().find({ class: "Math101" }).arrayFilters([{ "g.score": { $gte: 90 } }]).updateOne({ $set: { "grades.$[g].letter": "A" } }).find({ class: "Math101" }).arrayFilters([{ "g.score": { $lt: 60 } }]).updateOne({ $set: { "grades.$[g].letter": "F" } }) + +// UpdateOne with arrayFilters and execute +db.products.initializeUnorderedBulkOp().find({ category: "clothing" }).arrayFilters([{ "size.stock": 0 }]).updateOne({ $set: { "sizes.$[size].outOfStock": true } }).execute() diff --git a/mongodb/examples/bulk-updateOneWithHint.js b/mongodb/examples/bulk-updateOneWithHint.js new file mode 100644 index 0000000..44ce24c --- /dev/null +++ b/mongodb/examples/bulk-updateOneWithHint.js @@ -0,0 +1,16 @@ +// Bulk.find().hint().updateOne() - UpdateOne with index hint + +// UpdateOne with string hint +db.users.initializeUnorderedBulkOp().find({ email: "alice@example.com" }).hint("email_1").updateOne({ $set: { lastLogin: ISODate() } }) + +// UpdateOne with document hint +db.orders.initializeOrderedBulkOp().find({ orderId: "ORD001" }).hint({ orderId: 1 }).updateOne({ $set: { status: "shipped" } }) + +// Chained find with hint and updateOne +db.products.initializeUnorderedBulkOp().find({ sku: "ABC123" }).hint({ sku: 1, warehouse: 1 }).updateOne({ $inc: { stock: -1 } }) + +// Multiple updateOnes with hints +db.inventory.initializeOrderedBulkOp().find({ item: "apple" }).hint("item_1").updateOne({ $set: { fresh: true } }).find({ item: "banana" }).hint("item_1").updateOne({ $set: { fresh: true } }) + +// UpdateOne with hint and execute +db.logs.initializeUnorderedBulkOp().find({ level: "error", timestamp: { $lt: ISODate() } }).hint("level_1_timestamp_-1").updateOne({ $set: { archived: true } }).execute() diff --git a/mongodb/examples/bulk-upsert.js b/mongodb/examples/bulk-upsert.js new file mode 100644 index 0000000..99512f5 --- /dev/null +++ b/mongodb/examples/bulk-upsert.js @@ -0,0 +1,16 @@ +// Bulk.find().upsert() - Set upsert flag for update operations + +// Upsert with updateOne +db.users.initializeUnorderedBulkOp().find({ email: "alice@example.com" }).upsert().updateOne({ $set: { name: "Alice", email: "alice@example.com" } }) + +// Upsert with update +db.users.initializeOrderedBulkOp().find({ sku: "ABC123" }).upsert().update({ $set: { sku: "ABC123", qty: 100 } }) + +// Upsert with replaceOne +db.users.initializeUnorderedBulkOp().find({ email: "bob@example.com" }).upsert().replaceOne({ name: "Bob", email: "bob@example.com", role: "user" }) + +// Upsert and execute +db.products.initializeOrderedBulkOp().find({ sku: "XYZ789" }).upsert().updateOne({ $set: { price: 29.99 } }).execute() + +// Multiple upserts +db.inventory.initializeUnorderedBulkOp().find({ item: "apple" }).upsert().updateOne({ $set: { qty: 50 } }).find({ item: "banana" }).upsert().updateOne({ $set: { qty: 30 } }) diff --git a/mongodb/examples/collection-analyzeShardKey.js b/mongodb/examples/collection-analyzeShardKey.js new file mode 100644 index 0000000..b04b17a --- /dev/null +++ b/mongodb/examples/collection-analyzeShardKey.js @@ -0,0 +1,43 @@ +// db.collection.analyzeShardKey() - Analyze a shard key for a collection + +// Analyze simple shard key +db.users.analyzeShardKey({ email: 1 }) +db.orders.analyzeShardKey({ customerId: 1 }) +db.products.analyzeShardKey({ category: 1 }) + +// Analyze compound shard key +db.orders.analyzeShardKey({ customerId: 1, createdAt: 1 }) +db.events.analyzeShardKey({ tenantId: 1, timestamp: 1 }) +db.logs.analyzeShardKey({ source: 1, level: 1, timestamp: 1 }) + +// Analyze hashed shard key +db.users.analyzeShardKey({ _id: "hashed" }) +db.sessions.analyzeShardKey({ sessionId: "hashed" }) + +// Analyze with options +db.orders.analyzeShardKey({ customerId: 1 }, { keyCharacteristics: true }) +db.products.analyzeShardKey({ sku: 1 }, { readWriteDistribution: true }) + +// Analyze with sampleRate +db.largeCollection.analyzeShardKey({ userId: 1 }, { sampleRate: 0.1 }) +db.analytics.analyzeShardKey({ eventType: 1 }, { sampleRate: 0.05 }) + +// Analyze with sampleSize +db.orders.analyzeShardKey({ region: 1 }, { sampleSize: 10000 }) + +// Analyze with all options +db.transactions.analyzeShardKey( + { accountId: 1, transactionDate: 1 }, + { + keyCharacteristics: true, + readWriteDistribution: true, + sampleRate: 0.2 + } +) + +// Collection access patterns +db["users"].analyzeShardKey({ userId: 1 }) +db["users"].analyzeShardKey({ email: 1 }, { keyCharacteristics: true }) +db.getCollection("users").analyzeShardKey({ tenantId: 1 }) +db.getCollection("orders").analyzeShardKey({ customerId: 1, orderId: 1 }) +db["event-logs"].analyzeShardKey({ source: 1, timestamp: 1 }) diff --git a/mongodb/examples/collection-bulkWrite.js b/mongodb/examples/collection-bulkWrite.js new file mode 100644 index 0000000..4eac43a --- /dev/null +++ b/mongodb/examples/collection-bulkWrite.js @@ -0,0 +1,53 @@ +// db.collection.bulkWrite() - Bulk write operations (unsupported - use individual write commands) + +// Basic bulk write with insert +db.users.bulkWrite([ + { insertOne: { document: { name: "alice", age: 25 } } } +]) + +// Bulk write with multiple operations +db.users.bulkWrite([ + { insertOne: { document: { name: "alice", age: 25 } } }, + { insertOne: { document: { name: "bob", age: 30 } } }, + { updateOne: { filter: { name: "charlie" }, update: { $set: { age: 35 } } } }, + { updateMany: { filter: { status: "pending" }, update: { $set: { status: "active" } } } }, + { deleteOne: { filter: { name: "dave" } } }, + { deleteMany: { filter: { status: "deleted" } } }, + { replaceOne: { filter: { name: "eve" }, replacement: { name: "eve", age: 28 } } } +]) + +// Bulk write with options +db.orders.bulkWrite([ + { insertOne: { document: { orderId: 1, status: "new" } } }, + { updateOne: { filter: { orderId: 2 }, update: { $set: { status: "shipped" } } } } +], { ordered: false }) + +db.products.bulkWrite([ + { deleteOne: { filter: { discontinued: true } } } +], { ordered: true }) + +// Bulk write with write concern +db.inventory.bulkWrite([ + { updateMany: { filter: { qty: { $lt: 10 } }, update: { $set: { reorder: true } } } } +], { writeConcern: { w: "majority" } }) + +// Bulk write with upsert in update operations +db.users.bulkWrite([ + { updateOne: { filter: { email: "test@example.com" }, update: { $set: { name: "Test User" } }, upsert: true } }, + { replaceOne: { filter: { code: "ABC" }, replacement: { code: "ABC", value: 100 }, upsert: true } } +]) + +// Bulk write with array filters +db.inventory.bulkWrite([ + { updateOne: { filter: { item: "abc123" }, update: { $set: { "sizes.$[size].qty": 0 } }, arrayFilters: [{ "size.type": "small" }] } } +]) + +// Bulk write with collation +db.products.bulkWrite([ + { deleteMany: { filter: { category: "electronics" } } } +], { ordered: false, collation: { locale: "en", strength: 2 } }) + +// Collection access patterns +db["users"].bulkWrite([{ insertOne: { document: { x: 1 } } }]) +db.getCollection("users").bulkWrite([{ insertOne: { document: { y: 1 } } }]) +db["user-data"].bulkWrite([{ deleteOne: { filter: { expired: true } } }], { ordered: false }) diff --git a/mongodb/examples/collection-compactStructuredEncryptionData.js b/mongodb/examples/collection-compactStructuredEncryptionData.js new file mode 100644 index 0000000..01cd2b5 --- /dev/null +++ b/mongodb/examples/collection-compactStructuredEncryptionData.js @@ -0,0 +1,21 @@ +// db.collection.compactStructuredEncryptionData() - Compact encrypted data structures + +// Basic compaction +db.users.compactStructuredEncryptionData() +db.orders.compactStructuredEncryptionData() +db.medicalRecords.compactStructuredEncryptionData() + +// Compact with options +db.financialData.compactStructuredEncryptionData({}) +db.sensitiveData.compactStructuredEncryptionData({}) + +// Compact encrypted collections +db.encryptedPII.compactStructuredEncryptionData() +db.patientRecords.compactStructuredEncryptionData() +db.creditCards.compactStructuredEncryptionData() + +// Collection access patterns +db["users"].compactStructuredEncryptionData() +db.getCollection("users").compactStructuredEncryptionData() +db["encrypted-data"].compactStructuredEncryptionData() +db.getCollection("sensitive.records").compactStructuredEncryptionData() diff --git a/mongodb/examples/collection-configureQueryAnalyzer.js b/mongodb/examples/collection-configureQueryAnalyzer.js new file mode 100644 index 0000000..4e33105 --- /dev/null +++ b/mongodb/examples/collection-configureQueryAnalyzer.js @@ -0,0 +1,32 @@ +// db.collection.configureQueryAnalyzer() - Configure query analyzer for a collection + +// Enable query analyzer with mode +db.users.configureQueryAnalyzer({ mode: "full" }) +db.orders.configureQueryAnalyzer({ mode: "off" }) + +// Configure with sample rate +db.products.configureQueryAnalyzer({ mode: "full", sampleRate: 100 }) +db.events.configureQueryAnalyzer({ mode: "full", sampleRate: 50 }) +db.logs.configureQueryAnalyzer({ mode: "full", sampleRate: 10 }) + +// Disable query analyzer +db.users.configureQueryAnalyzer({ mode: "off" }) +db.analytics.configureQueryAnalyzer({ mode: "off" }) + +// Configure for specific analysis +db.orders.configureQueryAnalyzer({ + mode: "full", + sampleRate: 200 +}) + +db.transactions.configureQueryAnalyzer({ + mode: "full", + sampleRate: 1000 +}) + +// Collection access patterns +db["users"].configureQueryAnalyzer({ mode: "full" }) +db["users"].configureQueryAnalyzer({ mode: "full", sampleRate: 100 }) +db.getCollection("users").configureQueryAnalyzer({ mode: "off" }) +db.getCollection("orders").configureQueryAnalyzer({ mode: "full", sampleRate: 50 }) +db["query-logs"].configureQueryAnalyzer({ mode: "full", sampleRate: 25 }) diff --git a/mongodb/examples/collection-count.js b/mongodb/examples/collection-count.js new file mode 100644 index 0000000..9a47b4a --- /dev/null +++ b/mongodb/examples/collection-count.js @@ -0,0 +1,36 @@ +// db.collection.count() - Count documents (deprecated - use countDocuments or estimatedDocumentCount) + +// Basic count +db.users.count() +db.orders.count() + +// Count with filter +db.users.count({ status: "active" }) +db.users.count({ age: { $gte: 18 } }) +db.orders.count({ status: "pending", customerId: ObjectId("507f1f77bcf86cd799439011") }) + +// Count with complex filter +db.users.count({ $or: [{ status: "active" }, { role: "admin" }] }) +db.products.count({ price: { $gte: 10, $lte: 100 }, inStock: true }) + +// Count with options +db.users.count({ status: "active" }, { limit: 1000 }) +db.orders.count({ createdAt: { $gte: ISODate("2024-01-01") } }, { skip: 10 }) +db.products.count({}, { limit: 100, skip: 50 }) + +// Count with hint +db.users.count({ email: { $exists: true } }, { hint: { email: 1 } }) +db.orders.count({ customerId: 123 }, { hint: "customerId_1" }) + +// Count with maxTimeMS +db.largeCollection.count({ type: "log" }, { maxTimeMS: 5000 }) + +// Count with readConcern +db.users.count({ active: true }, { readConcern: { level: "majority" } }) + +// Collection access patterns +db["users"].count() +db["users"].count({ status: "active" }) +db.getCollection("users").count() +db.getCollection("users").count({ role: "admin" }) +db["user-events"].count({ type: "login" }) diff --git a/mongodb/examples/collection-createIndex.js b/mongodb/examples/collection-createIndex.js new file mode 100644 index 0000000..c0c3315 --- /dev/null +++ b/mongodb/examples/collection-createIndex.js @@ -0,0 +1,40 @@ +// db.collection.createIndex() - Create an index on a collection + +// Basic single field index +db.users.createIndex({ email: 1 }) +db.users.createIndex({ age: -1 }) + +// Compound index +db.users.createIndex({ lastName: 1, firstName: 1 }) +db.orders.createIndex({ customerId: 1, createdAt: -1 }) + +// Text index +db.articles.createIndex({ content: "text" }) +db.posts.createIndex({ title: "text", body: "text" }) + +// Unique index +db.users.createIndex({ email: 1 }, { unique: true }) + +// Sparse index +db.users.createIndex({ phone: 1 }, { sparse: true }) + +// TTL index +db.sessions.createIndex({ createdAt: 1 }, { expireAfterSeconds: 3600 }) + +// Partial index +db.orders.createIndex({ status: 1 }, { partialFilterExpression: { status: "pending" } }) + +// Index with options +db.users.createIndex({ username: 1 }, { unique: true, background: true }) +db.products.createIndex({ name: 1, category: 1 }, { name: "name_category_idx" }) + +// Hashed index +db.users.createIndex({ hashedField: "hashed" }) + +// Geospatial index +db.places.createIndex({ location: "2dsphere" }) +db.stores.createIndex({ coordinates: "2d" }) + +// Collection access patterns +db["users"].createIndex({ email: 1 }) +db.getCollection("users").createIndex({ email: 1 }) diff --git a/mongodb/examples/collection-createIndexes.js b/mongodb/examples/collection-createIndexes.js new file mode 100644 index 0000000..a1fb17f --- /dev/null +++ b/mongodb/examples/collection-createIndexes.js @@ -0,0 +1,31 @@ +// db.collection.createIndexes() - Create multiple indexes on a collection + +// Create multiple indexes at once +db.users.createIndexes([ + { key: { email: 1 }, unique: true }, + { key: { username: 1 } }, + { key: { createdAt: -1 } } +]) + +// Create indexes with options +db.orders.createIndexes([ + { key: { customerId: 1 } }, + { key: { status: 1 }, sparse: true }, + { key: { orderDate: -1 }, name: "order_date_idx" } +]) + +// Create compound indexes +db.products.createIndexes([ + { key: { category: 1, name: 1 } }, + { key: { price: 1, rating: -1 } } +]) + +// With write concern options +db.users.createIndexes( + [{ key: { email: 1 } }], + { commitQuorum: "majority" } +) + +// Collection access patterns +db["users"].createIndexes([{ key: { email: 1 } }]) +db.getCollection("users").createIndexes([{ key: { email: 1 } }]) diff --git a/mongodb/examples/collection-dataSize.js b/mongodb/examples/collection-dataSize.js new file mode 100644 index 0000000..f3e5981 --- /dev/null +++ b/mongodb/examples/collection-dataSize.js @@ -0,0 +1,13 @@ +// db.collection.dataSize() - Get the size of the collection's data in bytes + +// Basic usage +db.users.dataSize() +db.orders.dataSize() +db.products.dataSize() +db.logs.dataSize() + +// Collection access patterns +db["users"].dataSize() +db.getCollection("users").dataSize() +db["large-collection"].dataSize() +db.getCollection("archived.orders").dataSize() diff --git a/mongodb/examples/collection-deleteMany.js b/mongodb/examples/collection-deleteMany.js new file mode 100644 index 0000000..14a24de --- /dev/null +++ b/mongodb/examples/collection-deleteMany.js @@ -0,0 +1,20 @@ +// db.collection.deleteMany() - Delete multiple documents + +// Basic delete +db.users.deleteMany({ status: "inactive" }) + +// Delete all documents +db.users.deleteMany({}) + +// Delete with comparison operators +db.users.deleteMany({ lastLogin: { $lt: ISODate("2023-01-01") } }) + +// Delete with logical operators +db.users.deleteMany({ $or: [{ deleted: true }, { banned: true }] }) + +// Delete with options +db.users.deleteMany({ temp: true }, { writeConcern: { w: "majority" } }) + +// Collection access patterns +db["logs"].deleteMany({ level: "debug" }) +db.getCollection("sessions").deleteMany({ expired: true }) diff --git a/mongodb/examples/collection-deleteOne.js b/mongodb/examples/collection-deleteOne.js new file mode 100644 index 0000000..0e97fec --- /dev/null +++ b/mongodb/examples/collection-deleteOne.js @@ -0,0 +1,17 @@ +// db.collection.deleteOne() - Delete a single document + +// Basic delete +db.users.deleteOne({ name: "alice" }) + +// Delete by _id +db.users.deleteOne({ _id: ObjectId("507f1f77bcf86cd799439011") }) + +// Delete with comparison operators +db.users.deleteOne({ createdAt: { $lt: ISODate("2020-01-01") } }) + +// Delete with options +db.users.deleteOne({ status: "deleted" }, { writeConcern: { w: 1 } }) + +// Collection access patterns +db["users"].deleteOne({ temp: true }) +db.getCollection("users").deleteOne({ expired: true }) diff --git a/mongodb/examples/collection-drop.js b/mongodb/examples/collection-drop.js new file mode 100644 index 0000000..cad3a8f --- /dev/null +++ b/mongodb/examples/collection-drop.js @@ -0,0 +1,15 @@ +// db.collection.drop() - Drop a collection from the database + +// Basic drop +db.users.drop() +db.orders.drop() +db.tempData.drop() + +// Drop with write concern +db.logs.drop({ writeConcern: { w: "majority" } }) + +// Collection access patterns +db["users"].drop() +db.getCollection("users").drop() +db["temp-data"].drop() +db.getCollection("archived.orders").drop() diff --git a/mongodb/examples/collection-dropIndex.js b/mongodb/examples/collection-dropIndex.js new file mode 100644 index 0000000..edaa392 --- /dev/null +++ b/mongodb/examples/collection-dropIndex.js @@ -0,0 +1,19 @@ +// db.collection.dropIndex() - Drop an index from a collection + +// Drop by index name +db.users.dropIndex("email_1") +db.orders.dropIndex("customerId_1_createdAt_-1") + +// Drop by index key pattern +db.users.dropIndex({ email: 1 }) +db.orders.dropIndex({ customerId: 1, createdAt: -1 }) + +// Drop text index +db.articles.dropIndex("content_text") + +// Drop geospatial index +db.places.dropIndex({ location: "2dsphere" }) + +// Collection access patterns +db["users"].dropIndex("email_1") +db.getCollection("users").dropIndex({ email: 1 }) diff --git a/mongodb/examples/collection-dropIndexes.js b/mongodb/examples/collection-dropIndexes.js new file mode 100644 index 0000000..aca937f --- /dev/null +++ b/mongodb/examples/collection-dropIndexes.js @@ -0,0 +1,20 @@ +// db.collection.dropIndexes() - Drop all indexes or specified indexes from a collection + +// Drop all indexes (except _id) +db.users.dropIndexes() +db.orders.dropIndexes() + +// Drop specific index by name +db.users.dropIndexes("email_1") + +// Drop multiple indexes by name +db.users.dropIndexes(["email_1", "username_1"]) + +// Drop index by key pattern +db.orders.dropIndexes({ customerId: 1 }) + +// Collection access patterns +db["users"].dropIndexes() +db.getCollection("users").dropIndexes() +db["orders"].dropIndexes("status_1") +db.getCollection("orders").dropIndexes(["idx1", "idx2"]) diff --git a/mongodb/examples/collection-explain.js b/mongodb/examples/collection-explain.js new file mode 100644 index 0000000..cbae310 --- /dev/null +++ b/mongodb/examples/collection-explain.js @@ -0,0 +1,49 @@ +// db.collection.explain() - Return explain plan for query operations (unsupported) + +// Basic explain +db.users.explain() +db.orders.explain() + +// Explain with verbosity modes +db.users.explain("queryPlanner") +db.users.explain("executionStats") +db.users.explain("allPlansExecution") + +// Explain find operations +db.users.explain().find({ status: "active" }) +db.users.explain("executionStats").find({ age: { $gt: 25 } }) +db.orders.explain("allPlansExecution").find({ customerId: 123, status: "pending" }) + +// Explain find with sort and limit +db.users.explain().find({ status: "active" }).sort({ createdAt: -1 }) +db.users.explain("executionStats").find({}).sort({ age: 1 }).limit(10) + +// Explain aggregate operations +db.users.explain().aggregate([{ $match: { status: "active" } }, { $group: { _id: "$role", count: { $sum: 1 } } }]) +db.orders.explain("executionStats").aggregate([{ $match: { status: "shipped" } }, { $sort: { createdAt: -1 } }]) + +// Explain count operations +db.users.explain().count({ status: "active" }) +db.orders.explain("executionStats").count({ createdAt: { $gte: ISODate("2024-01-01") } }) + +// Explain distinct operations +db.users.explain().distinct("status") +db.products.explain("executionStats").distinct("category", { inStock: true }) + +// Explain update operations +db.users.explain().update({ name: "alice" }, { $set: { age: 26 } }) +db.orders.explain("executionStats").updateMany({ status: "pending" }, { $set: { status: "cancelled" } }) + +// Explain delete operations +db.users.explain().remove({ status: "deleted" }) +db.logs.explain("executionStats").deleteMany({ createdAt: { $lt: ISODate("2023-01-01") } }) + +// Explain findAndModify operations +db.users.explain().findAndModify({ query: { name: "alice" }, update: { $inc: { loginCount: 1 } } }) + +// Collection access patterns +db["users"].explain() +db["users"].explain("executionStats") +db.getCollection("users").explain() +db.getCollection("orders").explain("allPlansExecution").find({ status: "active" }) +db["user-logs"].explain().find({ level: "error" }) diff --git a/mongodb/examples/collection-findAndModify.js b/mongodb/examples/collection-findAndModify.js new file mode 100644 index 0000000..5b02deb --- /dev/null +++ b/mongodb/examples/collection-findAndModify.js @@ -0,0 +1,96 @@ +// db.collection.findAndModify() - Atomically find and modify a document (unsupported - use findOneAndUpdate/Delete/Replace) + +// Basic findAndModify with update +db.users.findAndModify({ + query: { name: "alice" }, + update: { $set: { status: "active" } } +}) + +// findAndModify with sort +db.queue.findAndModify({ + query: { status: "pending" }, + sort: { priority: -1, createdAt: 1 }, + update: { $set: { status: "processing" } } +}) + +// findAndModify returning new document +db.users.findAndModify({ + query: { _id: ObjectId("507f1f77bcf86cd799439011") }, + update: { $inc: { score: 10 } }, + new: true +}) + +// findAndModify with upsert +db.users.findAndModify({ + query: { email: "test@example.com" }, + update: { $set: { name: "Test User", active: true } }, + upsert: true, + new: true +}) + +// findAndModify with projection +db.users.findAndModify({ + query: { name: "bob" }, + update: { $set: { lastLogin: Date() } }, + fields: { name: 1, email: 1, lastLogin: 1 } +}) + +// findAndModify for removal +db.users.findAndModify({ + query: { status: "deleted" }, + remove: true +}) + +// findAndModify with sort for removal +db.tasks.findAndModify({ + query: { completed: true }, + sort: { completedAt: 1 }, + remove: true +}) + +// findAndModify with bypassDocumentValidation +db.users.findAndModify({ + query: { _id: 1 }, + update: { $set: { invalidField: "value" } }, + bypassDocumentValidation: true +}) + +// findAndModify with writeConcern +db.orders.findAndModify({ + query: { orderId: 12345 }, + update: { $set: { status: "confirmed" } }, + writeConcern: { w: "majority", wtimeout: 5000 } +}) + +// findAndModify with collation +db.products.findAndModify({ + query: { name: "cafe" }, + update: { $set: { available: true } }, + collation: { locale: "fr", strength: 1 } +}) + +// findAndModify with arrayFilters +db.inventory.findAndModify({ + query: { item: "abc123" }, + update: { $set: { "sizes.$[elem].qty": 0 } }, + arrayFilters: [{ "elem.size": "small" }] +}) + +// findAndModify with maxTimeMS +db.largeCollection.findAndModify({ + query: { type: "temp" }, + update: { $set: { processed: true } }, + maxTimeMS: 5000 +}) + +// findAndModify with let variables +db.users.findAndModify({ + query: { $expr: { $eq: ["$_id", "$$targetId"] } }, + update: { $set: { found: true } }, + let: { targetId: ObjectId("507f1f77bcf86cd799439011") } +}) + +// Collection access patterns +db["users"].findAndModify({ query: { x: 1 }, update: { $set: { y: 2 } } }) +db.getCollection("users").findAndModify({ query: { a: 1 }, remove: true }) +db["task-queue"].findAndModify({ query: { status: "new" }, sort: { createdAt: 1 }, update: { $set: { status: "taken" } } }) diff --git a/mongodb/examples/collection-findOneAndDelete.js b/mongodb/examples/collection-findOneAndDelete.js new file mode 100644 index 0000000..5209aa8 --- /dev/null +++ b/mongodb/examples/collection-findOneAndDelete.js @@ -0,0 +1,20 @@ +// db.collection.findOneAndDelete() - Find and delete a document atomically + +// Basic find and delete +db.users.findOneAndDelete({ name: "alice" }) + +// With projection +db.users.findOneAndDelete({ status: "deleted" }, { projection: { name: 1, email: 1 } }) + +// With sort (delete oldest) +db.users.findOneAndDelete({ status: "expired" }, { sort: { createdAt: 1 } }) + +// Delete by _id +db.users.findOneAndDelete({ _id: ObjectId("507f1f77bcf86cd799439011") }) + +// With maxTimeMS +db.users.findOneAndDelete({ temp: true }, { maxTimeMS: 5000 }) + +// Collection access patterns +db["users"].findOneAndDelete({ processed: true }) +db.getCollection("queue").findOneAndDelete({ status: "pending" }, { sort: { priority: -1 } }) diff --git a/mongodb/examples/collection-findOneAndReplace.js b/mongodb/examples/collection-findOneAndReplace.js new file mode 100644 index 0000000..1fec90c --- /dev/null +++ b/mongodb/examples/collection-findOneAndReplace.js @@ -0,0 +1,20 @@ +// db.collection.findOneAndReplace() - Find and replace a document atomically + +// Basic find and replace +db.users.findOneAndReplace({ name: "alice" }, { name: "alice", version: 2 }) + +// Return new document +db.users.findOneAndReplace({ name: "bob" }, { name: "bob", replaced: true }, { returnDocument: "after" }) + +// With upsert +db.users.findOneAndReplace({ email: "new@example.com" }, { email: "new@example.com", name: "new" }, { upsert: true }) + +// With projection +db.users.findOneAndReplace({ name: "charlie" }, { name: "charlie", active: true }, { projection: { name: 1 } }) + +// With sort +db.users.findOneAndReplace({ status: "old" }, { status: "new", migrated: true }, { sort: { createdAt: 1 } }) + +// Collection access patterns +db["users"].findOneAndReplace({ id: 1 }, { id: 1, data: "new" }) +db.getCollection("users").findOneAndReplace({ key: "abc" }, { key: "abc", value: "xyz" }) diff --git a/mongodb/examples/collection-findOneAndUpdate.js b/mongodb/examples/collection-findOneAndUpdate.js new file mode 100644 index 0000000..5aa83f2 --- /dev/null +++ b/mongodb/examples/collection-findOneAndUpdate.js @@ -0,0 +1,20 @@ +// db.collection.findOneAndUpdate() - Find and update a document atomically + +// Basic find and update +db.users.findOneAndUpdate({ name: "alice" }, { $set: { age: 26 } }) + +// Return new document +db.users.findOneAndUpdate({ name: "bob" }, { $inc: { score: 10 } }, { returnDocument: "after" }) + +// With upsert +db.users.findOneAndUpdate({ email: "new@example.com" }, { $set: { name: "new" } }, { upsert: true, returnDocument: "after" }) + +// With projection +db.users.findOneAndUpdate({ name: "charlie" }, { $set: { active: true } }, { projection: { name: 1, active: 1 } }) + +// With sort +db.users.findOneAndUpdate({ status: "pending" }, { $set: { status: "processing" } }, { sort: { createdAt: 1 } }) + +// Collection access patterns +db["users"].findOneAndUpdate({ id: 1 }, { $set: { processed: true } }) +db.getCollection("users").findOneAndUpdate({ key: "abc" }, { $set: { value: "xyz" } }) diff --git a/mongodb/examples/collection-getShardDistribution.js b/mongodb/examples/collection-getShardDistribution.js new file mode 100644 index 0000000..7a08e41 --- /dev/null +++ b/mongodb/examples/collection-getShardDistribution.js @@ -0,0 +1,22 @@ +// db.collection.getShardDistribution() - Print shard distribution statistics + +// Basic shard distribution +db.users.getShardDistribution() +db.orders.getShardDistribution() +db.products.getShardDistribution() + +// Get distribution for large collections +db.events.getShardDistribution() +db.logs.getShardDistribution() +db.analytics.getShardDistribution() + +// Get distribution for sharded collections +db.transactions.getShardDistribution() +db.sessions.getShardDistribution() +db.inventory.getShardDistribution() + +// Collection access patterns +db["users"].getShardDistribution() +db.getCollection("users").getShardDistribution() +db["user-data"].getShardDistribution() +db.getCollection("order.items").getShardDistribution() diff --git a/mongodb/examples/collection-getShardVersion.js b/mongodb/examples/collection-getShardVersion.js new file mode 100644 index 0000000..20c8cd4 --- /dev/null +++ b/mongodb/examples/collection-getShardVersion.js @@ -0,0 +1,22 @@ +// db.collection.getShardVersion() - Get the shard version for a collection + +// Basic shard version +db.users.getShardVersion() +db.orders.getShardVersion() +db.products.getShardVersion() + +// Get version for various collections +db.events.getShardVersion() +db.logs.getShardVersion() +db.analytics.getShardVersion() + +// Get version for sharded collections +db.transactions.getShardVersion() +db.sessions.getShardVersion() +db.inventory.getShardVersion() + +// Collection access patterns +db["users"].getShardVersion() +db.getCollection("users").getShardVersion() +db["user-data"].getShardVersion() +db.getCollection("order.items").getShardVersion() diff --git a/mongodb/examples/collection-hideIndex.js b/mongodb/examples/collection-hideIndex.js new file mode 100644 index 0000000..99a48eb --- /dev/null +++ b/mongodb/examples/collection-hideIndex.js @@ -0,0 +1,31 @@ +// db.collection.hideIndex() - Hide an index from the query planner + +// Hide index by name +db.users.hideIndex("email_1") +db.orders.hideIndex("customerId_1_createdAt_-1") +db.products.hideIndex("name_text") + +// Hide index by key specification +db.users.hideIndex({ email: 1 }) +db.orders.hideIndex({ customerId: 1, createdAt: -1 }) +db.products.hideIndex({ category: 1, price: -1 }) + +// Hide compound index +db.users.hideIndex({ lastName: 1, firstName: 1 }) +db.orders.hideIndex({ status: 1, priority: -1, createdAt: -1 }) + +// Hide text index +db.articles.hideIndex({ content: "text" }) + +// Hide geospatial index +db.places.hideIndex({ location: "2dsphere" }) + +// Hide hashed index +db.users.hideIndex({ hashedField: "hashed" }) + +// Collection access patterns +db["users"].hideIndex("email_1") +db["users"].hideIndex({ email: 1 }) +db.getCollection("users").hideIndex("status_1") +db.getCollection("users").hideIndex({ status: 1 }) +db["user-profiles"].hideIndex("userId_1") diff --git a/mongodb/examples/collection-insert.js b/mongodb/examples/collection-insert.js new file mode 100644 index 0000000..dab3d5c --- /dev/null +++ b/mongodb/examples/collection-insert.js @@ -0,0 +1,77 @@ +// db.collection.insert() - Insert documents (deprecated - use insertOne or insertMany) + +// Insert single document +db.users.insert({ name: "alice", age: 25 }) +db.users.insert({ name: "bob", email: "bob@example.com", status: "active" }) + +// Insert with _id +db.users.insert({ _id: 1, name: "charlie" }) +db.users.insert({ _id: ObjectId("507f1f77bcf86cd799439011"), name: "dave" }) + +// Insert with nested document +db.users.insert({ + name: "eve", + address: { + street: "123 Main St", + city: "New York", + zip: "10001" + } +}) + +// Insert with array +db.users.insert({ + name: "frank", + tags: ["admin", "user", "moderator"], + scores: [85, 90, 78] +}) + +// Insert multiple documents (array) +db.users.insert([ + { name: "grace", age: 30 }, + { name: "henry", age: 35 }, + { name: "ivy", age: 28 } +]) + +// Insert with write concern +db.users.insert({ name: "jack" }, { writeConcern: { w: "majority" } }) +db.orders.insert({ orderId: 1 }, { writeConcern: { w: 1, j: true } }) + +// Insert with ordered option +db.users.insert([ + { name: "kate" }, + { name: "leo" }, + { name: "mike" } +], { ordered: false }) + +// Insert complex document with dates +db.events.insert({ + type: "login", + userId: ObjectId("507f1f77bcf86cd799439011"), + timestamp: Date(), + metadata: { ip: "192.168.1.1", userAgent: "Mozilla/5.0" } +}) + +// Insert with ISODate +db.logs.insert({ + message: "Application started", + level: "info", + createdAt: ISODate("2024-01-15T10:30:00Z") +}) + +// Insert with various data types +db.mixed.insert({ + stringField: "text", + numberField: 42, + floatField: 3.14, + boolField: true, + nullField: null, + arrayField: [1, 2, 3], + objectField: { nested: "value" } +}) + +// Collection access patterns +db["users"].insert({ name: "nina" }) +db["users"].insert([{ a: 1 }, { b: 2 }]) +db.getCollection("users").insert({ name: "oscar" }) +db.getCollection("user-data").insert({ type: "profile", data: {} }) +db["event-log"].insert({ event: "click", target: "button" }) diff --git a/mongodb/examples/collection-insertMany.js b/mongodb/examples/collection-insertMany.js new file mode 100644 index 0000000..a246de8 --- /dev/null +++ b/mongodb/examples/collection-insertMany.js @@ -0,0 +1,19 @@ +// db.collection.insertMany() - Insert multiple documents + +// Basic insert +db.users.insertMany([{ name: "alice" }, { name: "bob" }]) + +// Insert with various documents +db.users.insertMany([ + { name: "charlie", age: 25 }, + { name: "dave", age: 30 }, + { name: "eve", age: 35 } +]) + +// Insert with options +db.users.insertMany([{ name: "frank" }], { ordered: false }) +db.users.insertMany([{ name: "grace" }], { writeConcern: { w: 1 } }) + +// Collection access patterns +db["users"].insertMany([{ name: "heidi" }]) +db.getCollection("users").insertMany([{ name: "ivan" }]) diff --git a/mongodb/examples/collection-insertOne.js b/mongodb/examples/collection-insertOne.js new file mode 100644 index 0000000..3f54bb0 --- /dev/null +++ b/mongodb/examples/collection-insertOne.js @@ -0,0 +1,21 @@ +// db.collection.insertOne() - Insert a single document + +// Basic insert +db.users.insertOne({ name: "alice", age: 25 }) +db.users.insertOne({ _id: ObjectId(), name: "bob" }) + +// Insert with nested document +db.users.insertOne({ name: "charlie", address: { city: "NYC", zip: "10001" } }) + +// Insert with array +db.users.insertOne({ name: "dave", tags: ["admin", "user"] }) + +// Insert with helper functions +db.users.insertOne({ name: "eve", createdAt: ISODate(), id: UUID("550e8400-e29b-41d4-a716-446655440000") }) + +// Insert with options +db.users.insertOne({ name: "frank" }, { writeConcern: { w: "majority" } }) + +// Collection access patterns +db["users"].insertOne({ name: "grace" }) +db.getCollection("users").insertOne({ name: "heidi" }) diff --git a/mongodb/examples/collection-isCapped.js b/mongodb/examples/collection-isCapped.js new file mode 100644 index 0000000..ed106bf --- /dev/null +++ b/mongodb/examples/collection-isCapped.js @@ -0,0 +1,17 @@ +// db.collection.isCapped() - Check if a collection is a capped collection + +// Basic usage +db.users.isCapped() +db.orders.isCapped() +db.logs.isCapped() +db.events.isCapped() + +// Commonly used for checking log collections +db.systemLogs.isCapped() +db.auditTrail.isCapped() + +// Collection access patterns +db["users"].isCapped() +db.getCollection("users").isCapped() +db["capped-logs"].isCapped() +db.getCollection("system.profile").isCapped() diff --git a/mongodb/examples/collection-latencyStats.js b/mongodb/examples/collection-latencyStats.js new file mode 100644 index 0000000..aab29ca --- /dev/null +++ b/mongodb/examples/collection-latencyStats.js @@ -0,0 +1,17 @@ +// db.collection.latencyStats() - Get latency statistics for a collection + +// Basic latency stats +db.users.latencyStats() +db.orders.latencyStats() + +// With histogram options +db.users.latencyStats({ histograms: true }) + +// Without histogram details +db.orders.latencyStats({ histograms: false }) + +// Collection access patterns +db["users"].latencyStats() +db.getCollection("users").latencyStats() +db["high-traffic"].latencyStats({ histograms: true }) +db.getCollection("production.api").latencyStats() diff --git a/mongodb/examples/collection-mapReduce.js b/mongodb/examples/collection-mapReduce.js new file mode 100644 index 0000000..6492931 --- /dev/null +++ b/mongodb/examples/collection-mapReduce.js @@ -0,0 +1,129 @@ +// db.collection.mapReduce() - Perform map-reduce aggregation (deprecated - use aggregation pipeline) +// Note: JavaScript function expressions are not supported by this parser. +// The examples below show the method structure with string placeholders. + +// Basic mapReduce with string function representations +db.orders.mapReduce( + "function() { emit(this.customerId, this.amount); }", + "function(key, values) { return Array.sum(values); }", + { out: "order_totals" } +) + +// mapReduce with query +db.orders.mapReduce( + "function() { emit(this.product, 1); }", + "function(key, values) { return Array.sum(values); }", + { + query: { status: "completed" }, + out: "product_counts" + } +) + +// mapReduce with inline output +db.products.mapReduce( + "function() { emit(this.category, this.price); }", + "function(key, values) { return Array.avg(values); }", + { out: { inline: 1 } } +) + +// mapReduce with finalize function +db.scores.mapReduce( + "function() { emit(this.playerId, { sum: this.score, count: 1 }); }", + "function(key, values) { return { sum: 0, count: 0 }; }", + { + finalize: "function(key, reduced) { return reduced.sum / reduced.count; }", + out: "player_averages" + } +) + +// mapReduce with sort and limit +db.logs.mapReduce( + "function() { emit(this.level, 1); }", + "function(key, values) { return Array.sum(values); }", + { + sort: { timestamp: -1 }, + limit: 10000, + out: { inline: 1 } + } +) + +// mapReduce with scope +db.orders.mapReduce( + "function() { emit(this.customerId, this.amount * factor); }", + "function(key, values) { return Array.sum(values); }", + { + scope: { factor: 1.1 }, + out: "adjusted_totals" + } +) + +// mapReduce with jsMode +db.events.mapReduce( + "function() { emit(this.type, 1); }", + "function(key, values) { return Array.sum(values); }", + { + jsMode: true, + out: { inline: 1 } + } +) + +// mapReduce with output options +db.sales.mapReduce( + "function() { emit(this.region, this.revenue); }", + "function(key, values) { return Array.sum(values); }", + { out: { replace: "region_revenue" } } +) + +db.sales.mapReduce( + "function() { emit(this.region, this.revenue); }", + "function(key, values) { return Array.sum(values); }", + { out: { merge: "region_revenue" } } +) + +db.sales.mapReduce( + "function() { emit(this.region, this.revenue); }", + "function(key, values) { return Array.sum(values); }", + { out: { reduce: "region_revenue" } } +) + +// mapReduce with output to different database +db.orders.mapReduce( + "function() { emit(this.product, this.qty); }", + "function(key, values) { return Array.sum(values); }", + { out: { replace: "product_totals", db: "reports" } } +) + +// mapReduce with verbose output +db.logs.mapReduce( + "function() { emit(this.source, 1); }", + "function(key, values) { return Array.sum(values); }", + { + out: { inline: 1 }, + verbose: true + } +) + +// mapReduce with bypassDocumentValidation +db.data.mapReduce( + "function() { emit(this.key, this.value); }", + "function(key, values) { return values.join(','); }", + { + out: "combined_data", + bypassDocumentValidation: true + } +) + +// mapReduce with collation +db.products.mapReduce( + "function() { emit(this.name.toLowerCase(), 1); }", + "function(key, values) { return Array.sum(values); }", + { + out: { inline: 1 }, + collation: { locale: "en", strength: 2 } + } +) + +// Collection access patterns +db["orders"].mapReduce("function() { emit(this.x, 1); }", "function(k, v) { return Array.sum(v); }", { out: { inline: 1 } }) +db.getCollection("orders").mapReduce("function() { emit(this.y, 1); }", "function(k, v) { return Array.sum(v); }", { out: "result" }) +db["order-items"].mapReduce("function() { emit(this.orderId, this.total); }", "function(k, v) { return Array.sum(v); }", { out: { inline: 1 } }) diff --git a/mongodb/examples/collection-reIndex.js b/mongodb/examples/collection-reIndex.js new file mode 100644 index 0000000..5327d89 --- /dev/null +++ b/mongodb/examples/collection-reIndex.js @@ -0,0 +1,21 @@ +// db.collection.reIndex() - Rebuild all indexes on a collection (deprecated) + +// Basic reIndex +db.users.reIndex() +db.orders.reIndex() +db.products.reIndex() + +// reIndex after heavy write operations +db.logs.reIndex() +db.events.reIndex() +db.sessions.reIndex() + +// reIndex on large collections +db.analytics.reIndex() +db.transactions.reIndex() + +// Collection access patterns +db["users"].reIndex() +db.getCollection("users").reIndex() +db["user-data"].reIndex() +db.getCollection("order.items").reIndex() diff --git a/mongodb/examples/collection-remove.js b/mongodb/examples/collection-remove.js new file mode 100644 index 0000000..6dbd63e --- /dev/null +++ b/mongodb/examples/collection-remove.js @@ -0,0 +1,53 @@ +// db.collection.remove() - Remove documents (deprecated - use deleteOne or deleteMany) + +// Remove all documents +db.users.remove({}) +db.logs.remove({}) + +// Remove with filter +db.users.remove({ status: "deleted" }) +db.users.remove({ name: "alice" }) +db.orders.remove({ status: "cancelled" }) + +// Remove with comparison operators +db.users.remove({ age: { $lt: 18 } }) +db.logs.remove({ createdAt: { $lt: ISODate("2023-01-01") } }) +db.sessions.remove({ expiresAt: { $lte: Date() } }) + +// Remove with complex filter +db.users.remove({ $or: [{ status: "deleted" }, { status: "banned" }] }) +db.orders.remove({ status: "cancelled", createdAt: { $lt: ISODate("2024-01-01") } }) + +// Remove with array operators +db.users.remove({ tags: { $in: ["spam", "bot"] } }) +db.products.remove({ categories: { $all: ["discontinued", "clearance"] } }) + +// Remove single document (justOne option) +db.users.remove({ status: "inactive" }, true) +db.users.remove({ status: "pending" }, { justOne: true }) +db.queue.remove({ processed: true }, { justOne: true }) + +// Remove with write concern +db.users.remove({ temp: true }, { writeConcern: { w: "majority" } }) +db.orders.remove({ status: "test" }, { writeConcern: { w: 1, j: true } }) + +// Remove with collation +db.products.remove({ name: "cafe" }, { collation: { locale: "fr", strength: 1 } }) + +// Remove by _id +db.users.remove({ _id: ObjectId("507f1f77bcf86cd799439011") }) +db.users.remove({ _id: 1 }) + +// Remove with nested field +db.users.remove({ "profile.deleted": true }) +db.orders.remove({ "shipping.status": "failed" }) + +// Remove with let option +db.users.remove({ $expr: { $eq: ["$_id", "$$targetId"] } }, { let: { targetId: ObjectId("507f1f77bcf86cd799439011") } }) + +// Collection access patterns +db["users"].remove({ status: "deleted" }) +db["users"].remove({}, true) +db.getCollection("users").remove({ expired: true }) +db.getCollection("temp-data").remove({}) +db["user-sessions"].remove({ expiresAt: { $lt: Date() } }) diff --git a/mongodb/examples/collection-renameCollection.js b/mongodb/examples/collection-renameCollection.js new file mode 100644 index 0000000..cdcc4b5 --- /dev/null +++ b/mongodb/examples/collection-renameCollection.js @@ -0,0 +1,18 @@ +// db.collection.renameCollection() - Rename a collection + +// Basic rename +db.users.renameCollection("users_old") +db.orders.renameCollection("archived_orders") + +// Rename with dropTarget option (drops target collection if exists) +db.users.renameCollection("users_backup", true) +db.orders.renameCollection("orders_v2", false) + +// Rename to collection in same database +db.tempData.renameCollection("permanentData") +db.staging.renameCollection("production") + +// Collection access patterns +db["users"].renameCollection("users_backup") +db.getCollection("users").renameCollection("users_archive") +db["old-data"].renameCollection("archived-data") diff --git a/mongodb/examples/collection-replaceOne.js b/mongodb/examples/collection-replaceOne.js new file mode 100644 index 0000000..eb52346 --- /dev/null +++ b/mongodb/examples/collection-replaceOne.js @@ -0,0 +1,17 @@ +// db.collection.replaceOne() - Replace a single document + +// Basic replace +db.users.replaceOne({ name: "alice" }, { name: "alice", age: 30, status: "active" }) + +// Replace with upsert +db.users.replaceOne({ email: "new@example.com" }, { email: "new@example.com", name: "New User" }, { upsert: true }) + +// Replace by _id +db.users.replaceOne({ _id: ObjectId("507f1f77bcf86cd799439011") }, { _id: ObjectId("507f1f77bcf86cd799439011"), name: "replaced", version: 2 }) + +// Replace with options +db.users.replaceOne({ name: "bob" }, { name: "bob", migrated: true }, { writeConcern: { w: 1 } }) + +// Collection access patterns +db["users"].replaceOne({ id: 1 }, { id: 1, data: "new" }) +db.getCollection("users").replaceOne({ key: "abc" }, { key: "abc", value: "xyz" }) diff --git a/mongodb/examples/collection-stats.js b/mongodb/examples/collection-stats.js new file mode 100644 index 0000000..33b9477 --- /dev/null +++ b/mongodb/examples/collection-stats.js @@ -0,0 +1,22 @@ +// db.collection.stats() - Get collection statistics + +// Basic stats +db.users.stats() +db.orders.stats() +db.products.stats() + +// Stats with scale factor (convert bytes to KB, MB, etc.) +db.users.stats({ scale: 1024 }) +db.largeCollection.stats({ scale: 1048576 }) + +// Stats with index details +db.users.stats({ indexDetails: true }) + +// Stats with multiple options +db.orders.stats({ scale: 1024, indexDetails: true }) + +// Collection access patterns +db["users"].stats() +db.getCollection("users").stats() +db["large-collection"].stats({ scale: 1024 }) +db.getCollection("archived.data").stats({ indexDetails: true }) diff --git a/mongodb/examples/collection-storageSize.js b/mongodb/examples/collection-storageSize.js new file mode 100644 index 0000000..660914e --- /dev/null +++ b/mongodb/examples/collection-storageSize.js @@ -0,0 +1,13 @@ +// db.collection.storageSize() - Get the storage size of a collection in bytes + +// Basic usage +db.users.storageSize() +db.orders.storageSize() +db.products.storageSize() +db.logs.storageSize() + +// Collection access patterns +db["users"].storageSize() +db.getCollection("users").storageSize() +db["large-collection"].storageSize() +db.getCollection("archived.orders").storageSize() diff --git a/mongodb/examples/collection-totalIndexSize.js b/mongodb/examples/collection-totalIndexSize.js new file mode 100644 index 0000000..006bb45 --- /dev/null +++ b/mongodb/examples/collection-totalIndexSize.js @@ -0,0 +1,13 @@ +// db.collection.totalIndexSize() - Get the total size of all indexes on a collection in bytes + +// Basic usage +db.users.totalIndexSize() +db.orders.totalIndexSize() +db.products.totalIndexSize() +db.sessions.totalIndexSize() + +// Collection access patterns +db["users"].totalIndexSize() +db.getCollection("users").totalIndexSize() +db["indexed-collection"].totalIndexSize() +db.getCollection("heavily.indexed").totalIndexSize() diff --git a/mongodb/examples/collection-totalSize.js b/mongodb/examples/collection-totalSize.js new file mode 100644 index 0000000..672ffad --- /dev/null +++ b/mongodb/examples/collection-totalSize.js @@ -0,0 +1,13 @@ +// db.collection.totalSize() - Get the total size of collection data plus indexes in bytes + +// Basic usage +db.users.totalSize() +db.orders.totalSize() +db.products.totalSize() +db.logs.totalSize() + +// Collection access patterns +db["users"].totalSize() +db.getCollection("users").totalSize() +db["large-collection"].totalSize() +db.getCollection("archived.data").totalSize() diff --git a/mongodb/examples/collection-unhideIndex.js b/mongodb/examples/collection-unhideIndex.js new file mode 100644 index 0000000..5bf5f80 --- /dev/null +++ b/mongodb/examples/collection-unhideIndex.js @@ -0,0 +1,31 @@ +// db.collection.unhideIndex() - Unhide a hidden index to make it visible to the query planner + +// Unhide index by name +db.users.unhideIndex("email_1") +db.orders.unhideIndex("customerId_1_createdAt_-1") +db.products.unhideIndex("name_text") + +// Unhide index by key specification +db.users.unhideIndex({ email: 1 }) +db.orders.unhideIndex({ customerId: 1, createdAt: -1 }) +db.products.unhideIndex({ category: 1, price: -1 }) + +// Unhide compound index +db.users.unhideIndex({ lastName: 1, firstName: 1 }) +db.orders.unhideIndex({ status: 1, priority: -1, createdAt: -1 }) + +// Unhide text index +db.articles.unhideIndex({ content: "text" }) + +// Unhide geospatial index +db.places.unhideIndex({ location: "2dsphere" }) + +// Unhide hashed index +db.users.unhideIndex({ hashedField: "hashed" }) + +// Collection access patterns +db["users"].unhideIndex("email_1") +db["users"].unhideIndex({ email: 1 }) +db.getCollection("users").unhideIndex("status_1") +db.getCollection("users").unhideIndex({ status: 1 }) +db["user-profiles"].unhideIndex("userId_1") diff --git a/mongodb/examples/collection-update.js b/mongodb/examples/collection-update.js new file mode 100644 index 0000000..37030ab --- /dev/null +++ b/mongodb/examples/collection-update.js @@ -0,0 +1,75 @@ +// db.collection.update() - Update documents (deprecated - use updateOne or updateMany) + +// Basic update with $set +db.users.update({ name: "alice" }, { $set: { age: 26 } }) +db.users.update({ _id: 1 }, { $set: { status: "active" } }) + +// Update with multiple operators +db.users.update({ name: "bob" }, { + $set: { status: "active" }, + $inc: { loginCount: 1 }, + $currentDate: { lastLogin: true } +}) + +// Update with $inc +db.products.update({ sku: "abc123" }, { $inc: { qty: -1 } }) +db.users.update({ _id: ObjectId("507f1f77bcf86cd799439011") }, { $inc: { score: 10, attempts: 1 } }) + +// Update with $unset +db.users.update({ name: "charlie" }, { $unset: { tempField: "" } }) + +// Update with $push +db.users.update({ name: "dave" }, { $push: { tags: "premium" } }) +db.users.update({ name: "eve" }, { $push: { scores: { $each: [85, 90, 78] } } }) + +// Update with $pull +db.users.update({ name: "frank" }, { $pull: { tags: "inactive" } }) +db.users.update({ name: "grace" }, { $pull: { items: { qty: { $lte: 0 } } } }) + +// Update with $addToSet +db.users.update({ name: "henry" }, { $addToSet: { roles: "editor" } }) +db.users.update({ name: "ivy" }, { $addToSet: { tags: { $each: ["a", "b", "c"] } } }) + +// Update multiple documents (multi option) +db.users.update({ status: "pending" }, { $set: { status: "active" } }, { multi: true }) +db.orders.update({ shipped: false }, { $set: { shipped: true, shippedAt: Date() } }, { multi: true }) + +// Update with upsert +db.users.update({ email: "new@example.com" }, { $set: { name: "New User" } }, { upsert: true }) +db.settings.update({ key: "theme" }, { $set: { value: "dark" } }, { upsert: true }) + +// Update with multi and upsert +db.counters.update({ name: "pageViews" }, { $inc: { count: 1 } }, { upsert: true, multi: false }) + +// Replace document (no update operators) +db.users.update({ _id: 1 }, { name: "replaced", status: "new" }) + +// Update with arrayFilters +db.inventory.update( + { item: "abc123" }, + { $set: { "sizes.$[elem].qty": 0 } }, + { arrayFilters: [{ "elem.size": "small" }] } +) + +// Update with write concern +db.users.update({ name: "jack" }, { $set: { verified: true } }, { writeConcern: { w: "majority" } }) + +// Update with collation +db.products.update({ name: "cafe" }, { $set: { available: true } }, { collation: { locale: "fr", strength: 1 } }) + +// Update with hint +db.users.update({ status: "active" }, { $set: { lastChecked: Date() } }, { hint: { status: 1 } }) + +// Update with let variables +db.users.update( + { $expr: { $eq: ["$_id", "$$targetId"] } }, + { $set: { found: true } }, + { let: { targetId: ObjectId("507f1f77bcf86cd799439011") } } +) + +// Collection access patterns +db["users"].update({ x: 1 }, { $set: { y: 2 } }) +db["users"].update({ a: 1 }, { $inc: { b: 1 } }, { multi: true }) +db.getCollection("users").update({ status: "old" }, { $set: { status: "new" } }) +db.getCollection("config").update({ key: "value" }, { $set: { data: {} } }, { upsert: true }) +db["user-preferences"].update({ userId: 1 }, { $set: { theme: "dark" } }) diff --git a/mongodb/examples/collection-updateMany.js b/mongodb/examples/collection-updateMany.js new file mode 100644 index 0000000..e9efa75 --- /dev/null +++ b/mongodb/examples/collection-updateMany.js @@ -0,0 +1,17 @@ +// db.collection.updateMany() - Update multiple documents + +// Basic update +db.users.updateMany({ status: "inactive" }, { $set: { status: "active" } }) + +// Update with comparison operators +db.users.updateMany({ age: { $lt: 18 } }, { $set: { category: "minor" } }) + +// Update with multiple operators +db.users.updateMany({ verified: false }, { $set: { verified: true }, $currentDate: { verifiedAt: true } }) + +// Update with options +db.users.updateMany({ country: "US" }, { $set: { region: "NA" } }, { writeConcern: { w: "majority" } }) + +// Collection access patterns +db["users"].updateMany({}, { $set: { migrated: true } }) +db.getCollection("users").updateMany({ role: "guest" }, { $set: { role: "user" } }) diff --git a/mongodb/examples/collection-updateOne.js b/mongodb/examples/collection-updateOne.js new file mode 100644 index 0000000..34f52d0 --- /dev/null +++ b/mongodb/examples/collection-updateOne.js @@ -0,0 +1,17 @@ +// db.collection.updateOne() - Update a single document + +// Basic update with $set +db.users.updateOne({ name: "alice" }, { $set: { age: 26 } }) + +// Update with multiple operators +db.users.updateOne({ _id: ObjectId("507f1f77bcf86cd799439011") }, { $set: { status: "active" }, $inc: { loginCount: 1 } }) + +// Update with upsert +db.users.updateOne({ email: "new@example.com" }, { $set: { name: "new user" } }, { upsert: true }) + +// Update with array filters +db.users.updateOne({ name: "alice" }, { $set: { "grades.$[elem].score": 100 } }, { arrayFilters: [{ "elem.grade": { $gte: 85 } }] }) + +// Collection access patterns +db["users"].updateOne({ name: "bob" }, { $set: { active: true } }) +db.getCollection("users").updateOne({ name: "charlie" }, { $unset: { tempField: "" } }) diff --git a/mongodb/examples/collection-validate.js b/mongodb/examples/collection-validate.js new file mode 100644 index 0000000..31031ec --- /dev/null +++ b/mongodb/examples/collection-validate.js @@ -0,0 +1,26 @@ +// db.collection.validate() - Validate a collection's data and indexes + +// Basic validation +db.users.validate() +db.orders.validate() + +// Full validation (more thorough but slower) +db.users.validate({ full: true }) + +// Quick validation (faster, less thorough) +db.products.validate({ full: false }) + +// Validation with repair option +db.logs.validate({ repair: true }) + +// Validation with metadata check only +db.sessions.validate({ metadata: true }) + +// Combined options +db.largeCollection.validate({ full: true, background: true }) + +// Collection access patterns +db["users"].validate() +db.getCollection("users").validate() +db["important-data"].validate({ full: true }) +db.getCollection("production.orders").validate({ repair: true }) diff --git a/mongodb/examples/collection-watch.js b/mongodb/examples/collection-watch.js new file mode 100644 index 0000000..fba5138 --- /dev/null +++ b/mongodb/examples/collection-watch.js @@ -0,0 +1,60 @@ +// db.collection.watch() - Open a change stream cursor (unsupported - requires persistent connection) + +// Basic watch +db.users.watch() +db.orders.watch() + +// Watch with empty pipeline +db.users.watch([]) + +// Watch with pipeline stages +db.users.watch([{ $match: { operationType: "insert" } }]) +db.orders.watch([{ $match: { "fullDocument.status": "shipped" } }]) + +// Watch with multiple pipeline stages +db.products.watch([ + { $match: { operationType: { $in: ["insert", "update", "replace"] } } }, + { $project: { fullDocument: 1, operationType: 1 } } +]) + +// Watch with options +db.users.watch([], { fullDocument: "updateLookup" }) +db.orders.watch([], { fullDocument: "whenAvailable" }) +db.products.watch([], { fullDocumentBeforeChange: "whenAvailable" }) + +// Watch with resumeAfter +db.users.watch([], { resumeAfter: { _data: "826..." } }) + +// Watch with startAfter +db.orders.watch([], { startAfter: { _data: "826..." } }) + +// Watch with startAtOperationTime +db.events.watch([], { startAtOperationTime: Timestamp(1609459200, 1) }) + +// Watch with batchSize +db.users.watch([], { batchSize: 100 }) + +// Watch with maxAwaitTimeMS +db.logs.watch([], { maxAwaitTimeMS: 5000 }) + +// Watch with collation +db.products.watch([{ $match: { "fullDocument.category": "Electronics" } }], { collation: { locale: "en", strength: 2 } }) + +// Watch with showExpandedEvents +db.users.watch([], { showExpandedEvents: true }) + +// Watch combined options +db.orders.watch([ + { $match: { operationType: "update" } } +], { + fullDocument: "updateLookup", + batchSize: 50, + maxAwaitTimeMS: 10000 +}) + +// Collection access patterns +db["users"].watch() +db["users"].watch([{ $match: { operationType: "delete" } }]) +db.getCollection("users").watch() +db.getCollection("events").watch([], { fullDocument: "updateLookup" }) +db["change-events"].watch([]) diff --git a/mongodb/examples/connection-Mongo.js b/mongodb/examples/connection-Mongo.js new file mode 100644 index 0000000..5777a71 --- /dev/null +++ b/mongodb/examples/connection-Mongo.js @@ -0,0 +1,26 @@ +// Mongo() - Create a new connection to a MongoDB server + +// Basic connection +Mongo() +Mongo("localhost") +Mongo("localhost:27017") +Mongo("mongodb://localhost:27017") + +// Connection with options +Mongo("mongodb://localhost:27017", { tls: true }) +Mongo("mongodb://user:pass@localhost:27017/test?authSource=admin") +Mongo("mongodb://localhost:27017", { ssl: true, retryWrites: true }) + +// Connection with replica set +Mongo("mongodb://host1:27017,host2:27017,host3:27017/test?replicaSet=myRS") +Mongo("mongodb://localhost:27017", { replicaSet: "myRS" }) + +// Using connection to get database +Mongo().getDB("test") +Mongo("localhost").getDB("mydb") +Mongo("mongodb://localhost:27017").getDB("admin") + +// Chaining multiple methods +Mongo("localhost").getDB("test").getCollection("users") +Mongo().setReadPref("secondary") +Mongo("localhost").setReadConcern("majority") diff --git a/mongodb/examples/connection-adminCommand.js b/mongodb/examples/connection-adminCommand.js new file mode 100644 index 0000000..d488958 --- /dev/null +++ b/mongodb/examples/connection-adminCommand.js @@ -0,0 +1,28 @@ +// adminCommand() - Run an administrative command on the admin database + +// Basic admin commands +Mongo().adminCommand({ listDatabases: 1 }) +Mongo("localhost").adminCommand({ serverStatus: 1 }) +Mongo("mongodb://localhost:27017").adminCommand({ ping: 1 }) + +// User management commands +Mongo().adminCommand({ createUser: "myuser", pwd: "password", roles: ["readWrite"] }) +Mongo().adminCommand({ usersInfo: 1 }) +Mongo().adminCommand({ dropUser: "olduser" }) + +// Replica set commands +Mongo().adminCommand({ replSetGetStatus: 1 }) +Mongo().adminCommand({ replSetGetConfig: 1 }) + +// Sharding commands +Mongo().adminCommand({ listShards: 1 }) +Mongo().adminCommand({ balancerStatus: 1 }) + +// Database commands +Mongo().adminCommand({ currentOp: 1 }) +Mongo("localhost").adminCommand({ killOp: 1, op: 12345 }) + +// adminCommand from db.getMongo() +db.getMongo().adminCommand({ listDatabases: 1 }) +db.getMongo().adminCommand({ serverStatus: 1 }) +db.getMongo().adminCommand({ ping: 1 }) diff --git a/mongodb/examples/connection-close.js b/mongodb/examples/connection-close.js new file mode 100644 index 0000000..f0d3eb3 --- /dev/null +++ b/mongodb/examples/connection-close.js @@ -0,0 +1,12 @@ +// close() - Close the database connection + +// Close on Mongo connection +Mongo().close() +Mongo("localhost").close() +Mongo("mongodb://localhost:27017").close() + +// Close after operations +Mongo("localhost").getDB("test").close() + +// Close from db.getMongo() +db.getMongo().close() diff --git a/mongodb/examples/connection-connect.js b/mongodb/examples/connection-connect.js new file mode 100644 index 0000000..a24ec80 --- /dev/null +++ b/mongodb/examples/connection-connect.js @@ -0,0 +1,22 @@ +// connect() - Connect to a MongoDB server and return a database object + +// Basic connect +connect() +connect("localhost") +connect("localhost:27017") +connect("mongodb://localhost:27017") + +// Connect with database name +connect("localhost/mydb") +connect("mongodb://localhost:27017/test") + +// Connect with options +connect("mongodb://localhost:27017/test", { readPreference: "secondary" }) +connect("mongodb://user:pass@localhost:27017/admin", { ssl: true }) + +// Connect with authentication +connect("mongodb://user:password@localhost:27017/mydb?authSource=admin") + +// Connect and chain methods +connect("localhost").getDB("test") +connect("mongodb://localhost:27017").setReadPref("primaryPreferred") diff --git a/mongodb/examples/connection-getDB.js b/mongodb/examples/connection-getDB.js new file mode 100644 index 0000000..053e2d3 --- /dev/null +++ b/mongodb/examples/connection-getDB.js @@ -0,0 +1,18 @@ +// getDB() - Get a database reference from a connection + +// Basic getDB +Mongo().getDB("test") +Mongo().getDB("mydb") +Mongo().getDB("admin") + +// getDB with connection string +Mongo("localhost").getDB("test") +Mongo("mongodb://localhost:27017").getDB("mydb") + +// getDB from db.getMongo() +db.getMongo().getDB("anotherdb") +db.getMongo().getDB("test") + +// Chain database operations +Mongo().getDB("test").getCollection("users") +Mongo("localhost").getDB("mydb").getCollectionNames() diff --git a/mongodb/examples/connection-getDBNames.js b/mongodb/examples/connection-getDBNames.js new file mode 100644 index 0000000..964a2b7 --- /dev/null +++ b/mongodb/examples/connection-getDBNames.js @@ -0,0 +1,13 @@ +// getDBNames() - Get a list of all database names + +// Basic getDBNames +Mongo().getDBNames() +Mongo("localhost").getDBNames() +Mongo("mongodb://localhost:27017").getDBNames() + +// getDBNames from db.getMongo() +db.getMongo().getDBNames() + +// getDBNames after connecting with credentials +Mongo("mongodb://user:pass@localhost:27017").getDBNames() +Mongo("mongodb://admin:password@localhost:27017/?authSource=admin").getDBNames() diff --git a/mongodb/examples/connection-getReadConcern.js b/mongodb/examples/connection-getReadConcern.js new file mode 100644 index 0000000..d136d28 --- /dev/null +++ b/mongodb/examples/connection-getReadConcern.js @@ -0,0 +1,12 @@ +// getReadConcern() - Get the read concern for the connection + +// Basic getReadConcern +Mongo().getReadConcern() +Mongo("localhost").getReadConcern() +Mongo("mongodb://localhost:27017").getReadConcern() + +// getReadConcern from db.getMongo() +db.getMongo().getReadConcern() + +// getReadConcern after setting it +Mongo().setReadConcern("majority").getReadConcern() diff --git a/mongodb/examples/connection-getReadPref.js b/mongodb/examples/connection-getReadPref.js new file mode 100644 index 0000000..102fe70 --- /dev/null +++ b/mongodb/examples/connection-getReadPref.js @@ -0,0 +1,13 @@ +// getReadPref() - Get the read preference for the connection + +// Basic getReadPref +Mongo().getReadPref() +Mongo("localhost").getReadPref() +Mongo("mongodb://localhost:27017").getReadPref() + +// getReadPref from db.getMongo() +db.getMongo().getReadPref() + +// getReadPref after setting it +Mongo().setReadPref("secondary").getReadPref() +Mongo("localhost").setReadPref("nearest").getReadPref() diff --git a/mongodb/examples/connection-getReadPrefMode.js b/mongodb/examples/connection-getReadPrefMode.js new file mode 100644 index 0000000..54b6f71 --- /dev/null +++ b/mongodb/examples/connection-getReadPrefMode.js @@ -0,0 +1,13 @@ +// getReadPrefMode() - Get the read preference mode for the connection + +// Basic getReadPrefMode +Mongo().getReadPrefMode() +Mongo("localhost").getReadPrefMode() +Mongo("mongodb://localhost:27017").getReadPrefMode() + +// getReadPrefMode from db.getMongo() +db.getMongo().getReadPrefMode() + +// getReadPrefMode after setting read preference +Mongo().setReadPref("secondary").getReadPrefMode() +Mongo("localhost").setReadPref("primaryPreferred").getReadPrefMode() diff --git a/mongodb/examples/connection-getReadPrefTagSet.js b/mongodb/examples/connection-getReadPrefTagSet.js new file mode 100644 index 0000000..7712cc6 --- /dev/null +++ b/mongodb/examples/connection-getReadPrefTagSet.js @@ -0,0 +1,13 @@ +// getReadPrefTagSet() - Get the read preference tag set for the connection + +// Basic getReadPrefTagSet +Mongo().getReadPrefTagSet() +Mongo("localhost").getReadPrefTagSet() +Mongo("mongodb://localhost:27017").getReadPrefTagSet() + +// getReadPrefTagSet from db.getMongo() +db.getMongo().getReadPrefTagSet() + +// getReadPrefTagSet after setting read preference with tags +Mongo().setReadPref("secondary", [{ dc: "east" }]).getReadPrefTagSet() +Mongo("localhost").setReadPref("nearest", [{ region: "us" }]).getReadPrefTagSet() diff --git a/mongodb/examples/connection-getWriteConcern.js b/mongodb/examples/connection-getWriteConcern.js new file mode 100644 index 0000000..d5b4a78 --- /dev/null +++ b/mongodb/examples/connection-getWriteConcern.js @@ -0,0 +1,13 @@ +// getWriteConcern() - Get the write concern for the connection + +// Basic getWriteConcern +Mongo().getWriteConcern() +Mongo("localhost").getWriteConcern() +Mongo("mongodb://localhost:27017").getWriteConcern() + +// getWriteConcern from db.getMongo() +db.getMongo().getWriteConcern() + +// getWriteConcern after setting it +Mongo().setWriteConcern({ w: "majority" }).getWriteConcern() +Mongo("localhost").setWriteConcern({ w: 1, j: true }).getWriteConcern() diff --git a/mongodb/examples/connection-setReadConcern.js b/mongodb/examples/connection-setReadConcern.js new file mode 100644 index 0000000..039f97f --- /dev/null +++ b/mongodb/examples/connection-setReadConcern.js @@ -0,0 +1,20 @@ +// setReadConcern() - Set the read concern for the connection + +// Basic setReadConcern +Mongo().setReadConcern("local") +Mongo().setReadConcern("majority") +Mongo().setReadConcern("linearizable") +Mongo().setReadConcern("available") +Mongo().setReadConcern("snapshot") + +// setReadConcern with connection string +Mongo("localhost").setReadConcern("majority") +Mongo("mongodb://localhost:27017").setReadConcern("local") + +// setReadConcern from db.getMongo() +db.getMongo().setReadConcern("majority") +db.getMongo().setReadConcern("linearizable") + +// Chain with other methods +Mongo().setReadConcern("majority").getDB("test") +Mongo("localhost").setReadConcern("local").setReadPref("secondary") diff --git a/mongodb/examples/connection-setReadPref.js b/mongodb/examples/connection-setReadPref.js new file mode 100644 index 0000000..e421528 --- /dev/null +++ b/mongodb/examples/connection-setReadPref.js @@ -0,0 +1,24 @@ +// setReadPref() - Set the read preference for the connection + +// Basic setReadPref with mode only +Mongo().setReadPref("primary") +Mongo().setReadPref("secondary") +Mongo().setReadPref("primaryPreferred") +Mongo().setReadPref("secondaryPreferred") +Mongo().setReadPref("nearest") + +// setReadPref with connection string +Mongo("localhost").setReadPref("secondary") +Mongo("mongodb://localhost:27017").setReadPref("nearest") + +// setReadPref with tag set +Mongo().setReadPref("secondary", [{ dc: "east" }]) +Mongo().setReadPref("nearest", [{ region: "us-east-1" }]) +Mongo("localhost").setReadPref("secondaryPreferred", [{ dc: "east" }, { dc: "west" }]) + +// setReadPref with options +Mongo().setReadPref("secondary", [{ dc: "east" }], { maxStalenessSeconds: 120 }) + +// setReadPref from db.getMongo() +db.getMongo().setReadPref("secondary") +db.getMongo().setReadPref("nearest", [{ region: "us" }]) diff --git a/mongodb/examples/connection-setWriteConcern.js b/mongodb/examples/connection-setWriteConcern.js new file mode 100644 index 0000000..fdafdf4 --- /dev/null +++ b/mongodb/examples/connection-setWriteConcern.js @@ -0,0 +1,25 @@ +// setWriteConcern() - Set the write concern for the connection + +// Basic setWriteConcern +Mongo().setWriteConcern({ w: 1 }) +Mongo().setWriteConcern({ w: "majority" }) +Mongo().setWriteConcern({ w: 2 }) + +// setWriteConcern with journal +Mongo().setWriteConcern({ w: 1, j: true }) +Mongo().setWriteConcern({ w: "majority", j: true }) + +// setWriteConcern with timeout +Mongo().setWriteConcern({ w: "majority", wtimeout: 5000 }) +Mongo().setWriteConcern({ w: 2, j: true, wtimeout: 10000 }) + +// setWriteConcern with connection string +Mongo("localhost").setWriteConcern({ w: "majority" }) +Mongo("mongodb://localhost:27017").setWriteConcern({ w: 1, j: true }) + +// setWriteConcern from db.getMongo() +db.getMongo().setWriteConcern({ w: "majority" }) +db.getMongo().setWriteConcern({ w: 1, j: true, wtimeout: 5000 }) + +// Chain with other methods +Mongo().setWriteConcern({ w: "majority" }).getDB("test") diff --git a/mongodb/examples/connection-startSession.js b/mongodb/examples/connection-startSession.js new file mode 100644 index 0000000..fed19ea --- /dev/null +++ b/mongodb/examples/connection-startSession.js @@ -0,0 +1,23 @@ +// startSession() - Start a new client session + +// Basic startSession +Mongo().startSession() +Mongo("localhost").startSession() +Mongo("mongodb://localhost:27017").startSession() + +// startSession with options +Mongo().startSession({}) +Mongo().startSession({ causalConsistency: true }) +Mongo().startSession({ causalConsistency: false }) + +// startSession with retryable writes +Mongo().startSession({ retryWrites: true }) +Mongo("localhost").startSession({ retryWrites: true, causalConsistency: true }) + +// startSession with snapshot reads +Mongo().startSession({ snapshot: true }) + +// startSession from db.getMongo() +db.getMongo().startSession() +db.getMongo().startSession({ causalConsistency: true }) +db.getMongo().startSession({ retryWrites: true }) diff --git a/mongodb/examples/connection-watch.js b/mongodb/examples/connection-watch.js new file mode 100644 index 0000000..76fa24c --- /dev/null +++ b/mongodb/examples/connection-watch.js @@ -0,0 +1,27 @@ +// watch() - Watch for changes on the entire cluster + +// Basic watch +Mongo().watch() +Mongo("localhost").watch() +Mongo("mongodb://localhost:27017").watch() + +// watch with empty pipeline +Mongo().watch([]) + +// watch with pipeline stages +Mongo().watch([{ $match: { operationType: "insert" } }]) +Mongo("localhost").watch([{ $match: { "fullDocument.status": "active" } }]) +Mongo().watch([ + { $match: { operationType: { $in: ["insert", "update", "replace"] } } }, + { $project: { documentKey: 1, fullDocument: 1 } } +]) + +// watch with options +Mongo().watch([], { fullDocument: "updateLookup" }) +Mongo("localhost").watch([], { maxAwaitTimeMS: 1000 }) +Mongo().watch([], { batchSize: 100, fullDocument: "updateLookup" }) + +// watch from db.getMongo() +db.getMongo().watch() +db.getMongo().watch([{ $match: { operationType: "insert" } }]) +db.getMongo().watch([], { fullDocument: "updateLookup" }) diff --git a/mongodb/examples/cursor-addOption.js b/mongodb/examples/cursor-addOption.js new file mode 100644 index 0000000..137160a --- /dev/null +++ b/mongodb/examples/cursor-addOption.js @@ -0,0 +1,34 @@ +// cursor.addOption() - Add query flags using numeric option values + +// Add tailable option (2) +db.cappedCollection.find().addOption(2) + +// Add slaveOk option (4) +db.users.find().addOption(4) + +// Add oplogReplay option (8) +db.oplog.find().addOption(8) + +// Add noCursorTimeout option (16) +db.users.find().addOption(16) + +// Add awaitData option (32) +db.cappedCollection.find().addOption(32) + +// Add exhaust option (64) +db.users.find().addOption(64) + +// Add partial option (128) +db.users.find().addOption(128) + +// Combine multiple options +db.cappedCollection.find().addOption(2).addOption(32) +db.users.find().addOption(4).addOption(16) + +// Chained with other cursor methods +db.users.find().addOption(16).sort({ name: 1 }) +db.users.find().addOption(4).limit(100) + +// With query filter +db.logs.find({ level: "error" }).addOption(16) +db.events.find({ type: "notification" }).addOption(2).addOption(32) diff --git a/mongodb/examples/cursor-allowDiskUse.js b/mongodb/examples/cursor-allowDiskUse.js new file mode 100644 index 0000000..38064d5 --- /dev/null +++ b/mongodb/examples/cursor-allowDiskUse.js @@ -0,0 +1,30 @@ +// cursor.allowDiskUse() - Allow query to use disk for large sorts + +// Basic usage (enable disk use) +db.users.find().allowDiskUse() +db.users.find().allowDiskUse(true) + +// Disable disk use +db.users.find().allowDiskUse(false) + +// With query filter +db.users.find({ status: "active" }).allowDiskUse() +db.orders.find({ total: { $gt: 1000 } }).allowDiskUse(true) + +// Essential for large sorts +db.users.find().sort({ name: 1 }).allowDiskUse() +db.largeCollection.find().sort({ createdAt: -1, name: 1 }).allowDiskUse(true) + +// Chained with other cursor methods +db.users.find().sort({ score: -1 }).allowDiskUse().limit(1000) +db.users.find({ status: "active" }).sort({ name: 1 }).allowDiskUse(true).skip(100).limit(50) + +// For queries exceeding memory limits +db.analytics.find({ date: { $gte: ISODate("2024-01-01") } }).sort({ date: -1 }).allowDiskUse() +db.logs.find().sort({ timestamp: -1, level: 1 }).allowDiskUse(true) + +// With projection to reduce memory +db.users.find().projection({ name: 1, email: 1 }).sort({ name: 1 }).allowDiskUse() + +// With explain +db.users.find().sort({ name: 1 }).allowDiskUse().explain("executionStats") diff --git a/mongodb/examples/cursor-batchSize.js b/mongodb/examples/cursor-batchSize.js new file mode 100644 index 0000000..b03a8ee --- /dev/null +++ b/mongodb/examples/cursor-batchSize.js @@ -0,0 +1,24 @@ +// cursor.batchSize() - Set batch size for cursor iteration + +// Basic usage +db.users.find().batchSize(100) +db.users.find().batchSize(50) +db.users.find().batchSize(1000) + +// With query filter +db.users.find({ status: "active" }).batchSize(50) +db.users.find({ age: { $gte: 18 } }).batchSize(200) + +// Chained with other cursor methods +db.users.find().sort({ name: 1 }).batchSize(25) +db.users.find().sort({ name: 1 }).batchSize(25).limit(100) +db.users.find().skip(100).limit(50).batchSize(10) + +// Small batch size for memory-constrained environments +db.largeCollection.find().batchSize(10) + +// Large batch size for faster iteration +db.users.find().batchSize(5000) + +// With projection +db.users.find().projection({ name: 1 }).batchSize(100) diff --git a/mongodb/examples/cursor-close.js b/mongodb/examples/cursor-close.js new file mode 100644 index 0000000..45c0e26 --- /dev/null +++ b/mongodb/examples/cursor-close.js @@ -0,0 +1,18 @@ +// cursor.close() - Close the cursor and free server resources + +// Basic usage - close cursor after getting some results +db.users.find().close() + +// With query filter +db.users.find({ status: "active" }).close() + +// Chained with other cursor methods +db.users.find().sort({ name: 1 }).close() +db.users.find().limit(10).close() +db.users.find().batchSize(100).close() + +// Close after iterating +db.users.find({ status: "pending" }).sort({ createdAt: -1 }).close() + +// With projection +db.users.find().projection({ name: 1 }).close() diff --git a/mongodb/examples/cursor-collation.js b/mongodb/examples/cursor-collation.js new file mode 100644 index 0000000..50fd668 --- /dev/null +++ b/mongodb/examples/cursor-collation.js @@ -0,0 +1,31 @@ +// cursor.collation() - Specify collation for string comparison + +// Basic collation with locale +db.users.find().collation({ locale: "en" }) +db.users.find().collation({ locale: "fr" }) +db.users.find().collation({ locale: "de" }) + +// Case-insensitive collation +db.users.find({ name: "alice" }).collation({ locale: "en", strength: 2 }) + +// Numeric ordering for strings +db.products.find().collation({ locale: "en", numericOrdering: true }) + +// With sort for locale-aware sorting +db.users.find().sort({ name: 1 }).collation({ locale: "en" }) +db.users.find().sort({ name: 1 }).collation({ locale: "de", caseLevel: true }) + +// Full collation options +db.users.find().collation({ + locale: "en", + strength: 2, + caseLevel: false, + caseFirst: "off", + numericOrdering: false, + alternate: "non-ignorable", + maxVariable: "punct", + backwards: false +}) + +// Chained with other cursor methods +db.users.find({ status: "active" }).collation({ locale: "en" }).sort({ name: 1 }).limit(10) diff --git a/mongodb/examples/cursor-comment.js b/mongodb/examples/cursor-comment.js new file mode 100644 index 0000000..fa64f43 --- /dev/null +++ b/mongodb/examples/cursor-comment.js @@ -0,0 +1,20 @@ +// cursor.comment() - Add a comment to the query for profiling/logging + +// Basic usage +db.users.find().comment("User listing query") +db.users.find().comment("Admin dashboard query") + +// With query filter +db.users.find({ status: "active" }).comment("Active users query") +db.orders.find({ total: { $gt: 1000 } }).comment("High value orders") + +// Chained with other cursor methods +db.users.find().sort({ createdAt: -1 }).comment("Recent users").limit(10) +db.users.find({ role: "admin" }).comment("Admin lookup").projection({ name: 1, email: 1 }) + +// Detailed comments for debugging +db.users.find({ status: "pending" }).comment("Pending approval - ticket #12345") +db.analytics.find({ date: { $gte: ISODate("2024-01-01") } }).comment("Q1 2024 analytics export") + +// Comment with special characters +db.logs.find({ level: "error" }).comment("Error logs - check /var/log") diff --git a/mongodb/examples/cursor-count.js b/mongodb/examples/cursor-count.js new file mode 100644 index 0000000..402ee40 --- /dev/null +++ b/mongodb/examples/cursor-count.js @@ -0,0 +1,22 @@ +// cursor.count() - Count the number of documents matching the query + +// Basic usage +db.users.find().count() +db.users.find({}).count() + +// With query filter +db.users.find({ status: "active" }).count() +db.users.find({ age: { $gte: 18 } }).count() +db.users.find({ "address.city": "New York" }).count() + +// After sort (sort doesn't affect count) +db.users.find().sort({ name: 1 }).count() + +// After limit/skip (count ignores limit/skip by default) +db.users.find().limit(10).count() +db.users.find().skip(5).count() +db.users.find().skip(5).limit(10).count() + +// Complex query with count +db.users.find({ $or: [{ status: "active" }, { role: "admin" }] }).count() +db.orders.find({ total: { $gt: 100 }, status: "completed" }).count() diff --git a/mongodb/examples/cursor-explain.js b/mongodb/examples/cursor-explain.js new file mode 100644 index 0000000..3c8f495 --- /dev/null +++ b/mongodb/examples/cursor-explain.js @@ -0,0 +1,28 @@ +// cursor.explain() - Return query execution information + +// Basic explain (default verbosity) +db.users.find().explain() +db.users.find({}).explain() + +// Explain with verbosity levels +db.users.find().explain("queryPlanner") +db.users.find().explain("executionStats") +db.users.find().explain("allPlansExecution") + +// With query filter +db.users.find({ status: "active" }).explain() +db.users.find({ age: { $gt: 25 } }).explain("executionStats") + +// Explain sorted queries +db.users.find().sort({ name: 1 }).explain() +db.users.find({ status: "active" }).sort({ createdAt: -1 }).explain("executionStats") + +// Explain queries with indexes +db.users.find({ email: "test@example.com" }).explain("allPlansExecution") +db.orders.find({ customerId: ObjectId("507f1f77bcf86cd799439011") }).explain() + +// Explain complex queries +db.users.find({ $or: [{ status: "active" }, { role: "admin" }] }).explain("executionStats") + +// Explain with limit/skip +db.users.find().skip(100).limit(10).explain() diff --git a/mongodb/examples/cursor-forEach.js b/mongodb/examples/cursor-forEach.js new file mode 100644 index 0000000..941fbdf --- /dev/null +++ b/mongodb/examples/cursor-forEach.js @@ -0,0 +1,20 @@ +// cursor.forEach() - Iterate over each document with a callback function + +// Basic usage with document argument +db.users.find().forEach({ handler: "print" }) + +// With query filter +db.users.find({ status: "active" }).forEach({ action: "log" }) +db.orders.find({ total: { $gt: 100 } }).forEach({ type: "process" }) + +// Chained with other cursor methods +db.users.find().sort({ name: 1 }).forEach({ output: "console" }) +db.users.find().limit(10).forEach({ format: "json" }) +db.users.find({ status: "active" }).sort({ createdAt: -1 }).limit(5).forEach({ mode: "verbose" }) + +// With projection +db.users.find().projection({ name: 1, email: 1 }).forEach({ display: true }) + +// With string argument representing callback name +db.users.find().forEach("printjson") +db.logs.find({ level: "error" }).forEach("processError") diff --git a/mongodb/examples/cursor-hasNext.js b/mongodb/examples/cursor-hasNext.js new file mode 100644 index 0000000..2a7c7d4 --- /dev/null +++ b/mongodb/examples/cursor-hasNext.js @@ -0,0 +1,21 @@ +// cursor.hasNext() - Check if there are more documents in the cursor + +// Basic usage +db.users.find().hasNext() +db.users.find({}).hasNext() + +// With query filter +db.users.find({ status: "active" }).hasNext() +db.users.find({ age: { $gt: 65 } }).hasNext() + +// Chained with other cursor methods +db.users.find().sort({ name: 1 }).hasNext() +db.users.find().limit(10).hasNext() +db.users.find().skip(1000).hasNext() + +// Check for existence of matching documents +db.users.find({ email: "admin@example.com" }).hasNext() +db.orders.find({ status: "pending", createdAt: { $lt: ISODate("2024-01-01") } }).hasNext() + +// With projection +db.users.find().projection({ _id: 1 }).hasNext() diff --git a/mongodb/examples/cursor-hint.js b/mongodb/examples/cursor-hint.js new file mode 100644 index 0000000..c5e53ef --- /dev/null +++ b/mongodb/examples/cursor-hint.js @@ -0,0 +1,24 @@ +// cursor.hint() - Force the query optimizer to use a specific index + +// Hint with index name +db.users.find({ status: "active" }).hint("status_1") +db.users.find({ email: "test@example.com" }).hint("email_1") + +// Hint with index specification document +db.users.find({ status: "active" }).hint({ status: 1 }) +db.users.find({ name: "alice", age: 25 }).hint({ name: 1, age: 1 }) + +// Force collection scan (no index) +db.users.find({ status: "active" }).hint({ $natural: 1 }) +db.users.find().hint({ $natural: -1 }) + +// Chained with other cursor methods +db.users.find({ status: "active" }).hint("status_1").sort({ createdAt: -1 }) +db.users.find({ status: "active" }).hint({ status: 1 }).limit(10) +db.orders.find({ customerId: ObjectId("507f1f77bcf86cd799439011") }).hint("customerId_1").explain() + +// Compound index hint +db.products.find({ category: "electronics", price: { $lt: 500 } }).hint({ category: 1, price: 1 }) + +// With projection +db.users.find({ status: "active" }).hint("status_1").projection({ name: 1, email: 1 }) diff --git a/mongodb/examples/cursor-isClosed.js b/mongodb/examples/cursor-isClosed.js new file mode 100644 index 0000000..06c4cf7 --- /dev/null +++ b/mongodb/examples/cursor-isClosed.js @@ -0,0 +1,20 @@ +// cursor.isClosed() - Check if the cursor is closed + +// Basic usage +db.users.find().isClosed() +db.users.find({}).isClosed() + +// With query filter +db.users.find({ status: "active" }).isClosed() +db.orders.find({ total: { $gt: 100 } }).isClosed() + +// Chained with other cursor methods +db.users.find().sort({ name: 1 }).isClosed() +db.users.find().limit(10).isClosed() +db.users.find().batchSize(100).isClosed() + +// Check status after operations +db.users.find({ status: "pending" }).skip(50).limit(25).isClosed() + +// With projection +db.users.find().projection({ name: 1 }).isClosed() diff --git a/mongodb/examples/cursor-isExhausted.js b/mongodb/examples/cursor-isExhausted.js new file mode 100644 index 0000000..e667e19 --- /dev/null +++ b/mongodb/examples/cursor-isExhausted.js @@ -0,0 +1,21 @@ +// cursor.isExhausted() - Check if the cursor has no more documents and is closed + +// Basic usage +db.users.find().isExhausted() +db.users.find({}).isExhausted() + +// With query filter +db.users.find({ status: "active" }).isExhausted() +db.users.find({ role: "superadmin" }).isExhausted() + +// Chained with other cursor methods +db.users.find().sort({ name: 1 }).isExhausted() +db.users.find().limit(10).isExhausted() +db.users.find().skip(1000000).isExhausted() + +// Check exhaustion status +db.users.find({ status: "deleted" }).batchSize(10).isExhausted() +db.logs.find({ timestamp: { $lt: ISODate("2020-01-01") } }).isExhausted() + +// With projection +db.users.find().projection({ _id: 1 }).isExhausted() diff --git a/mongodb/examples/cursor-itcount.js b/mongodb/examples/cursor-itcount.js new file mode 100644 index 0000000..37f08d7 --- /dev/null +++ b/mongodb/examples/cursor-itcount.js @@ -0,0 +1,24 @@ +// cursor.itcount() - Count documents by iterating through the cursor + +// Basic usage +db.users.find().itcount() +db.users.find({}).itcount() + +// With query filter +db.users.find({ status: "active" }).itcount() +db.users.find({ age: { $gte: 18, $lte: 65 } }).itcount() + +// Chained with other cursor methods +db.users.find().sort({ name: 1 }).itcount() +db.users.find().limit(100).itcount() +db.users.find().skip(50).itcount() + +// Unlike count(), itcount() respects limit and skip +db.users.find().skip(10).limit(5).itcount() + +// Complex queries +db.orders.find({ status: "completed", total: { $gt: 500 } }).itcount() +db.logs.find({ level: { $in: ["error", "fatal"] } }).itcount() + +// With projection +db.users.find().projection({ _id: 1 }).itcount() diff --git a/mongodb/examples/cursor-limit.js b/mongodb/examples/cursor-limit.js new file mode 100644 index 0000000..b1507c3 --- /dev/null +++ b/mongodb/examples/cursor-limit.js @@ -0,0 +1,21 @@ +// cursor.limit() - Limit the number of documents returned + +// Basic usage +db.users.find().limit(10) +db.users.find().limit(1) +db.users.find().limit(100) + +// With query filter +db.users.find({ status: "active" }).limit(50) +db.users.find({ age: { $gte: 18 } }).limit(25) + +// Chained with other cursor methods +db.users.find().sort({ name: 1 }).limit(10) +db.users.find().skip(20).limit(10) +db.users.find({ status: "active" }).sort({ createdAt: -1 }).limit(5) + +// Limit with projection +db.users.find().projection({ name: 1, email: 1 }).limit(10) + +// Limit 0 returns all documents (no limit) +db.users.find().limit(0) diff --git a/mongodb/examples/cursor-map.js b/mongodb/examples/cursor-map.js new file mode 100644 index 0000000..0cb1697 --- /dev/null +++ b/mongodb/examples/cursor-map.js @@ -0,0 +1,20 @@ +// cursor.map() - Apply a function to each document and return array of results + +// Basic usage with document argument +db.users.find().map({ field: "name" }) + +// With query filter +db.users.find({ status: "active" }).map({ extract: "email" }) +db.orders.find({ total: { $gt: 100 } }).map({ compute: "tax" }) + +// Chained with other cursor methods +db.users.find().sort({ name: 1 }).map({ field: "name" }) +db.users.find().limit(10).map({ transform: "user" }) +db.users.find({ status: "active" }).sort({ createdAt: -1 }).limit(5).map({ format: "output" }) + +// With projection +db.users.find().projection({ name: 1, email: 1 }).map({ concat: "contact" }) + +// With string argument representing transformation name +db.products.find({ inStock: true }).map("applyDiscount") +db.logs.find({ level: "error" }).map("extractMessage") diff --git a/mongodb/examples/cursor-max.js b/mongodb/examples/cursor-max.js new file mode 100644 index 0000000..91f0c80 --- /dev/null +++ b/mongodb/examples/cursor-max.js @@ -0,0 +1,23 @@ +// cursor.max() - Specify exclusive upper bound for index-based query + +// Basic usage with index key pattern +db.users.find({ age: { $gte: 18 } }).max({ age: 65 }) + +// With compound index +db.users.find().max({ status: "z", name: "z" }) +db.products.find({ category: "electronics" }).max({ category: "electronics", price: 1000 }) + +// Chained with min() for range +db.users.find().min({ age: 18 }).max({ age: 65 }) +db.products.find().min({ price: 10 }).max({ price: 100 }) + +// With hint (required for max to work correctly) +db.users.find().max({ age: 30 }).hint({ age: 1 }) +db.products.find().min({ price: 50 }).max({ price: 200 }).hint({ price: 1 }) + +// Chained with other cursor methods +db.users.find().max({ age: 50 }).hint({ age: 1 }).sort({ name: 1 }) +db.users.find().max({ age: 30 }).hint({ age: 1 }).limit(10) + +// With multiple fields +db.events.find().max({ date: ISODate("2024-12-31"), priority: 10 }) diff --git a/mongodb/examples/cursor-maxAwaitTimeMS.js b/mongodb/examples/cursor-maxAwaitTimeMS.js new file mode 100644 index 0000000..6f609e9 --- /dev/null +++ b/mongodb/examples/cursor-maxAwaitTimeMS.js @@ -0,0 +1,21 @@ +// cursor.maxAwaitTimeMS() - Set maximum time for tailable cursor getMore operations + +// Basic usage +db.oplog.find().maxAwaitTimeMS(1000) +db.oplog.find().maxAwaitTimeMS(5000) + +// With tailable cursor +db.capped.find().tailable().maxAwaitTimeMS(2000) +db.events.find().tailable(true).maxAwaitTimeMS(3000) + +// Different timeout values +db.oplog.find().maxAwaitTimeMS(100) +db.oplog.find().maxAwaitTimeMS(10000) +db.oplog.find().maxAwaitTimeMS(30000) + +// Chained with other cursor methods +db.logs.find({ level: "error" }).tailable().maxAwaitTimeMS(5000) +db.events.find().tailable().batchSize(100).maxAwaitTimeMS(2000) + +// For change streams and tailable cursors +db.changes.find().tailable(true).maxAwaitTimeMS(1000).batchSize(10) diff --git a/mongodb/examples/cursor-maxTimeMS.js b/mongodb/examples/cursor-maxTimeMS.js new file mode 100644 index 0000000..82efc3a --- /dev/null +++ b/mongodb/examples/cursor-maxTimeMS.js @@ -0,0 +1,27 @@ +// cursor.maxTimeMS() - Set maximum execution time for the query + +// Basic usage +db.users.find().maxTimeMS(5000) +db.users.find().maxTimeMS(1000) +db.users.find().maxTimeMS(30000) + +// With query filter +db.users.find({ status: "active" }).maxTimeMS(10000) +db.orders.find({ total: { $gt: 1000 } }).maxTimeMS(5000) + +// Chained with other cursor methods +db.users.find().sort({ name: 1 }).maxTimeMS(3000) +db.users.find().sort({ createdAt: -1 }).limit(100).maxTimeMS(5000) +db.users.find({ status: "active" }).skip(1000).limit(100).maxTimeMS(10000) + +// For long-running queries +db.analytics.find({ date: { $gte: ISODate("2024-01-01") } }).maxTimeMS(60000) + +// Short timeout for quick queries +db.users.find({ _id: ObjectId("507f1f77bcf86cd799439011") }).maxTimeMS(100) + +// With aggregation-style queries +db.logs.find({ $text: { $search: "error" } }).maxTimeMS(15000) + +// With explain +db.users.find({ status: "active" }).maxTimeMS(5000).explain() diff --git a/mongodb/examples/cursor-min.js b/mongodb/examples/cursor-min.js new file mode 100644 index 0000000..68ae608 --- /dev/null +++ b/mongodb/examples/cursor-min.js @@ -0,0 +1,26 @@ +// cursor.min() - Specify inclusive lower bound for index-based query + +// Basic usage with index key pattern +db.users.find({ age: { $lte: 65 } }).min({ age: 18 }) + +// With compound index +db.users.find().min({ status: "a", name: "a" }) +db.products.find({ category: "electronics" }).min({ category: "electronics", price: 0 }) + +// Chained with max() for range +db.users.find().min({ age: 18 }).max({ age: 65 }) +db.products.find().min({ price: 10 }).max({ price: 100 }) + +// With hint (required for min to work correctly) +db.users.find().min({ age: 21 }).hint({ age: 1 }) +db.products.find().min({ price: 50 }).hint({ price: 1 }) + +// Chained with other cursor methods +db.users.find().min({ age: 18 }).hint({ age: 1 }).sort({ name: 1 }) +db.users.find().min({ age: 21 }).hint({ age: 1 }).limit(10) + +// With multiple fields +db.events.find().min({ date: ISODate("2024-01-01"), priority: 1 }) + +// Range query with both bounds +db.scores.find().min({ score: 60 }).max({ score: 100 }).hint({ score: 1 }) diff --git a/mongodb/examples/cursor-next.js b/mongodb/examples/cursor-next.js new file mode 100644 index 0000000..99b2bfb --- /dev/null +++ b/mongodb/examples/cursor-next.js @@ -0,0 +1,24 @@ +// cursor.next() - Return the next document in the cursor + +// Basic usage +db.users.find().next() +db.users.find({}).next() + +// With query filter +db.users.find({ status: "active" }).next() +db.users.find({ role: "admin" }).next() + +// Chained with other cursor methods +db.users.find().sort({ name: 1 }).next() +db.users.find().sort({ createdAt: -1 }).next() +db.users.find().skip(10).next() + +// Get first matching document +db.users.find({ email: "admin@example.com" }).next() +db.orders.find({ status: "pending" }).sort({ createdAt: 1 }).next() + +// With projection +db.users.find().projection({ name: 1, email: 1 }).next() + +// With limit (still returns just one document) +db.users.find().limit(100).next() diff --git a/mongodb/examples/cursor-noCursorTimeout.js b/mongodb/examples/cursor-noCursorTimeout.js new file mode 100644 index 0000000..f3e3f9c --- /dev/null +++ b/mongodb/examples/cursor-noCursorTimeout.js @@ -0,0 +1,24 @@ +// cursor.noCursorTimeout() - Prevent cursor from timing out on the server + +// Basic usage +db.users.find().noCursorTimeout() +db.users.find({}).noCursorTimeout() + +// With query filter +db.users.find({ status: "active" }).noCursorTimeout() +db.largeCollection.find({ processed: false }).noCursorTimeout() + +// Chained with other cursor methods +db.users.find().sort({ name: 1 }).noCursorTimeout() +db.users.find().batchSize(100).noCursorTimeout() +db.users.find().limit(10000).noCursorTimeout() + +// For long-running batch operations +db.logs.find({ level: "error" }).noCursorTimeout().batchSize(50) +db.analytics.find({ date: { $gte: ISODate("2024-01-01") } }).noCursorTimeout() + +// Chained after noCursorTimeout +db.documents.find({ needsProcessing: true }).noCursorTimeout().toArray() + +// With projection +db.users.find().projection({ _id: 1, data: 1 }).noCursorTimeout() diff --git a/mongodb/examples/cursor-objsLeftInBatch.js b/mongodb/examples/cursor-objsLeftInBatch.js new file mode 100644 index 0000000..dd8d566 --- /dev/null +++ b/mongodb/examples/cursor-objsLeftInBatch.js @@ -0,0 +1,24 @@ +// cursor.objsLeftInBatch() - Return number of documents remaining in current batch + +// Basic usage +db.users.find().objsLeftInBatch() +db.users.find({}).objsLeftInBatch() + +// With query filter +db.users.find({ status: "active" }).objsLeftInBatch() +db.orders.find({ total: { $gt: 100 } }).objsLeftInBatch() + +// Chained with batchSize +db.users.find().batchSize(100).objsLeftInBatch() +db.users.find().batchSize(50).objsLeftInBatch() + +// Chained with other cursor methods +db.users.find().sort({ name: 1 }).objsLeftInBatch() +db.users.find().limit(1000).objsLeftInBatch() +db.users.find().skip(100).batchSize(25).objsLeftInBatch() + +// For monitoring batch consumption +db.logs.find({ level: "error" }).batchSize(10).objsLeftInBatch() + +// With projection +db.users.find().projection({ name: 1 }).objsLeftInBatch() diff --git a/mongodb/examples/cursor-pretty.js b/mongodb/examples/cursor-pretty.js new file mode 100644 index 0000000..672b942 --- /dev/null +++ b/mongodb/examples/cursor-pretty.js @@ -0,0 +1,24 @@ +// cursor.pretty() - Format output for readability in the shell + +// Basic usage +db.users.find().pretty() +db.users.find({}).pretty() + +// With query filter +db.users.find({ status: "active" }).pretty() +db.users.find({ age: { $gt: 25 } }).pretty() + +// Chained with other cursor methods +db.users.find().sort({ name: 1 }).pretty() +db.users.find().limit(10).pretty() +db.users.find().skip(5).limit(5).pretty() + +// Complex queries with pretty output +db.users.find({ $or: [{ status: "active" }, { role: "admin" }] }).pretty() +db.orders.find({ items: { $elemMatch: { price: { $gt: 100 } } } }).pretty() + +// With projection +db.users.find().projection({ name: 1, email: 1, address: 1 }).pretty() + +// Nested document display +db.users.find({ "address.city": "New York" }).pretty() diff --git a/mongodb/examples/cursor-projection.js b/mongodb/examples/cursor-projection.js new file mode 100644 index 0000000..b6f1efb --- /dev/null +++ b/mongodb/examples/cursor-projection.js @@ -0,0 +1,27 @@ +// cursor.projection() / cursor.project() - Specify fields to return + +// Include specific fields +db.users.find().projection({ name: 1, email: 1 }) +db.users.find().project({ name: 1, email: 1 }) + +// Exclude _id +db.users.find().projection({ name: 1, email: 1, _id: 0 }) + +// Exclude specific fields +db.users.find().projection({ password: 0, secretKey: 0 }) + +// With query filter +db.users.find({ status: "active" }).projection({ name: 1, status: 1 }) +db.users.find({ age: { $gte: 18 } }).project({ name: 1, age: 1 }) + +// Nested field projection +db.users.find().projection({ "address.city": 1, "address.country": 1 }) +db.users.find().project({ "profile.name": 1, "profile.avatar": 1 }) + +// Chained with other cursor methods +db.users.find().sort({ name: 1 }).projection({ name: 1 }).limit(10) +db.users.find({ status: "active" }).project({ name: 1, email: 1 }).skip(10).limit(10) + +// Array projection operators +db.posts.find().projection({ comments: { $slice: 5 } }) +db.posts.find().projection({ comments: { $elemMatch: { score: { $gt: 5 } } } }) diff --git a/mongodb/examples/cursor-readConcern.js b/mongodb/examples/cursor-readConcern.js new file mode 100644 index 0000000..1e5fcff --- /dev/null +++ b/mongodb/examples/cursor-readConcern.js @@ -0,0 +1,29 @@ +// cursor.readConcern() - Specify read concern level for the query + +// Local read concern (default) +db.users.find().readConcern({ level: "local" }) + +// Available read concern +db.users.find().readConcern({ level: "available" }) + +// Majority read concern +db.users.find().readConcern({ level: "majority" }) + +// Linearizable read concern +db.users.find().readConcern({ level: "linearizable" }) + +// Snapshot read concern +db.users.find().readConcern({ level: "snapshot" }) + +// With query filter +db.users.find({ status: "active" }).readConcern({ level: "majority" }) +db.orders.find({ total: { $gt: 1000 } }).readConcern({ level: "local" }) + +// Chained with other cursor methods +db.users.find().readConcern({ level: "majority" }).sort({ name: 1 }) +db.users.find().readConcern({ level: "majority" }).limit(10) +db.users.find({ status: "active" }).readConcern({ level: "majority" }).maxTimeMS(5000) + +// For consistency-critical queries +db.inventory.find({ sku: "abc123" }).readConcern({ level: "linearizable" }) +db.balances.find({ accountId: "12345" }).readConcern({ level: "majority" }) diff --git a/mongodb/examples/cursor-readPref.js b/mongodb/examples/cursor-readPref.js new file mode 100644 index 0000000..5cea746 --- /dev/null +++ b/mongodb/examples/cursor-readPref.js @@ -0,0 +1,35 @@ +// cursor.readPref() - Specify read preference for replica set queries + +// Primary read preference (default) +db.users.find().readPref("primary") + +// Primary preferred +db.users.find().readPref("primaryPreferred") + +// Secondary read preference +db.users.find().readPref("secondary") + +// Secondary preferred +db.users.find().readPref("secondaryPreferred") + +// Nearest read preference +db.users.find().readPref("nearest") + +// With tag sets +db.users.find().readPref("secondary", [{ region: "east" }]) +db.users.find().readPref("nearest", [{ dc: "us-east-1" }, { dc: "us-west-2" }]) + +// With maxStalenessSeconds +db.users.find().readPref("secondaryPreferred", [], { maxStalenessSeconds: 120 }) + +// With query filter +db.users.find({ status: "active" }).readPref("secondary") +db.analytics.find({ date: { $gte: ISODate("2024-01-01") } }).readPref("secondaryPreferred") + +// Chained with other cursor methods +db.users.find().readPref("secondary").sort({ name: 1 }) +db.users.find().readPref("nearest").limit(10) +db.reports.find().readPref("secondaryPreferred").maxTimeMS(30000) + +// Read from specific data center +db.users.find().readPref("nearest", [{ datacenter: "NYC" }]) diff --git a/mongodb/examples/cursor-returnKey.js b/mongodb/examples/cursor-returnKey.js new file mode 100644 index 0000000..73cb0b4 --- /dev/null +++ b/mongodb/examples/cursor-returnKey.js @@ -0,0 +1,25 @@ +// cursor.returnKey() - Return only the index keys in the result documents + +// Return only index keys +db.users.find().returnKey(true) +db.users.find({ status: "active" }).returnKey(true) + +// Disable returnKey (return full documents) +db.users.find().returnKey(false) + +// With index hint +db.users.find({ status: "active" }).hint({ status: 1 }).returnKey(true) +db.users.find({ email: "test@example.com" }).hint("email_1").returnKey(true) + +// With compound index +db.users.find({ name: "alice", age: 25 }).hint({ name: 1, age: 1 }).returnKey(true) + +// Chained with other cursor methods +db.users.find().hint({ age: 1 }).returnKey(true).sort({ age: 1 }) +db.users.find().returnKey(true).limit(10) + +// Useful for debugging index usage +db.orders.find({ customerId: ObjectId("507f1f77bcf86cd799439011") }).hint({ customerId: 1 }).returnKey(true) + +// With explain to see index behavior +db.users.find({ status: "active" }).returnKey(true).explain() diff --git a/mongodb/examples/cursor-showRecordId.js b/mongodb/examples/cursor-showRecordId.js new file mode 100644 index 0000000..3d76dcf --- /dev/null +++ b/mongodb/examples/cursor-showRecordId.js @@ -0,0 +1,26 @@ +// cursor.showRecordId() - Include the $recordId field in result documents + +// Show record IDs +db.users.find().showRecordId(true) +db.users.find({ status: "active" }).showRecordId(true) + +// Hide record IDs (default behavior) +db.users.find().showRecordId(false) + +// With query filter +db.users.find({ age: { $gt: 25 } }).showRecordId(true) +db.orders.find({ total: { $gt: 1000 } }).showRecordId(true) + +// Chained with other cursor methods +db.users.find().showRecordId(true).sort({ name: 1 }) +db.users.find().showRecordId(true).limit(10) +db.users.find().showRecordId(true).skip(5).limit(5) + +// With projection +db.users.find().projection({ name: 1, email: 1 }).showRecordId(true) + +// Useful for debugging and data inspection +db.collection.find({ corrupted: true }).showRecordId(true) + +// With pretty for readable output +db.users.find().showRecordId(true).pretty() diff --git a/mongodb/examples/cursor-size.js b/mongodb/examples/cursor-size.js new file mode 100644 index 0000000..27d6a9e --- /dev/null +++ b/mongodb/examples/cursor-size.js @@ -0,0 +1,28 @@ +// cursor.size() - Return count of documents considering skip and limit + +// Basic usage +db.users.find().size() +db.users.find({}).size() + +// With query filter +db.users.find({ status: "active" }).size() +db.users.find({ age: { $gte: 18 } }).size() + +// Size considers limit and skip (unlike count) +db.users.find().limit(10).size() +db.users.find().skip(5).size() +db.users.find().skip(10).limit(5).size() + +// Compare with count behavior +db.users.find().limit(100).size() +db.users.find().skip(50).limit(25).size() + +// With sort (doesn't affect size) +db.users.find().sort({ name: 1 }).size() + +// Complex queries +db.orders.find({ status: "completed", total: { $gt: 100 } }).size() +db.logs.find({ level: { $in: ["error", "fatal"] } }).skip(10).size() + +// With projection +db.users.find().projection({ _id: 1 }).size() diff --git a/mongodb/examples/cursor-skip.js b/mongodb/examples/cursor-skip.js new file mode 100644 index 0000000..30edbb4 --- /dev/null +++ b/mongodb/examples/cursor-skip.js @@ -0,0 +1,22 @@ +// cursor.skip() - Skip a number of documents in the result set + +// Basic usage +db.users.find().skip(10) +db.users.find().skip(0) +db.users.find().skip(100) + +// With query filter +db.users.find({ status: "active" }).skip(50) +db.users.find({ age: { $gte: 18 } }).skip(25) + +// Chained with other cursor methods (pagination pattern) +db.users.find().skip(0).limit(10) +db.users.find().skip(10).limit(10) +db.users.find().skip(20).limit(10) + +// With sort for consistent pagination +db.users.find().sort({ _id: 1 }).skip(100).limit(10) +db.users.find({ status: "active" }).sort({ createdAt: -1 }).skip(50).limit(25) + +// Skip with projection +db.users.find().projection({ name: 1 }).skip(5).limit(5) diff --git a/mongodb/examples/cursor-sort.js b/mongodb/examples/cursor-sort.js new file mode 100644 index 0000000..f1f16bb --- /dev/null +++ b/mongodb/examples/cursor-sort.js @@ -0,0 +1,27 @@ +// cursor.sort() - Sort documents in the result set + +// Basic ascending sort +db.users.find().sort({ name: 1 }) + +// Basic descending sort +db.users.find().sort({ age: -1 }) + +// Multiple field sort +db.users.find().sort({ status: 1, name: 1 }) +db.users.find().sort({ createdAt: -1, name: 1 }) + +// With query filter +db.users.find({ status: "active" }).sort({ name: 1 }) +db.users.find({ age: { $gt: 18 } }).sort({ age: -1 }) + +// Chained with other cursor methods +db.users.find().sort({ name: 1 }).limit(10) +db.users.find().sort({ createdAt: -1 }).skip(20).limit(10) +db.users.find({ status: "active" }).sort({ name: 1 }).limit(100).skip(0) + +// Sort on nested fields +db.users.find().sort({ "address.city": 1 }) +db.users.find().sort({ "profile.score": -1, "profile.name": 1 }) + +// Sort with text score (for text search) +db.articles.find({ $text: { $search: "mongodb" } }).sort({ score: { $meta: "textScore" } }) diff --git a/mongodb/examples/cursor-tailable.js b/mongodb/examples/cursor-tailable.js new file mode 100644 index 0000000..eeda58b --- /dev/null +++ b/mongodb/examples/cursor-tailable.js @@ -0,0 +1,30 @@ +// cursor.tailable() - Create a tailable cursor for capped collections + +// Basic tailable cursor +db.cappedCollection.find().tailable() +db.oplog.find().tailable() + +// With explicit true/false +db.cappedCollection.find().tailable(true) +db.cappedCollection.find().tailable(false) + +// With query filter +db.logs.find({ level: "error" }).tailable() +db.events.find({ type: "notification" }).tailable(true) + +// Tailable with awaitData (for blocking behavior) +db.cappedCollection.find().tailable().maxAwaitTimeMS(1000) +db.oplog.find().tailable(true).maxAwaitTimeMS(5000) + +// Chained with other cursor methods +db.cappedCollection.find().tailable().batchSize(10) +db.events.find().tailable(true).batchSize(100).maxAwaitTimeMS(2000) + +// For real-time log tailing +db.logs.find({ timestamp: { $gte: ISODate("2024-01-01") } }).tailable() + +// With projection +db.events.find().tailable().projection({ message: 1, timestamp: 1 }) + +// Oplog tailing pattern +db.oplog.find({ ts: { $gt: Timestamp(0, 0) } }).tailable(true) diff --git a/mongodb/examples/cursor-toArray.js b/mongodb/examples/cursor-toArray.js new file mode 100644 index 0000000..8e08352 --- /dev/null +++ b/mongodb/examples/cursor-toArray.js @@ -0,0 +1,28 @@ +// cursor.toArray() - Return all documents as an array + +// Basic usage +db.users.find().toArray() +db.users.find({}).toArray() + +// With query filter +db.users.find({ status: "active" }).toArray() +db.users.find({ age: { $gte: 18, $lte: 65 } }).toArray() + +// Chained with other cursor methods +db.users.find().sort({ name: 1 }).toArray() +db.users.find().limit(10).toArray() +db.users.find().skip(5).limit(5).toArray() + +// With sort and limit +db.users.find({ status: "active" }).sort({ createdAt: -1 }).limit(100).toArray() + +// With projection +db.users.find().projection({ name: 1, email: 1 }).toArray() +db.users.find().project({ name: 1, _id: 0 }).toArray() + +// Complex queries +db.orders.find({ $or: [{ status: "pending" }, { priority: "high" }] }).toArray() +db.logs.find({ level: { $in: ["error", "warn"] } }).sort({ timestamp: -1 }).limit(50).toArray() + +// With maxTimeMS for timeout +db.largeCollection.find().limit(1000).maxTimeMS(30000).toArray() diff --git a/mongodb/examples/cursor-tryNext.js b/mongodb/examples/cursor-tryNext.js new file mode 100644 index 0000000..70ba94a --- /dev/null +++ b/mongodb/examples/cursor-tryNext.js @@ -0,0 +1,26 @@ +// cursor.tryNext() - Return next document without blocking (for tailable cursors) + +// Basic usage +db.users.find().tryNext() +db.cappedCollection.find().tryNext() + +// With tailable cursor +db.cappedCollection.find().tailable().tryNext() +db.oplog.find().tailable(true).tryNext() + +// With query filter +db.events.find({ type: "notification" }).tailable().tryNext() +db.logs.find({ level: "error" }).tailable().tryNext() + +// Chained with other cursor methods +db.cappedCollection.find().tailable().batchSize(10).tryNext() +db.events.find().tailable().maxAwaitTimeMS(1000).tryNext() + +// For non-blocking iteration +db.logs.find({ timestamp: { $gte: ISODate("2024-01-01") } }).tailable().tryNext() + +// With projection +db.events.find().tailable().projection({ message: 1 }).tryNext() + +// Standard cursor (returns next or null) +db.users.find({ status: "active" }).tryNext() diff --git a/mongodb/examples/db-adminCommand.js b/mongodb/examples/db-adminCommand.js new file mode 100644 index 0000000..3e2a758 --- /dev/null +++ b/mongodb/examples/db-adminCommand.js @@ -0,0 +1,44 @@ +// db.adminCommand() - Run an administrative command against the admin database + +// Server status +db.adminCommand({ serverStatus: 1 }) + +// Current operations +db.adminCommand({ currentOp: 1 }) +db.adminCommand({ currentOp: 1, active: true }) + +// Kill operations +db.adminCommand({ killOp: 1, op: 12345 }) + +// Shutdown +db.adminCommand({ shutdown: 1 }) +db.adminCommand({ shutdown: 1, force: true }) + +// Log management +db.adminCommand({ getLog: "global" }) +db.adminCommand({ getLog: "startupWarnings" }) + +// Replica set commands +db.adminCommand({ replSetGetStatus: 1 }) +db.adminCommand({ replSetGetConfig: 1 }) +db.adminCommand({ replSetStepDown: 60 }) + +// Sharding commands +db.adminCommand({ listShards: 1 }) +db.adminCommand({ enableSharding: "mydb" }) +db.adminCommand({ shardCollection: "mydb.users", key: { _id: "hashed" } }) + +// User management +db.adminCommand({ listDatabases: 1 }) +db.adminCommand({ listDatabases: 1, nameOnly: true }) + +// Feature compatibility +db.adminCommand({ getParameter: 1, featureCompatibilityVersion: 1 }) +db.adminCommand({ setFeatureCompatibilityVersion: "6.0" }) + +// Connection pool +db.adminCommand({ connPoolStats: 1 }) + +// fsync +db.adminCommand({ fsync: 1 }) +db.adminCommand({ fsync: 1, lock: true }) diff --git a/mongodb/examples/db-aggregate.js b/mongodb/examples/db-aggregate.js new file mode 100644 index 0000000..21658ed --- /dev/null +++ b/mongodb/examples/db-aggregate.js @@ -0,0 +1,21 @@ +// db.aggregate() - Run aggregation pipeline against the database + +// Basic aggregation +db.aggregate([ + { $currentOp: {} } +]) + +// List all collections via aggregation +db.aggregate([ + { $listLocalSessions: {} } +]) + +// Admin database operations +db.aggregate([ + { $currentOp: { allUsers: true, idleSessions: true } } +]) + +// With options +db.aggregate([ + { $listLocalSessions: { allUsers: true } } +], { allowDiskUse: true }) diff --git a/mongodb/examples/db-auth.js b/mongodb/examples/db-auth.js new file mode 100644 index 0000000..9fca612 --- /dev/null +++ b/mongodb/examples/db-auth.js @@ -0,0 +1,24 @@ +// db.auth() - Authenticate a user to the database + +// Basic authentication with username and password +db.auth("username", "password") + +// Authentication with document +db.auth({ + user: "username", + pwd: "password" +}) + +// Authentication with mechanism +db.auth({ + user: "username", + pwd: "password", + mechanism: "SCRAM-SHA-256" +}) + +// Authentication with digest password disabled +db.auth({ + user: "username", + pwd: "password", + digestPassword: false +}) diff --git a/mongodb/examples/db-changeUserPassword.js b/mongodb/examples/db-changeUserPassword.js new file mode 100644 index 0000000..fc7f5db --- /dev/null +++ b/mongodb/examples/db-changeUserPassword.js @@ -0,0 +1,6 @@ +// db.changeUserPassword() - Change a user's password + +// Basic usage +db.changeUserPassword("reportUser", "newPassword123") +db.changeUserPassword("appUser", "SecureP@ssw0rd!") +db.changeUserPassword("admin", "adminNewPwd") diff --git a/mongodb/examples/db-cloneDatabase.js b/mongodb/examples/db-cloneDatabase.js new file mode 100644 index 0000000..7778af5 --- /dev/null +++ b/mongodb/examples/db-cloneDatabase.js @@ -0,0 +1,6 @@ +// db.cloneDatabase() - Deprecated: Clone a database from a remote host + +// Basic usage (deprecated in MongoDB 4.2+) +db.cloneDatabase("source.example.com") +db.cloneDatabase("192.168.1.100") +db.cloneDatabase("mongodb.local:27017") diff --git a/mongodb/examples/db-commandHelp.js b/mongodb/examples/db-commandHelp.js new file mode 100644 index 0000000..8661283 --- /dev/null +++ b/mongodb/examples/db-commandHelp.js @@ -0,0 +1,11 @@ +// db.commandHelp() - Returns help text for a database command + +// Get help for various commands +db.commandHelp("find") +db.commandHelp("aggregate") +db.commandHelp("insert") +db.commandHelp("update") +db.commandHelp("delete") +db.commandHelp("createIndexes") +db.commandHelp("serverStatus") +db.commandHelp("replSetGetStatus") diff --git a/mongodb/examples/db-copyDatabase.js b/mongodb/examples/db-copyDatabase.js new file mode 100644 index 0000000..76da335 --- /dev/null +++ b/mongodb/examples/db-copyDatabase.js @@ -0,0 +1,9 @@ +// db.copyDatabase() - Deprecated: Copy a database + +// Basic usage (deprecated in MongoDB 4.2+) +db.copyDatabase("source", "target") +db.copyDatabase("production", "staging") +db.copyDatabase("olddb", "newdb", "remote.host.com") + +// With authentication +db.copyDatabase("source", "target", "remote.host.com", "username", "password") diff --git a/mongodb/examples/db-createCollection.js b/mongodb/examples/db-createCollection.js new file mode 100644 index 0000000..12dfa62 --- /dev/null +++ b/mongodb/examples/db-createCollection.js @@ -0,0 +1,49 @@ +// db.createCollection() - Create a new collection with options + +// Basic collection creation +db.createCollection("users") +db.createCollection("orders") +db.createCollection("products") + +// Create capped collection +db.createCollection("logs", { capped: true, size: 10000 }) +db.createCollection("events", { capped: true, size: 100000, max: 5000 }) + +// Create collection with validation +db.createCollection("contacts", { + validator: { $jsonSchema: { + bsonType: "object", + required: ["name", "email"], + properties: { + name: { bsonType: "string" }, + email: { bsonType: "string" } + } + }} +}) + +// Create collection with storage engine options +db.createCollection("archive", { + storageEngine: { wiredTiger: { configString: "block_compressor=zstd" } } +}) + +// Create time series collection +db.createCollection("weather", { + timeseries: { + timeField: "timestamp", + metaField: "metadata", + granularity: "hours" + } +}) + +// Create collection with collation +db.createCollection("users_intl", { + collation: { locale: "en_US", strength: 2 } +}) + +// Create clustered collection +db.createCollection("orders_clustered", { + clusteredIndex: { + key: { _id: 1 }, + unique: true + } +}) diff --git a/mongodb/examples/db-createRole.js b/mongodb/examples/db-createRole.js new file mode 100644 index 0000000..e23bda3 --- /dev/null +++ b/mongodb/examples/db-createRole.js @@ -0,0 +1,42 @@ +// db.createRole() - Create a new role + +// Basic role with privileges +db.createRole({ + role: "readWriteReports", + privileges: [ + { resource: { db: "reporting", collection: "" }, actions: ["find", "insert", "update"] } + ], + roles: [] +}) + +// Role inheriting from other roles +db.createRole({ + role: "appAdmin", + privileges: [], + roles: [ + { role: "readWrite", db: "app" }, + { role: "read", db: "logs" } + ] +}) + +// Role with specific collection privileges +db.createRole({ + role: "orderManager", + privileges: [ + { resource: { db: "sales", collection: "orders" }, actions: ["find", "insert", "update", "remove"] }, + { resource: { db: "sales", collection: "customers" }, actions: ["find"] } + ], + roles: [] +}) + +// Role with write concern +db.createRole({ + role: "criticalWriter", + privileges: [ + { resource: { db: "critical", collection: "" }, actions: ["insert", "update"] } + ], + roles: [] +}, { + w: "majority", + wtimeout: 5000 +}) diff --git a/mongodb/examples/db-createUser.js b/mongodb/examples/db-createUser.js new file mode 100644 index 0000000..95eb031 --- /dev/null +++ b/mongodb/examples/db-createUser.js @@ -0,0 +1,52 @@ +// db.createUser() - Create a new user + +// Basic user with role +db.createUser({ + user: "appUser", + pwd: "password123", + roles: ["readWrite"] +}) + +// User with multiple roles +db.createUser({ + user: "adminUser", + pwd: "securePassword", + roles: [ + { role: "readWrite", db: "app" }, + { role: "read", db: "reporting" } + ] +}) + +// User with custom data +db.createUser({ + user: "developer", + pwd: "devPassword", + roles: ["readWrite"], + customData: { department: "engineering", team: "backend" } +}) + +// User with authentication restrictions +db.createUser({ + user: "restrictedUser", + pwd: "password", + roles: ["read"], + authenticationRestrictions: [ + { clientSource: ["192.168.1.0/24"], serverAddress: ["192.168.1.100"] } + ] +}) + +// User with SCRAM-SHA-256 mechanism +db.createUser({ + user: "secureUser", + pwd: "strongPassword", + roles: ["readWrite"], + mechanisms: ["SCRAM-SHA-256"] +}) + +// User with passwordDigestor +db.createUser({ + user: "clientDigestUser", + pwd: "password", + roles: ["read"], + passwordDigestor: "client" +}) diff --git a/mongodb/examples/db-createView.js b/mongodb/examples/db-createView.js new file mode 100644 index 0000000..13b1907 --- /dev/null +++ b/mongodb/examples/db-createView.js @@ -0,0 +1,40 @@ +// db.createView() - Create a view + +// Basic view +db.createView("activeUsers", "users", [ + { $match: { status: "active" } } +]) + +// View with multiple pipeline stages +db.createView("orderSummary", "orders", [ + { $match: { status: "completed" } }, + { $group: { _id: "$customerId", totalAmount: { $sum: "$amount" } } }, + { $sort: { totalAmount: -1 } } +]) + +// View with lookup +db.createView("userOrders", "users", [ + { $lookup: { + from: "orders", + localField: "_id", + foreignField: "userId", + as: "orders" + }} +]) + +// View with collation +db.createView("sortedProducts", "products", [ + { $sort: { name: 1 } } +], { + collation: { locale: "en", strength: 2 } +}) + +// View with projection +db.createView("publicUsers", "users", [ + { $project: { + name: 1, + email: 1, + createdAt: 1, + _id: 0 + }} +]) diff --git a/mongodb/examples/db-currentOp.js b/mongodb/examples/db-currentOp.js new file mode 100644 index 0000000..dddfd4e --- /dev/null +++ b/mongodb/examples/db-currentOp.js @@ -0,0 +1,34 @@ +// db.currentOp() - Returns information on current database operations + +// Basic usage +db.currentOp() + +// Show all operations including idle connections +db.currentOp(true) + +// Filter by active operations +db.currentOp({ active: true }) + +// Filter by operation type +db.currentOp({ op: "query" }) +db.currentOp({ op: "insert" }) +db.currentOp({ op: "update" }) + +// Filter by namespace +db.currentOp({ ns: "mydb.users" }) + +// Filter long-running operations +db.currentOp({ secs_running: { $gt: 5 } }) + +// Combined filters +db.currentOp({ + active: true, + secs_running: { $gt: 3 }, + op: { $ne: "none" } +}) + +// Filter by client +db.currentOp({ client: "192.168.1.100:12345" }) + +// Show operations waiting for lock +db.currentOp({ waitingForLock: true }) diff --git a/mongodb/examples/db-dropAllRoles.js b/mongodb/examples/db-dropAllRoles.js new file mode 100644 index 0000000..88eaa84 --- /dev/null +++ b/mongodb/examples/db-dropAllRoles.js @@ -0,0 +1,8 @@ +// db.dropAllRoles() - Drop all user-defined roles from the database + +// Basic usage +db.dropAllRoles() + +// With write concern +db.dropAllRoles({ w: "majority" }) +db.dropAllRoles({ w: 1, j: true }) diff --git a/mongodb/examples/db-dropAllUsers.js b/mongodb/examples/db-dropAllUsers.js new file mode 100644 index 0000000..4b93c54 --- /dev/null +++ b/mongodb/examples/db-dropAllUsers.js @@ -0,0 +1,8 @@ +// db.dropAllUsers() - Drop all users from the database + +// Basic usage +db.dropAllUsers() + +// With write concern +db.dropAllUsers({ w: "majority" }) +db.dropAllUsers({ w: 1, j: true }) diff --git a/mongodb/examples/db-dropDatabase.js b/mongodb/examples/db-dropDatabase.js new file mode 100644 index 0000000..bac99d9 --- /dev/null +++ b/mongodb/examples/db-dropDatabase.js @@ -0,0 +1,4 @@ +// db.dropDatabase() - Drop the current database + +// Basic usage +db.dropDatabase() diff --git a/mongodb/examples/db-dropRole.js b/mongodb/examples/db-dropRole.js new file mode 100644 index 0000000..fc13b61 --- /dev/null +++ b/mongodb/examples/db-dropRole.js @@ -0,0 +1,10 @@ +// db.dropRole() - Drop a user-defined role + +// Basic usage +db.dropRole("tempRole") +db.dropRole("readWriteReports") +db.dropRole("appAdmin") + +// With write concern +db.dropRole("customRole", { w: "majority" }) +db.dropRole("deprecatedRole", { w: 1, j: true }) diff --git a/mongodb/examples/db-dropUser.js b/mongodb/examples/db-dropUser.js new file mode 100644 index 0000000..687b507 --- /dev/null +++ b/mongodb/examples/db-dropUser.js @@ -0,0 +1,10 @@ +// db.dropUser() - Drop a user from the database + +// Basic usage +db.dropUser("tempUser") +db.dropUser("oldUser") +db.dropUser("testAccount") + +// With write concern +db.dropUser("removedUser", { w: "majority" }) +db.dropUser("deprecatedUser", { w: 1, j: true }) diff --git a/mongodb/examples/db-fsyncLock.js b/mongodb/examples/db-fsyncLock.js new file mode 100644 index 0000000..ff9bc55 --- /dev/null +++ b/mongodb/examples/db-fsyncLock.js @@ -0,0 +1,4 @@ +// db.fsyncLock() - Flush writes and lock the database for backup + +// Basic usage +db.fsyncLock() diff --git a/mongodb/examples/db-fsyncUnlock.js b/mongodb/examples/db-fsyncUnlock.js new file mode 100644 index 0000000..fc5c839 --- /dev/null +++ b/mongodb/examples/db-fsyncUnlock.js @@ -0,0 +1,4 @@ +// db.fsyncUnlock() - Unlock the database after fsyncLock + +// Basic usage +db.fsyncUnlock() diff --git a/mongodb/examples/db-getLogComponents.js b/mongodb/examples/db-getLogComponents.js new file mode 100644 index 0000000..b9cc1b5 --- /dev/null +++ b/mongodb/examples/db-getLogComponents.js @@ -0,0 +1,4 @@ +// db.getLogComponents() - Returns the current log verbosity settings + +// Basic usage +db.getLogComponents() diff --git a/mongodb/examples/db-getMongo.js b/mongodb/examples/db-getMongo.js new file mode 100644 index 0000000..9f747ab --- /dev/null +++ b/mongodb/examples/db-getMongo.js @@ -0,0 +1,4 @@ +// db.getMongo() - Returns the Mongo connection object for the database + +// Basic usage +db.getMongo() diff --git a/mongodb/examples/db-getName.js b/mongodb/examples/db-getName.js new file mode 100644 index 0000000..bc9179b --- /dev/null +++ b/mongodb/examples/db-getName.js @@ -0,0 +1,4 @@ +// db.getName() - Returns the name of the current database + +// Basic usage +db.getName() diff --git a/mongodb/examples/db-getProfilingLevel.js b/mongodb/examples/db-getProfilingLevel.js new file mode 100644 index 0000000..3c04199 --- /dev/null +++ b/mongodb/examples/db-getProfilingLevel.js @@ -0,0 +1,4 @@ +// db.getProfilingLevel() - Returns the current profiling level + +// Basic usage +db.getProfilingLevel() diff --git a/mongodb/examples/db-getProfilingStatus.js b/mongodb/examples/db-getProfilingStatus.js new file mode 100644 index 0000000..0318bba --- /dev/null +++ b/mongodb/examples/db-getProfilingStatus.js @@ -0,0 +1,4 @@ +// db.getProfilingStatus() - Returns the current profiling status + +// Basic usage +db.getProfilingStatus() diff --git a/mongodb/examples/db-getReplicationInfo.js b/mongodb/examples/db-getReplicationInfo.js new file mode 100644 index 0000000..36c9203 --- /dev/null +++ b/mongodb/examples/db-getReplicationInfo.js @@ -0,0 +1,4 @@ +// db.getReplicationInfo() - Returns replication information from oplog + +// Basic usage +db.getReplicationInfo() diff --git a/mongodb/examples/db-getRole.js b/mongodb/examples/db-getRole.js new file mode 100644 index 0000000..9a26697 --- /dev/null +++ b/mongodb/examples/db-getRole.js @@ -0,0 +1,16 @@ +// db.getRole() - Returns role information + +// Basic usage +db.getRole("read") +db.getRole("readWrite") +db.getRole("dbAdmin") + +// With privilege information +db.getRole("customRole", { showPrivileges: true }) +db.getRole("appAdmin", { showPrivileges: true }) + +// With built-in roles +db.getRole("read", { showBuiltinRoles: true }) + +// With authentication restrictions +db.getRole("restrictedRole", { showAuthenticationRestrictions: true }) diff --git a/mongodb/examples/db-getRoles.js b/mongodb/examples/db-getRoles.js new file mode 100644 index 0000000..5049f03 --- /dev/null +++ b/mongodb/examples/db-getRoles.js @@ -0,0 +1,16 @@ +// db.getRoles() - Returns all roles in the database + +// Basic usage +db.getRoles() + +// Include built-in roles +db.getRoles({ showBuiltinRoles: true }) + +// Include privileges +db.getRoles({ showPrivileges: true }) + +// Include both +db.getRoles({ showBuiltinRoles: true, showPrivileges: true }) + +// Include authentication restrictions +db.getRoles({ showAuthenticationRestrictions: true }) diff --git a/mongodb/examples/db-getSiblingDB.js b/mongodb/examples/db-getSiblingDB.js new file mode 100644 index 0000000..b6d506d --- /dev/null +++ b/mongodb/examples/db-getSiblingDB.js @@ -0,0 +1,13 @@ +// db.getSiblingDB() - Returns another database without modifying db variable + +// Basic usage - switch to different databases +db.getSiblingDB("admin") +db.getSiblingDB("test") +db.getSiblingDB("myapp") + +// Common use case: access admin database +db.getSiblingDB("admin") + +// Access database with special characters in name +db.getSiblingDB("my-app-db") +db.getSiblingDB("app_v2") diff --git a/mongodb/examples/db-getUser.js b/mongodb/examples/db-getUser.js new file mode 100644 index 0000000..bfaae02 --- /dev/null +++ b/mongodb/examples/db-getUser.js @@ -0,0 +1,18 @@ +// db.getUser() - Returns user information + +// Basic usage +db.getUser("appUser") +db.getUser("admin") +db.getUser("reportUser") + +// With additional options +db.getUser("appUser", { showCredentials: true }) +db.getUser("appUser", { showPrivileges: true }) +db.getUser("appUser", { showAuthenticationRestrictions: true }) + +// With multiple options +db.getUser("appUser", { + showCredentials: true, + showPrivileges: true, + showAuthenticationRestrictions: true +}) diff --git a/mongodb/examples/db-getUsers.js b/mongodb/examples/db-getUsers.js new file mode 100644 index 0000000..87ea798 --- /dev/null +++ b/mongodb/examples/db-getUsers.js @@ -0,0 +1,18 @@ +// db.getUsers() - Returns all users in the database + +// Basic usage +db.getUsers() + +// With options +db.getUsers({ showCredentials: true }) +db.getUsers({ showPrivileges: true }) + +// With filter +db.getUsers({ filter: { roles: { $elemMatch: { role: "readWrite" } } } }) + +// With multiple options +db.getUsers({ + showCredentials: false, + showPrivileges: true, + filter: { "customData.department": "engineering" } +}) diff --git a/mongodb/examples/db-grantPrivilegesToRole.js b/mongodb/examples/db-grantPrivilegesToRole.js new file mode 100644 index 0000000..d8a8173 --- /dev/null +++ b/mongodb/examples/db-grantPrivilegesToRole.js @@ -0,0 +1,22 @@ +// db.grantPrivilegesToRole() - Grant privileges to a role + +// Grant single privilege +db.grantPrivilegesToRole("customRole", [ + { resource: { db: "mydb", collection: "users" }, actions: ["find"] } +]) + +// Grant multiple privileges +db.grantPrivilegesToRole("appRole", [ + { resource: { db: "app", collection: "logs" }, actions: ["find", "insert"] }, + { resource: { db: "app", collection: "metrics" }, actions: ["find"] } +]) + +// Grant database-wide privilege +db.grantPrivilegesToRole("dbRole", [ + { resource: { db: "reporting", collection: "" }, actions: ["find", "listCollections"] } +]) + +// With write concern +db.grantPrivilegesToRole("criticalRole", [ + { resource: { db: "critical", collection: "data" }, actions: ["insert", "update"] } +], { w: "majority" }) diff --git a/mongodb/examples/db-grantRolesToRole.js b/mongodb/examples/db-grantRolesToRole.js new file mode 100644 index 0000000..08b4abb --- /dev/null +++ b/mongodb/examples/db-grantRolesToRole.js @@ -0,0 +1,16 @@ +// db.grantRolesToRole() - Grant roles to a role + +// Grant single role +db.grantRolesToRole("appRole", ["read"]) + +// Grant multiple roles +db.grantRolesToRole("superRole", ["readWrite", "dbAdmin"]) + +// Grant roles from different databases +db.grantRolesToRole("crossDbRole", [ + { role: "read", db: "reporting" }, + { role: "readWrite", db: "app" } +]) + +// With write concern +db.grantRolesToRole("criticalRole", ["dbAdmin"], { w: "majority" }) diff --git a/mongodb/examples/db-grantRolesToUser.js b/mongodb/examples/db-grantRolesToUser.js new file mode 100644 index 0000000..8aa78a4 --- /dev/null +++ b/mongodb/examples/db-grantRolesToUser.js @@ -0,0 +1,16 @@ +// db.grantRolesToUser() - Grant roles to a user + +// Grant single role +db.grantRolesToUser("appUser", ["readWrite"]) + +// Grant multiple roles +db.grantRolesToUser("adminUser", ["dbAdmin", "userAdmin"]) + +// Grant roles from different databases +db.grantRolesToUser("crossDbUser", [ + { role: "read", db: "logs" }, + { role: "readWrite", db: "app" } +]) + +// With write concern +db.grantRolesToUser("criticalUser", ["dbOwner"], { w: "majority" }) diff --git a/mongodb/examples/db-hello.js b/mongodb/examples/db-hello.js new file mode 100644 index 0000000..c01516d --- /dev/null +++ b/mongodb/examples/db-hello.js @@ -0,0 +1,4 @@ +// db.hello() - Returns information about the server + +// Basic usage +db.hello() diff --git a/mongodb/examples/db-hostInfo.js b/mongodb/examples/db-hostInfo.js new file mode 100644 index 0000000..222e66d --- /dev/null +++ b/mongodb/examples/db-hostInfo.js @@ -0,0 +1,4 @@ +// db.hostInfo() - Returns information about the system hosting MongoDB + +// Basic usage +db.hostInfo() diff --git a/mongodb/examples/db-isMaster.js b/mongodb/examples/db-isMaster.js new file mode 100644 index 0000000..35d363a --- /dev/null +++ b/mongodb/examples/db-isMaster.js @@ -0,0 +1,4 @@ +// db.isMaster() - Deprecated: Returns information about the server (use db.hello() instead) + +// Basic usage +db.isMaster() diff --git a/mongodb/examples/db-killOp.js b/mongodb/examples/db-killOp.js new file mode 100644 index 0000000..63938a6 --- /dev/null +++ b/mongodb/examples/db-killOp.js @@ -0,0 +1,8 @@ +// db.killOp() - Terminate an operation by operation ID + +// Basic usage +db.killOp(12345) +db.killOp(67890) + +// Kill operation with comment reference +db.killOp(99999) diff --git a/mongodb/examples/db-listCommands.js b/mongodb/examples/db-listCommands.js new file mode 100644 index 0000000..6055ef0 --- /dev/null +++ b/mongodb/examples/db-listCommands.js @@ -0,0 +1,4 @@ +// db.listCommands() - Lists all database commands + +// Basic usage +db.listCommands() diff --git a/mongodb/examples/db-logout.js b/mongodb/examples/db-logout.js new file mode 100644 index 0000000..e407573 --- /dev/null +++ b/mongodb/examples/db-logout.js @@ -0,0 +1,4 @@ +// db.logout() - End the current authentication session + +// Basic usage +db.logout() diff --git a/mongodb/examples/db-printCollectionStats.js b/mongodb/examples/db-printCollectionStats.js new file mode 100644 index 0000000..a3554db --- /dev/null +++ b/mongodb/examples/db-printCollectionStats.js @@ -0,0 +1,8 @@ +// db.printCollectionStats() - Print statistics for all collections + +// Basic usage +db.printCollectionStats() + +// With scale factor +db.printCollectionStats(1024) +db.printCollectionStats(1048576) diff --git a/mongodb/examples/db-printReplicationInfo.js b/mongodb/examples/db-printReplicationInfo.js new file mode 100644 index 0000000..e848ef0 --- /dev/null +++ b/mongodb/examples/db-printReplicationInfo.js @@ -0,0 +1,4 @@ +// db.printReplicationInfo() - Print replication status from primary's perspective + +// Basic usage +db.printReplicationInfo() diff --git a/mongodb/examples/db-printSecondaryReplicationInfo.js b/mongodb/examples/db-printSecondaryReplicationInfo.js new file mode 100644 index 0000000..6670287 --- /dev/null +++ b/mongodb/examples/db-printSecondaryReplicationInfo.js @@ -0,0 +1,4 @@ +// db.printSecondaryReplicationInfo() - Print replication info from secondary's perspective + +// Basic usage +db.printSecondaryReplicationInfo() diff --git a/mongodb/examples/db-printShardingStatus.js b/mongodb/examples/db-printShardingStatus.js new file mode 100644 index 0000000..9fa69fd --- /dev/null +++ b/mongodb/examples/db-printShardingStatus.js @@ -0,0 +1,7 @@ +// db.printShardingStatus() - Print sharding status + +// Basic usage +db.printShardingStatus() + +// With verbose output +db.printShardingStatus(true) diff --git a/mongodb/examples/db-printSlaveReplicationInfo.js b/mongodb/examples/db-printSlaveReplicationInfo.js new file mode 100644 index 0000000..8aaeb61 --- /dev/null +++ b/mongodb/examples/db-printSlaveReplicationInfo.js @@ -0,0 +1,4 @@ +// db.printSlaveReplicationInfo() - Deprecated: Use db.printSecondaryReplicationInfo() + +// Basic usage (deprecated) +db.printSlaveReplicationInfo() diff --git a/mongodb/examples/db-revokePrivilegesFromRole.js b/mongodb/examples/db-revokePrivilegesFromRole.js new file mode 100644 index 0000000..e088bb0 --- /dev/null +++ b/mongodb/examples/db-revokePrivilegesFromRole.js @@ -0,0 +1,17 @@ +// db.revokePrivilegesFromRole() - Revoke privileges from a role + +// Revoke single privilege +db.revokePrivilegesFromRole("customRole", [ + { resource: { db: "mydb", collection: "users" }, actions: ["insert"] } +]) + +// Revoke multiple privileges +db.revokePrivilegesFromRole("appRole", [ + { resource: { db: "app", collection: "logs" }, actions: ["insert", "update"] }, + { resource: { db: "app", collection: "metrics" }, actions: ["remove"] } +]) + +// With write concern +db.revokePrivilegesFromRole("sensitiveRole", [ + { resource: { db: "sensitive", collection: "data" }, actions: ["find"] } +], { w: "majority" }) diff --git a/mongodb/examples/db-revokeRolesFromRole.js b/mongodb/examples/db-revokeRolesFromRole.js new file mode 100644 index 0000000..df2b3ba --- /dev/null +++ b/mongodb/examples/db-revokeRolesFromRole.js @@ -0,0 +1,16 @@ +// db.revokeRolesFromRole() - Revoke roles from a role + +// Revoke single role +db.revokeRolesFromRole("appRole", ["read"]) + +// Revoke multiple roles +db.revokeRolesFromRole("superRole", ["dbAdmin", "userAdmin"]) + +// Revoke roles from different databases +db.revokeRolesFromRole("crossDbRole", [ + { role: "read", db: "reporting" }, + { role: "readWrite", db: "logs" } +]) + +// With write concern +db.revokeRolesFromRole("criticalRole", ["dbOwner"], { w: "majority" }) diff --git a/mongodb/examples/db-revokeRolesFromUser.js b/mongodb/examples/db-revokeRolesFromUser.js new file mode 100644 index 0000000..0d4e3bd --- /dev/null +++ b/mongodb/examples/db-revokeRolesFromUser.js @@ -0,0 +1,16 @@ +// db.revokeRolesFromUser() - Revoke roles from a user + +// Revoke single role +db.revokeRolesFromUser("appUser", ["readWrite"]) + +// Revoke multiple roles +db.revokeRolesFromUser("adminUser", ["dbAdmin", "userAdmin"]) + +// Revoke roles from different databases +db.revokeRolesFromUser("crossDbUser", [ + { role: "read", db: "logs" }, + { role: "readWrite", db: "archive" } +]) + +// With write concern +db.revokeRolesFromUser("sensitiveUser", ["dbOwner"], { w: "majority" }) diff --git a/mongodb/examples/db-rotateCertificates.js b/mongodb/examples/db-rotateCertificates.js new file mode 100644 index 0000000..98ee931 --- /dev/null +++ b/mongodb/examples/db-rotateCertificates.js @@ -0,0 +1,7 @@ +// db.rotateCertificates() - Rotate TLS certificates + +// Basic usage +db.rotateCertificates() + +// With message +db.rotateCertificates("Certificate rotation triggered by admin") diff --git a/mongodb/examples/db-runCommand.js b/mongodb/examples/db-runCommand.js new file mode 100644 index 0000000..c19601d --- /dev/null +++ b/mongodb/examples/db-runCommand.js @@ -0,0 +1,52 @@ +// db.runCommand() - Run a database command + +// Basic commands +db.runCommand({ ping: 1 }) +db.runCommand({ serverStatus: 1 }) +db.runCommand({ buildInfo: 1 }) + +// Collection operations +db.runCommand({ create: "testCollection" }) +db.runCommand({ drop: "testCollection" }) +db.runCommand({ listCollections: 1 }) + +// Find command +db.runCommand({ + find: "users", + filter: { age: { $gt: 21 } }, + limit: 10 +}) + +// Aggregate command +db.runCommand({ + aggregate: "orders", + pipeline: [ + { $match: { status: "active" } }, + { $group: { _id: "$customerId", total: { $sum: "$amount" } } } + ], + cursor: {} +}) + +// Index commands +db.runCommand({ createIndexes: "users", indexes: [{ key: { email: 1 }, name: "email_1" }] }) +db.runCommand({ dropIndexes: "users", index: "email_1" }) + +// Admin commands +db.runCommand({ collStats: "users" }) +db.runCommand({ dbStats: 1, scale: 1024 }) +db.runCommand({ validate: "users" }) + +// User management +db.runCommand({ + createUser: "appUser", + pwd: "password123", + roles: [{ role: "readWrite", db: "mydb" }] +}) + +// Profiling +db.runCommand({ profile: 1, slowms: 100 }) +db.runCommand({ profile: 0 }) + +// Replication commands +db.runCommand({ replSetGetStatus: 1 }) +db.runCommand({ isMaster: 1 }) diff --git a/mongodb/examples/db-serverBuildInfo.js b/mongodb/examples/db-serverBuildInfo.js new file mode 100644 index 0000000..4d6cbc8 --- /dev/null +++ b/mongodb/examples/db-serverBuildInfo.js @@ -0,0 +1,4 @@ +// db.serverBuildInfo() - Returns information about MongoDB server build + +// Basic usage +db.serverBuildInfo() diff --git a/mongodb/examples/db-serverStatus.js b/mongodb/examples/db-serverStatus.js new file mode 100644 index 0000000..4dbd597 --- /dev/null +++ b/mongodb/examples/db-serverStatus.js @@ -0,0 +1,18 @@ +// db.serverStatus() - Returns an overview of the database server state + +// Basic server status +db.serverStatus() + +// Server status with specific sections +db.serverStatus({ repl: 0, metrics: 0 }) +db.serverStatus({ locks: 1 }) +db.serverStatus({ opcounters: 1, connections: 1 }) + +// Exclude specific sections +db.serverStatus({ asserts: 0, connections: 0 }) + +// Server status with latchAnalysis +db.serverStatus({ latchAnalysis: 1 }) + +// Server status with mirroredReads +db.serverStatus({ mirroredReads: 1 }) diff --git a/mongodb/examples/db-setLogLevel.js b/mongodb/examples/db-setLogLevel.js new file mode 100644 index 0000000..7184970 --- /dev/null +++ b/mongodb/examples/db-setLogLevel.js @@ -0,0 +1,13 @@ +// db.setLogLevel() - Set the log verbosity level + +// Set global log level +db.setLogLevel(1) +db.setLogLevel(2) +db.setLogLevel(0) + +// Set component-specific log level +db.setLogLevel(1, "query") +db.setLogLevel(2, "replication") +db.setLogLevel(1, "storage") +db.setLogLevel(3, "network") +db.setLogLevel(2, "accessControl") diff --git a/mongodb/examples/db-setProfilingLevel.js b/mongodb/examples/db-setProfilingLevel.js new file mode 100644 index 0000000..1c27dcf --- /dev/null +++ b/mongodb/examples/db-setProfilingLevel.js @@ -0,0 +1,21 @@ +// db.setProfilingLevel() - Set the database profiler level + +// Turn off profiling +db.setProfilingLevel(0) + +// Profile slow operations only (default threshold 100ms) +db.setProfilingLevel(1) + +// Profile all operations +db.setProfilingLevel(2) + +// Set custom slow operation threshold +db.setProfilingLevel(1, 50) +db.setProfilingLevel(1, 200) + +// With options object +db.setProfilingLevel(1, { slowms: 100 }) +db.setProfilingLevel(1, { slowms: 50, sampleRate: 0.5 }) + +// Profile with sample rate +db.setProfilingLevel(2, { sampleRate: 0.1 }) diff --git a/mongodb/examples/db-setSecondaryOk.js b/mongodb/examples/db-setSecondaryOk.js new file mode 100644 index 0000000..bf2bdd3 --- /dev/null +++ b/mongodb/examples/db-setSecondaryOk.js @@ -0,0 +1,6 @@ +// db.setSecondaryOk() - Deprecated: Allow reading from secondary + +// Basic usage (deprecated - use read preference instead) +db.setSecondaryOk() +db.setSecondaryOk(true) +db.setSecondaryOk(false) diff --git a/mongodb/examples/db-setWriteConcern.js b/mongodb/examples/db-setWriteConcern.js new file mode 100644 index 0000000..87d072f --- /dev/null +++ b/mongodb/examples/db-setWriteConcern.js @@ -0,0 +1,16 @@ +// db.setWriteConcern() - Set the default write concern + +// Set write concern with w value +db.setWriteConcern({ w: 1 }) +db.setWriteConcern({ w: "majority" }) +db.setWriteConcern({ w: 2 }) + +// Set write concern with journal +db.setWriteConcern({ w: 1, j: true }) +db.setWriteConcern({ w: "majority", j: true }) + +// Set write concern with timeout +db.setWriteConcern({ w: "majority", wtimeout: 5000 }) + +// Combined options +db.setWriteConcern({ w: "majority", j: true, wtimeout: 10000 }) diff --git a/mongodb/examples/db-shutdownServer.js b/mongodb/examples/db-shutdownServer.js new file mode 100644 index 0000000..1cb725e --- /dev/null +++ b/mongodb/examples/db-shutdownServer.js @@ -0,0 +1,9 @@ +// db.shutdownServer() - Shut down the MongoDB server + +// Basic usage +db.shutdownServer() + +// With options +db.shutdownServer({ force: true }) +db.shutdownServer({ timeoutSecs: 60 }) +db.shutdownServer({ force: true, timeoutSecs: 30 }) diff --git a/mongodb/examples/db-stats.js b/mongodb/examples/db-stats.js new file mode 100644 index 0000000..123728b --- /dev/null +++ b/mongodb/examples/db-stats.js @@ -0,0 +1,17 @@ +// db.stats() - Get database statistics + +// Basic stats +db.stats() + +// Stats with scale factor (convert bytes to KB) +db.stats(1024) + +// Stats with options document +db.stats({ scale: 1024 }) +db.stats({ scale: 1048576 }) + +// Stats with freeStorage option +db.stats({ freeStorage: 1 }) + +// Stats with multiple options +db.stats({ scale: 1024, freeStorage: 1 }) diff --git a/mongodb/examples/db-updateRole.js b/mongodb/examples/db-updateRole.js new file mode 100644 index 0000000..ef39701 --- /dev/null +++ b/mongodb/examples/db-updateRole.js @@ -0,0 +1,38 @@ +// db.updateRole() - Update a role + +// Update privileges +db.updateRole("customRole", { + privileges: [ + { resource: { db: "mydb", collection: "users" }, actions: ["find", "update"] } + ] +}) + +// Update inherited roles +db.updateRole("appRole", { + roles: [ + { role: "readWrite", db: "app" }, + { role: "read", db: "logs" } + ] +}) + +// Update both privileges and roles +db.updateRole("fullRole", { + privileges: [ + { resource: { db: "admin", collection: "system.users" }, actions: ["find"] } + ], + roles: ["readWriteAnyDatabase"] +}) + +// Update authentication restrictions +db.updateRole("restrictedRole", { + authenticationRestrictions: [ + { clientSource: ["192.168.1.0/24"] } + ] +}) + +// With write concern +db.updateRole("criticalRole", { + privileges: [ + { resource: { db: "critical", collection: "" }, actions: ["find"] } + ] +}, { w: "majority" }) diff --git a/mongodb/examples/db-updateUser.js b/mongodb/examples/db-updateUser.js new file mode 100644 index 0000000..e053838 --- /dev/null +++ b/mongodb/examples/db-updateUser.js @@ -0,0 +1,43 @@ +// db.updateUser() - Update a user + +// Update password +db.updateUser("appUser", { + pwd: "newPassword123" +}) + +// Update roles +db.updateUser("appUser", { + roles: [ + { role: "readWrite", db: "app" }, + { role: "read", db: "reporting" } + ] +}) + +// Update custom data +db.updateUser("appUser", { + customData: { department: "engineering", team: "backend", level: "senior" } +}) + +// Update authentication mechanisms +db.updateUser("secureUser", { + mechanisms: ["SCRAM-SHA-256"] +}) + +// Update authentication restrictions +db.updateUser("restrictedUser", { + authenticationRestrictions: [ + { clientSource: ["10.0.0.0/8"], serverAddress: ["10.0.0.1"] } + ] +}) + +// Update multiple fields +db.updateUser("fullUser", { + pwd: "newSecurePassword", + roles: ["readWrite"], + customData: { updated: true } +}) + +// With write concern +db.updateUser("criticalUser", { + pwd: "verySecurePassword" +}, { w: "majority" }) diff --git a/mongodb/examples/db-version.js b/mongodb/examples/db-version.js new file mode 100644 index 0000000..0d364fc --- /dev/null +++ b/mongodb/examples/db-version.js @@ -0,0 +1,4 @@ +// db.version() - Returns the MongoDB server version + +// Basic usage +db.version() diff --git a/mongodb/examples/db-watch.js b/mongodb/examples/db-watch.js new file mode 100644 index 0000000..5a5f333 --- /dev/null +++ b/mongodb/examples/db-watch.js @@ -0,0 +1,42 @@ +// db.watch() - Open a change stream on the database + +// Basic usage +db.watch() + +// Watch with pipeline +db.watch([ + { $match: { operationType: "insert" } } +]) + +// Watch specific collections +db.watch([ + { $match: { "ns.coll": { $in: ["users", "orders"] } } } +]) + +// Watch for specific operation types +db.watch([ + { $match: { operationType: { $in: ["insert", "update", "delete"] } } } +]) + +// With options +db.watch([], { fullDocument: "updateLookup" }) +db.watch([], { maxAwaitTimeMS: 5000 }) + +// Watch with resume token +db.watch([], { + resumeAfter: { _data: "826..." } +}) + +// Watch with start time +db.watch([], { + startAtOperationTime: Timestamp(1234567890, 1) +}) + +// Combined pipeline and options +db.watch([ + { $match: { operationType: "update" } }, + { $project: { fullDocument: 1, operationType: 1 } } +], { + fullDocument: "updateLookup", + maxAwaitTimeMS: 10000 +}) diff --git a/mongodb/examples/encryption-addKeyAlternateName.js b/mongodb/examples/encryption-addKeyAlternateName.js new file mode 100644 index 0000000..2c8d5ca --- /dev/null +++ b/mongodb/examples/encryption-addKeyAlternateName.js @@ -0,0 +1,10 @@ +// KeyVault.addKeyAlternateName() - Add an alternate name to a data encryption key + +// Add alternate name to key +db.getMongo().getKeyVault().addKeyAlternateName(UUID("12345678-1234-1234-1234-123456789012"), "myKeyAlias") + +// Add another alternate name +db.getMongo().getKeyVault().addKeyAlternateName(UUID("abcd1234-5678-90ab-cdef-123456789012"), "production-key") + +// Add alternate name with special characters +db.getMongo().getKeyVault().addKeyAlternateName(UUID("00000000-0000-0000-0000-000000000001"), "key_v2_backup") diff --git a/mongodb/examples/encryption-createEncryptedCollection.js b/mongodb/examples/encryption-createEncryptedCollection.js new file mode 100644 index 0000000..7ad6ab5 --- /dev/null +++ b/mongodb/examples/encryption-createEncryptedCollection.js @@ -0,0 +1,66 @@ +// ClientEncryption.createEncryptedCollection() - Create a collection with encrypted fields + +// Create encrypted collection with basic configuration +db.getMongo().getClientEncryption().createEncryptedCollection("myDatabase", "myCollection", { + provider: "local", + createCollectionOptions: { + encryptedFields: { + fields: [ + { + path: "ssn", + bsonType: "string", + queries: { queryType: "equality" } + } + ] + } + } +}) + +// Create with AWS KMS +db.getMongo().getClientEncryption().createEncryptedCollection("hr", "employees", { + provider: "aws", + createCollectionOptions: { + encryptedFields: { + fields: [ + { + path: "ssn", + bsonType: "string", + queries: { queryType: "equality" } + }, + { + path: "salary", + bsonType: "int" + } + ] + } + }, + masterKey: { + region: "us-east-1", + key: "arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012" + } +}) + +// Create with multiple encrypted fields +db.getMongo().getClientEncryption().createEncryptedCollection("medical", "patients", { + provider: "local", + createCollectionOptions: { + encryptedFields: { + fields: [ + { + path: "medicalRecordNumber", + bsonType: "string", + queries: { queryType: "equality" } + }, + { + path: "diagnosis", + bsonType: "string" + }, + { + path: "insuranceNumber", + bsonType: "string", + queries: { queryType: "equality" } + } + ] + } + } +}) diff --git a/mongodb/examples/encryption-createKey.js b/mongodb/examples/encryption-createKey.js new file mode 100644 index 0000000..e791514 --- /dev/null +++ b/mongodb/examples/encryption-createKey.js @@ -0,0 +1,33 @@ +// KeyVault.createKey() - Create a new data encryption key + +// Basic key creation with local KMS +db.getMongo().getKeyVault().createKey("local") + +// Key with AWS KMS +db.getMongo().getKeyVault().createKey("aws", { + region: "us-east-1", + key: "arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012" +}) + +// Key with alternate names +db.getMongo().getKeyVault().createKey("local", "", ["myKey", "keyAlias"]) + +// Key with GCP KMS +db.getMongo().getKeyVault().createKey("gcp", { + projectId: "my-project", + location: "us-east1", + keyRing: "my-keyring", + keyName: "my-key" +}) + +// Key with Azure KMS +db.getMongo().getKeyVault().createKey("azure", { + keyVaultEndpoint: "https://my-vault.vault.azure.net", + keyName: "my-key" +}) + +// Key with KMIP provider +db.getMongo().getKeyVault().createKey("kmip") + +// Key with alternate key names array +db.getMongo().getKeyVault().createKey("local", null, ["key1", "key2", "key3"]) diff --git a/mongodb/examples/encryption-decrypt.js b/mongodb/examples/encryption-decrypt.js new file mode 100644 index 0000000..ab3a217 --- /dev/null +++ b/mongodb/examples/encryption-decrypt.js @@ -0,0 +1,10 @@ +// ClientEncryption.decrypt() - Decrypt an encrypted value + +// Decrypt with string representation +db.getMongo().getClientEncryption().decrypt("encryptedBinaryData") + +// Decrypt placeholder encrypted data +db.getMongo().getClientEncryption().decrypt("base64EncodedEncryptedValue") + +// Decrypt another encrypted value +db.getMongo().getClientEncryption().decrypt("anotherEncryptedValue") diff --git a/mongodb/examples/encryption-deleteKey.js b/mongodb/examples/encryption-deleteKey.js new file mode 100644 index 0000000..321de0f --- /dev/null +++ b/mongodb/examples/encryption-deleteKey.js @@ -0,0 +1,10 @@ +// KeyVault.deleteKey() - Delete a data encryption key from the key vault + +// Delete key by UUID +db.getMongo().getKeyVault().deleteKey(UUID("12345678-1234-1234-1234-123456789012")) + +// Delete key with specific UUID +db.getMongo().getKeyVault().deleteKey(UUID("abcd1234-5678-90ab-cdef-123456789012")) + +// Delete key +db.getMongo().getKeyVault().deleteKey(UUID("00000000-0000-0000-0000-000000000001")) diff --git a/mongodb/examples/encryption-encrypt.js b/mongodb/examples/encryption-encrypt.js new file mode 100644 index 0000000..9eec174 --- /dev/null +++ b/mongodb/examples/encryption-encrypt.js @@ -0,0 +1,36 @@ +// ClientEncryption.encrypt() - Encrypt a value using client-side field level encryption + +// Encrypt a string value with deterministic encryption +db.getMongo().getClientEncryption().encrypt( + UUID("12345678-1234-1234-1234-123456789012"), + "sensitive-data", + "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" +) + +// Encrypt with random encryption (default) +db.getMongo().getClientEncryption().encrypt( + UUID("abcd1234-5678-90ab-cdef-123456789012"), + "secret-value", + "AEAD_AES_256_CBC_HMAC_SHA_512-Random" +) + +// Encrypt a number +db.getMongo().getClientEncryption().encrypt( + UUID("12345678-1234-1234-1234-123456789012"), + 123456789, + "AEAD_AES_256_CBC_HMAC_SHA_512-Random" +) + +// Encrypt with options document +db.getMongo().getClientEncryption().encrypt( + UUID("12345678-1234-1234-1234-123456789012"), + { ssn: "123-45-6789" }, + "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" +) + +// Encrypt using key alternate name +db.getMongo().getClientEncryption().encrypt( + "myDataKey", + "confidential", + "AEAD_AES_256_CBC_HMAC_SHA_512-Random" +) diff --git a/mongodb/examples/encryption-encryptExpression.js b/mongodb/examples/encryption-encryptExpression.js new file mode 100644 index 0000000..74321e5 --- /dev/null +++ b/mongodb/examples/encryption-encryptExpression.js @@ -0,0 +1,30 @@ +// ClientEncryption.encryptExpression() - Encrypt a match expression for queryable encryption + +// Encrypt a simple equality expression +db.getMongo().getClientEncryption().encryptExpression( + UUID("12345678-1234-1234-1234-123456789012"), + { $and: [{ ssn: { $eq: "123-45-6789" } }] } +) + +// Encrypt expression with range query +db.getMongo().getClientEncryption().encryptExpression( + UUID("abcd1234-5678-90ab-cdef-123456789012"), + { $and: [{ salary: { $gte: 50000, $lte: 100000 } }] } +) + +// Encrypt expression for encrypted field search +db.getMongo().getClientEncryption().encryptExpression( + UUID("12345678-1234-1234-1234-123456789012"), + { $and: [{ medicalRecordNumber: "MRN-12345" }] } +) + +// Encrypt complex expression +db.getMongo().getClientEncryption().encryptExpression( + UUID("12345678-1234-1234-1234-123456789012"), + { + $and: [ + { ssn: { $eq: "123-45-6789" } }, + { status: "active" } + ] + } +) diff --git a/mongodb/examples/encryption-getClientEncryption.js b/mongodb/examples/encryption-getClientEncryption.js new file mode 100644 index 0000000..383695a --- /dev/null +++ b/mongodb/examples/encryption-getClientEncryption.js @@ -0,0 +1,10 @@ +// ClientEncryption.getClientEncryption() - Get the ClientEncryption object for field-level encryption + +// Get the ClientEncryption object from the current connection +db.getMongo().getClientEncryption() + +// Chain with encryption methods +db.getMongo().getClientEncryption().encrypt(UUID("12345678-1234-1234-1234-123456789012"), "sensitiveData", "AEAD_AES_256_CBC_HMAC_SHA_512-Random") + +// Get ClientEncryption for various operations +db.getMongo().getClientEncryption().decrypt("encryptedValue") diff --git a/mongodb/examples/encryption-getKey.js b/mongodb/examples/encryption-getKey.js new file mode 100644 index 0000000..056d384 --- /dev/null +++ b/mongodb/examples/encryption-getKey.js @@ -0,0 +1,10 @@ +// KeyVault.getKey() - Get a specific data encryption key by its UUID + +// Get key by UUID +db.getMongo().getKeyVault().getKey(UUID("12345678-1234-1234-1234-123456789012")) + +// Get key with string UUID +db.getMongo().getKeyVault().getKey(UUID("abcd1234-5678-90ab-cdef-123456789012")) + +// Get key and convert to document +db.getMongo().getKeyVault().getKey(UUID("00000000-0000-0000-0000-000000000001")) diff --git a/mongodb/examples/encryption-getKeyByAltName.js b/mongodb/examples/encryption-getKeyByAltName.js new file mode 100644 index 0000000..e7a0d38 --- /dev/null +++ b/mongodb/examples/encryption-getKeyByAltName.js @@ -0,0 +1,13 @@ +// KeyVault.getKeyByAltName() - Get a data encryption key by its alternate name + +// Get key by alternate name +db.getMongo().getKeyVault().getKeyByAltName("myKeyAlias") + +// Get key by production name +db.getMongo().getKeyVault().getKeyByAltName("production-key") + +// Get key by backup name +db.getMongo().getKeyVault().getKeyByAltName("backup-key") + +// Get key with underscore name +db.getMongo().getKeyVault().getKeyByAltName("data_encryption_key_v1") diff --git a/mongodb/examples/encryption-getKeyVault.js b/mongodb/examples/encryption-getKeyVault.js new file mode 100644 index 0000000..2dc6e74 --- /dev/null +++ b/mongodb/examples/encryption-getKeyVault.js @@ -0,0 +1,10 @@ +// KeyVault.getKeyVault() - Get the KeyVault object for encryption key management + +// Get the KeyVault object from the current connection +db.getMongo().getKeyVault() + +// Chain with other KeyVault methods +db.getMongo().getKeyVault().getKeys() + +// Get KeyVault and list all keys +db.getMongo().getKeyVault().getKeys().toArray() diff --git a/mongodb/examples/encryption-getKeys.js b/mongodb/examples/encryption-getKeys.js new file mode 100644 index 0000000..994c6b7 --- /dev/null +++ b/mongodb/examples/encryption-getKeys.js @@ -0,0 +1,10 @@ +// KeyVault.getKeys() - Get all data encryption keys in the key vault + +// Get all keys +db.getMongo().getKeyVault().getKeys() + +// Get keys and convert to array +db.getMongo().getKeyVault().getKeys().toArray() + +// Count all keys +db.getMongo().getKeyVault().getKeys().count() diff --git a/mongodb/examples/encryption-removeKeyAlternateName.js b/mongodb/examples/encryption-removeKeyAlternateName.js new file mode 100644 index 0000000..60941f9 --- /dev/null +++ b/mongodb/examples/encryption-removeKeyAlternateName.js @@ -0,0 +1,10 @@ +// KeyVault.removeKeyAlternateName() - Remove an alternate name from a data encryption key + +// Remove alternate name from key +db.getMongo().getKeyVault().removeKeyAlternateName(UUID("12345678-1234-1234-1234-123456789012"), "myKeyAlias") + +// Remove alternate name +db.getMongo().getKeyVault().removeKeyAlternateName(UUID("abcd1234-5678-90ab-cdef-123456789012"), "old-key-name") + +// Remove alternate name +db.getMongo().getKeyVault().removeKeyAlternateName(UUID("00000000-0000-0000-0000-000000000001"), "deprecated-alias") diff --git a/mongodb/examples/encryption-rewrapManyDataKey.js b/mongodb/examples/encryption-rewrapManyDataKey.js new file mode 100644 index 0000000..780e46f --- /dev/null +++ b/mongodb/examples/encryption-rewrapManyDataKey.js @@ -0,0 +1,36 @@ +// KeyVault.rewrapManyDataKey() - Rewrap (re-encrypt) multiple data encryption keys + +// Rewrap all keys with no filter +db.getMongo().getKeyVault().rewrapManyDataKey({}) + +// Rewrap keys matching a filter +db.getMongo().getKeyVault().rewrapManyDataKey({ masterKey: { provider: "aws" } }) + +// Rewrap with new master key +db.getMongo().getKeyVault().rewrapManyDataKey({}, { + provider: "aws", + masterKey: { + region: "us-east-1", + key: "arn:aws:kms:us-east-1:123456789012:key/new-key-id" + } +}) + +// Rewrap keys from one provider to another +db.getMongo().getKeyVault().rewrapManyDataKey({ "masterKey.provider": "local" }, { + provider: "gcp", + masterKey: { + projectId: "my-project", + location: "us-east1", + keyRing: "my-keyring", + keyName: "my-key" + } +}) + +// Rewrap with Azure KMS +db.getMongo().getKeyVault().rewrapManyDataKey({ keyAltNames: "production" }, { + provider: "azure", + masterKey: { + keyVaultEndpoint: "https://my-vault.vault.azure.net", + keyName: "new-master-key" + } +}) diff --git a/mongodb/examples/native-cat.js b/mongodb/examples/native-cat.js new file mode 100644 index 0000000..f35cae6 --- /dev/null +++ b/mongodb/examples/native-cat.js @@ -0,0 +1,11 @@ +// cat() - Display the contents of a file + +// Display file contents +cat("config.json") +cat("/path/to/file.txt") +cat("scripts/setup.js") + +// Display multiple files +cat("file1.txt") +cat("file2.txt") +cat("logs/app.log") diff --git a/mongodb/examples/native-cd.js b/mongodb/examples/native-cd.js new file mode 100644 index 0000000..11f618b --- /dev/null +++ b/mongodb/examples/native-cd.js @@ -0,0 +1,10 @@ +// cd() - Change the current working directory + +// Change to a directory +cd("/tmp") +cd("/home/user") +cd("scripts") + +// Change to home directory +cd("~") +cd("/var/log") diff --git a/mongodb/examples/native-getHostName.js b/mongodb/examples/native-getHostName.js new file mode 100644 index 0000000..9943df1 --- /dev/null +++ b/mongodb/examples/native-getHostName.js @@ -0,0 +1,4 @@ +// getHostName() - Returns the hostname of the system + +// Get system hostname +getHostName() diff --git a/mongodb/examples/native-getMemInfo.js b/mongodb/examples/native-getMemInfo.js new file mode 100644 index 0000000..a006199 --- /dev/null +++ b/mongodb/examples/native-getMemInfo.js @@ -0,0 +1,4 @@ +// getMemInfo() - Returns memory usage information + +// Get memory info +getMemInfo() diff --git a/mongodb/examples/native-hostname.js b/mongodb/examples/native-hostname.js new file mode 100644 index 0000000..ee33714 --- /dev/null +++ b/mongodb/examples/native-hostname.js @@ -0,0 +1,4 @@ +// hostname() - Returns the hostname of the system + +// Get system hostname +hostname() diff --git a/mongodb/examples/native-isInteractive.js b/mongodb/examples/native-isInteractive.js new file mode 100644 index 0000000..b9bc51a --- /dev/null +++ b/mongodb/examples/native-isInteractive.js @@ -0,0 +1,4 @@ +// isInteractive() - Returns whether the shell is running in interactive mode + +// Check if interactive +isInteractive() diff --git a/mongodb/examples/native-listFiles.js b/mongodb/examples/native-listFiles.js new file mode 100644 index 0000000..d8acaf3 --- /dev/null +++ b/mongodb/examples/native-listFiles.js @@ -0,0 +1,9 @@ +// listFiles() - Returns an array of files in a directory + +// List files in current directory +listFiles() + +// List files in specific directory +listFiles("/tmp") +listFiles("/home/user/scripts") +listFiles(".") diff --git a/mongodb/examples/native-load.js b/mongodb/examples/native-load.js new file mode 100644 index 0000000..9e0119e --- /dev/null +++ b/mongodb/examples/native-load.js @@ -0,0 +1,10 @@ +// load() - Load and execute a JavaScript file + +// Load a script +load("scripts/init.js") +load("/path/to/script.js") + +// Load multiple scripts +load("script1.js") +load("script2.js") +load("lib/helpers.js") diff --git a/mongodb/examples/native-ls.js b/mongodb/examples/native-ls.js new file mode 100644 index 0000000..7da1da1 --- /dev/null +++ b/mongodb/examples/native-ls.js @@ -0,0 +1,9 @@ +// ls() - List contents of a directory + +// List current directory +ls() + +// List specific directory +ls("/tmp") +ls("/home/user") +ls("scripts") diff --git a/mongodb/examples/native-md5sumFile.js b/mongodb/examples/native-md5sumFile.js new file mode 100644 index 0000000..58c375c --- /dev/null +++ b/mongodb/examples/native-md5sumFile.js @@ -0,0 +1,6 @@ +// md5sumFile() - Returns the MD5 checksum of a file + +// Get MD5 checksum +md5sumFile("data.json") +md5sumFile("/path/to/file.bin") +md5sumFile("backup/dump.bson") diff --git a/mongodb/examples/native-mkdir.js b/mongodb/examples/native-mkdir.js new file mode 100644 index 0000000..a54c8e0 --- /dev/null +++ b/mongodb/examples/native-mkdir.js @@ -0,0 +1,6 @@ +// mkdir() - Create a directory + +// Create a directory +mkdir("backup") +mkdir("/tmp/mongodb") +mkdir("logs/daily") diff --git a/mongodb/examples/native-pwd.js b/mongodb/examples/native-pwd.js new file mode 100644 index 0000000..7759801 --- /dev/null +++ b/mongodb/examples/native-pwd.js @@ -0,0 +1,4 @@ +// pwd() - Print the current working directory + +// Get current directory +pwd() diff --git a/mongodb/examples/native-quit.js b/mongodb/examples/native-quit.js new file mode 100644 index 0000000..b8d1a9f --- /dev/null +++ b/mongodb/examples/native-quit.js @@ -0,0 +1,8 @@ +// quit() - Exit the shell + +// Basic quit +quit() + +// Quit with exit code +quit(0) +quit(1) diff --git a/mongodb/examples/native-removeFile.js b/mongodb/examples/native-removeFile.js new file mode 100644 index 0000000..b2e8668 --- /dev/null +++ b/mongodb/examples/native-removeFile.js @@ -0,0 +1,6 @@ +// removeFile() - Delete a file + +// Remove a file +removeFile("temp.json") +removeFile("/tmp/output.txt") +removeFile("logs/old.log") diff --git a/mongodb/examples/native-sleep.js b/mongodb/examples/native-sleep.js new file mode 100644 index 0000000..fc1c2c0 --- /dev/null +++ b/mongodb/examples/native-sleep.js @@ -0,0 +1,7 @@ +// sleep() - Pause execution for a specified number of milliseconds + +// Sleep for various durations +sleep(1000) +sleep(5000) +sleep(100) +sleep(60000) diff --git a/mongodb/examples/native-version.js b/mongodb/examples/native-version.js new file mode 100644 index 0000000..7a37779 --- /dev/null +++ b/mongodb/examples/native-version.js @@ -0,0 +1,4 @@ +// version() - Returns the version of the MongoDB shell + +// Get version +version() diff --git a/mongodb/examples/objectConstructor-BSONRegExp.js b/mongodb/examples/objectConstructor-BSONRegExp.js new file mode 100644 index 0000000..afb119a --- /dev/null +++ b/mongodb/examples/objectConstructor-BSONRegExp.js @@ -0,0 +1,47 @@ +// BSONRegExp() - Create BSON regular expression + +// Basic usage with pattern only +BSONRegExp("pattern") + +// With flags +BSONRegExp("pattern", "i") +BSONRegExp("pattern", "im") +BSONRegExp("pattern", "imxs") + +// In document +db.rules.insertOne({ + name: "email_validation", + pattern: BSONRegExp("^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", "i") +}) + +// In query - match documents with specific regex pattern +db.rules.find({ + pattern: BSONRegExp("pattern", "i") +}) + +// Complex patterns +db.validations.insertMany([ + { name: "phone", regex: BSONRegExp("^\\+?[1-9]\\d{1,14}$") }, + { name: "url", regex: BSONRegExp("^https?://", "i") }, + { name: "ipv4", regex: BSONRegExp("^(?:[0-9]{1,3}\\.){3}[0-9]{1,3}$") }, + { name: "hex_color", regex: BSONRegExp("^#[0-9A-Fa-f]{6}$", "i") } +]) + +// Using in aggregation pipeline +db.logs.aggregate([ + { + $match: { + message: { $regex: BSONRegExp("error", "i") } + } + } +]) + +// Various flag combinations +db.patterns.insertMany([ + { flags: "none", pattern: BSONRegExp("test") }, + { flags: "case_insensitive", pattern: BSONRegExp("test", "i") }, + { flags: "multiline", pattern: BSONRegExp("^line", "m") }, + { flags: "dotall", pattern: BSONRegExp(".*", "s") }, + { flags: "extended", pattern: BSONRegExp("test", "x") }, + { flags: "combined", pattern: BSONRegExp("test", "imsx") } +]) diff --git a/mongodb/examples/objectConstructor-BinData.js b/mongodb/examples/objectConstructor-BinData.js new file mode 100644 index 0000000..f5d7784 --- /dev/null +++ b/mongodb/examples/objectConstructor-BinData.js @@ -0,0 +1,36 @@ +// BinData() - Create binary data with subtype + +// Basic usage - subtype 0 (generic binary) +BinData(0, "SGVsbG8gV29ybGQh") + +// UUID subtype (4) +BinData(4, "JDQ3MjA3M2Q0LTJhOTMtNGUxNy1hNzYyLTlkMTI0NWE5ZDRjMQ==") + +// MD5 digest subtype (5) +BinData(5, "d41d8cd98f00b204e9800998ecf8427e") + +// User-defined binary (128) +BinData(128, "Y3VzdG9tIGJpbmFyeQ==") + +// In document +db.files.insertOne({ + name: "attachment.pdf", + data: BinData(0, "JVBERi0xLjQKJcOkw7zDtsOf...") +}) + +// In query +db.files.find({ + data: BinData(0, "SGVsbG8gV29ybGQh") +}) + +// Various subtypes +db.binaries.insertMany([ + { type: "generic", data: BinData(0, "Z2VuZXJpYw==") }, + { type: "function", data: BinData(1, "ZnVuY3Rpb24=") }, + { type: "old_binary", data: BinData(2, "b2xk") }, + { type: "uuid_old", data: BinData(3, "dXVpZC1vbGQ=") }, + { type: "uuid", data: BinData(4, "dXVpZA==") }, + { type: "md5", data: BinData(5, "bWQ1") }, + { type: "encrypted", data: BinData(6, "ZW5jcnlwdGVk") }, + { type: "user_defined", data: BinData(128, "dXNlcg==") } +]) diff --git a/mongodb/examples/objectConstructor-Binary.js b/mongodb/examples/objectConstructor-Binary.js new file mode 100644 index 0000000..4190c12 --- /dev/null +++ b/mongodb/examples/objectConstructor-Binary.js @@ -0,0 +1,60 @@ +// Binary() - Create binary data (BSON Binary type) + +// In document - basic usage with base64 string +db.files.insertOne({ + name: "document.bin", + content: Binary("Y29udGVudA==") +}) + +// In query +db.files.find({ + content: Binary("Y29udGVudA==") +}) + +// Binary with subtype +db.files.insertOne({ + data: Binary("SGVsbG8gV29ybGQh", 0) +}) + +// With different subtypes +db.binaries.insertMany([ + { type: "generic", data: Binary("Z2VuZXJpYw==", 0) }, + { type: "uuid", data: Binary("dXVpZA==", 4) }, + { type: "md5", data: Binary("bWQ1", 5) } +]) + +// Using Binary.createFromBase64() static method +db.files.insertOne({ + fromBase64: Binary.createFromBase64("SGVsbG8=") +}) + +// Binary.createFromBase64() with subtype +db.files.insertOne({ + fromBase64: Binary.createFromBase64("SGVsbG8=", 0) +}) + +// Using Binary.createFromHexString() static method +db.files.insertOne({ + fromHex: Binary.createFromHexString("48656c6c6f") +}) + +// Binary.createFromHexString() with subtype +db.files.insertOne({ + fromHex: Binary.createFromHexString("48656c6c6f", 0) +}) + +// Using all static methods in a single document +db.files.insertOne({ + direct: Binary("Y29udGVudA=="), + fromBase64: Binary.createFromBase64("SGVsbG8="), + fromHex: Binary.createFromHexString("48656c6c6f") +}) + +// In aggregation pipeline +db.files.aggregate([ + { + $match: { + data: Binary("dGVzdA==") + } + } +]) diff --git a/mongodb/examples/objectConstructor-HexData.js b/mongodb/examples/objectConstructor-HexData.js new file mode 100644 index 0000000..ab64199 --- /dev/null +++ b/mongodb/examples/objectConstructor-HexData.js @@ -0,0 +1,42 @@ +// HexData() - Create binary data from hex string with subtype + +// Basic usage - subtype 0 (generic binary) +HexData(0, "48656c6c6f20576f726c6421") + +// UUID subtype (4) +HexData(4, "550e8400e29b41d4a716446655440000") + +// MD5 digest subtype (5) +HexData(5, "d41d8cd98f00b204e9800998ecf8427e") + +// User-defined binary (128) +HexData(128, "637573746f6d2062696e617279") + +// In document +db.files.insertOne({ + name: "checksum.txt", + md5: HexData(5, "d41d8cd98f00b204e9800998ecf8427e") +}) + +// In query +db.files.find({ + md5: HexData(5, "d41d8cd98f00b204e9800998ecf8427e") +}) + +// Various subtypes with hex data +db.hexdata.insertMany([ + { type: "generic", data: HexData(0, "67656e65726963") }, + { type: "function", data: HexData(1, "66756e6374696f6e") }, + { type: "old_binary", data: HexData(2, "6f6c64") }, + { type: "uuid_old", data: HexData(3, "757569642d6f6c64") }, + { type: "uuid", data: HexData(4, "75756964") }, + { type: "md5", data: HexData(5, "6d6435") }, + { type: "encrypted", data: HexData(6, "656e63727970746564") }, + { type: "user_defined", data: HexData(128, "75736572") } +]) + +// Storing binary hashes +db.hashes.insertOne({ + algorithm: "sha256", + hash: HexData(0, "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855") +}) diff --git a/mongodb/examples/plancache-clear.js b/mongodb/examples/plancache-clear.js new file mode 100644 index 0000000..dea66fe --- /dev/null +++ b/mongodb/examples/plancache-clear.js @@ -0,0 +1,13 @@ +// db.collection.getPlanCache().clear() - Clear all cached query plans for a collection + +// Basic usage +db.users.getPlanCache().clear() + +// With collection access patterns +db["users"].getPlanCache().clear() +db.getCollection("users").getPlanCache().clear() + +// Different collections +db.orders.getPlanCache().clear() +db.products.getPlanCache().clear() +db.sessions.getPlanCache().clear() diff --git a/mongodb/examples/plancache-clearPlansByQuery.js b/mongodb/examples/plancache-clearPlansByQuery.js new file mode 100644 index 0000000..ac24902 --- /dev/null +++ b/mongodb/examples/plancache-clearPlansByQuery.js @@ -0,0 +1,26 @@ +// db.collection.getPlanCache().clearPlansByQuery() - Clear cached plans for a specific query shape + +// Clear by query shape +db.users.getPlanCache().clearPlansByQuery({ status: "active" }) + +// Clear with projection and sort +db.users.getPlanCache().clearPlansByQuery({ status: "active" }, { name: 1 }, { age: -1 }) + +// Clear with only query and projection +db.orders.getPlanCache().clearPlansByQuery({ customer: "alice" }, { total: 1 }) + +// Collection access patterns +db["orders"].getPlanCache().clearPlansByQuery({ customer: "alice" }) +db.getCollection("products").getPlanCache().clearPlansByQuery({ category: "electronics" }) + +// Complex query shapes +db.users.getPlanCache().clearPlansByQuery({ + status: "active", + age: { $gte: 18 } +}) + +db.orders.getPlanCache().clearPlansByQuery( + { status: "pending", total: { $gt: 100 } }, + { _id: 0, orderId: 1, total: 1 }, + { createdAt: -1 } +) diff --git a/mongodb/examples/plancache-getPlanCache.js b/mongodb/examples/plancache-getPlanCache.js new file mode 100644 index 0000000..3907736 --- /dev/null +++ b/mongodb/examples/plancache-getPlanCache.js @@ -0,0 +1,13 @@ +// db.collection.getPlanCache() - Get the plan cache object for a collection + +// Basic usage - get the plan cache object +db.users.getPlanCache() + +// With collection access patterns +db["users"].getPlanCache() +db.getCollection("users").getPlanCache() + +// Different collection names +db.orders.getPlanCache() +db.products.getPlanCache() +db.customers.getPlanCache() diff --git a/mongodb/examples/plancache-help.js b/mongodb/examples/plancache-help.js new file mode 100644 index 0000000..b60d99d --- /dev/null +++ b/mongodb/examples/plancache-help.js @@ -0,0 +1,12 @@ +// db.collection.getPlanCache().help() - Display help information for plan cache methods + +// Basic usage +db.users.getPlanCache().help() + +// With collection access patterns +db["users"].getPlanCache().help() +db.getCollection("users").getPlanCache().help() + +// Different collections +db.orders.getPlanCache().help() +db.products.getPlanCache().help() diff --git a/mongodb/examples/plancache-list.js b/mongodb/examples/plancache-list.js new file mode 100644 index 0000000..c29bd07 --- /dev/null +++ b/mongodb/examples/plancache-list.js @@ -0,0 +1,24 @@ +// db.collection.getPlanCache().list() - List query plan cache entries + +// Basic usage +db.users.getPlanCache().list() + +// With collection access patterns +db["users"].getPlanCache().list() +db.getCollection("users").getPlanCache().list() + +// Different collections +db.orders.getPlanCache().list() +db.products.getPlanCache().list() + +// With options (pipeline stages) +db.users.getPlanCache().list([{ $match: { isActive: true } }]) + +db.orders.getPlanCache().list([ + { $match: { planCacheKey: "abc123" } } +]) + +// List with projection +db.users.getPlanCache().list([ + { $project: { queryHash: 1, planCacheKey: 1 } } +]) diff --git a/mongodb/examples/rs-add.js b/mongodb/examples/rs-add.js new file mode 100644 index 0000000..b7c5d22 --- /dev/null +++ b/mongodb/examples/rs-add.js @@ -0,0 +1,27 @@ +// rs.add() - Add a member to the replica set + +// Add member by hostname +rs.add("mongo4:27017") + +// Add member with options document +rs.add({ host: "mongo4:27017" }) + +// Add member with priority +rs.add({ host: "mongo4:27017", priority: 0 }) + +// Add member as hidden +rs.add({ host: "mongo4:27017", hidden: true, priority: 0 }) + +// Add member with votes +rs.add({ host: "mongo4:27017", votes: 0, priority: 0 }) + +// Add member with build indexes disabled +rs.add({ host: "mongo4:27017", buildIndexes: false, priority: 0 }) + +// Add delayed member +rs.add({ + host: "mongo4:27017", + priority: 0, + hidden: true, + secondaryDelaySecs: 3600 +}) diff --git a/mongodb/examples/rs-addArb.js b/mongodb/examples/rs-addArb.js new file mode 100644 index 0000000..6699c57 --- /dev/null +++ b/mongodb/examples/rs-addArb.js @@ -0,0 +1,7 @@ +// rs.addArb() - Add an arbiter to the replica set + +// Add arbiter by hostname +rs.addArb("arbiter:27017") + +// Add arbiter with full hostname and port +rs.addArb("arbiter.example.com:27017") diff --git a/mongodb/examples/rs-conf.js b/mongodb/examples/rs-conf.js new file mode 100644 index 0000000..af7824a --- /dev/null +++ b/mongodb/examples/rs-conf.js @@ -0,0 +1,4 @@ +// rs.conf() - Get replica set configuration (alias for rs.config()) + +// Basic usage +rs.conf() diff --git a/mongodb/examples/rs-config.js b/mongodb/examples/rs-config.js new file mode 100644 index 0000000..632af6c --- /dev/null +++ b/mongodb/examples/rs-config.js @@ -0,0 +1,4 @@ +// rs.config() - Get replica set configuration + +// Basic usage +rs.config() diff --git a/mongodb/examples/rs-freeze.js b/mongodb/examples/rs-freeze.js new file mode 100644 index 0000000..c416e3e --- /dev/null +++ b/mongodb/examples/rs-freeze.js @@ -0,0 +1,10 @@ +// rs.freeze() - Prevent a secondary from becoming primary for a period of time + +// Freeze for 120 seconds +rs.freeze(120) + +// Freeze for 0 seconds (unfreeze immediately) +rs.freeze(0) + +// Freeze for 1 hour +rs.freeze(3600) diff --git a/mongodb/examples/rs-hello.js b/mongodb/examples/rs-hello.js new file mode 100644 index 0000000..5aea5ff --- /dev/null +++ b/mongodb/examples/rs-hello.js @@ -0,0 +1,4 @@ +// rs.hello() - Returns replica set hello information + +// Basic usage +rs.hello() diff --git a/mongodb/examples/rs-help.js b/mongodb/examples/rs-help.js new file mode 100644 index 0000000..fabff8d --- /dev/null +++ b/mongodb/examples/rs-help.js @@ -0,0 +1,4 @@ +// rs.help() - Display replica set helper methods + +// Basic usage +rs.help() diff --git a/mongodb/examples/rs-initiate.js b/mongodb/examples/rs-initiate.js new file mode 100644 index 0000000..9c602aa --- /dev/null +++ b/mongodb/examples/rs-initiate.js @@ -0,0 +1,34 @@ +// rs.initiate() - Initialize replica set + +// No config (auto-initiate single node) +rs.initiate() + +// With configuration +rs.initiate({ + _id: "myReplicaSet", + members: [ + { _id: 0, host: "mongo1:27017" }, + { _id: 1, host: "mongo2:27017" }, + { _id: 2, host: "mongo3:27017" } + ] +}) + +// With configuration including priority and votes +rs.initiate({ + _id: "rs0", + members: [ + { _id: 0, host: "primary:27017", priority: 2 }, + { _id: 1, host: "secondary1:27017", priority: 1 }, + { _id: 2, host: "secondary2:27017", priority: 1, votes: 1 } + ] +}) + +// With arbiter configuration +rs.initiate({ + _id: "rs0", + members: [ + { _id: 0, host: "mongo1:27017" }, + { _id: 1, host: "mongo2:27017" }, + { _id: 2, host: "arbiter:27017", arbiterOnly: true } + ] +}) diff --git a/mongodb/examples/rs-isMaster.js b/mongodb/examples/rs-isMaster.js new file mode 100644 index 0000000..46e3d86 --- /dev/null +++ b/mongodb/examples/rs-isMaster.js @@ -0,0 +1,4 @@ +// rs.isMaster() - Returns replica set isMaster information (deprecated, use rs.hello()) + +// Basic usage +rs.isMaster() diff --git a/mongodb/examples/rs-printReplicationInfo.js b/mongodb/examples/rs-printReplicationInfo.js new file mode 100644 index 0000000..7dc7748 --- /dev/null +++ b/mongodb/examples/rs-printReplicationInfo.js @@ -0,0 +1,4 @@ +// rs.printReplicationInfo() - Print oplog information from the primary + +// Basic usage +rs.printReplicationInfo() diff --git a/mongodb/examples/rs-printSecondaryReplicationInfo.js b/mongodb/examples/rs-printSecondaryReplicationInfo.js new file mode 100644 index 0000000..ec6d5de --- /dev/null +++ b/mongodb/examples/rs-printSecondaryReplicationInfo.js @@ -0,0 +1,4 @@ +// rs.printSecondaryReplicationInfo() - Print secondary members replication info + +// Basic usage +rs.printSecondaryReplicationInfo() diff --git a/mongodb/examples/rs-reconfig.js b/mongodb/examples/rs-reconfig.js new file mode 100644 index 0000000..843472b --- /dev/null +++ b/mongodb/examples/rs-reconfig.js @@ -0,0 +1,44 @@ +// rs.reconfig() - Reconfigure the replica set + +// Basic reconfig with new configuration +rs.reconfig({ + _id: "rs0", + version: 2, + members: [ + { _id: 0, host: "mongo1:27017" }, + { _id: 1, host: "mongo2:27017" }, + { _id: 2, host: "mongo3:27017" } + ] +}) + +// Reconfig with force option +rs.reconfig({ + _id: "rs0", + version: 3, + members: [ + { _id: 0, host: "mongo1:27017" }, + { _id: 1, host: "mongo2:27017" } + ] +}, { force: true }) + +// Reconfig changing member priority +rs.reconfig({ + _id: "rs0", + version: 4, + members: [ + { _id: 0, host: "mongo1:27017", priority: 2 }, + { _id: 1, host: "mongo2:27017", priority: 1 }, + { _id: 2, host: "mongo3:27017", priority: 0 } + ] +}) + +// Reconfig adding hidden member +rs.reconfig({ + _id: "rs0", + version: 5, + members: [ + { _id: 0, host: "mongo1:27017" }, + { _id: 1, host: "mongo2:27017" }, + { _id: 2, host: "mongo3:27017", hidden: true, priority: 0 } + ] +}) diff --git a/mongodb/examples/rs-remove.js b/mongodb/examples/rs-remove.js new file mode 100644 index 0000000..ce0b040 --- /dev/null +++ b/mongodb/examples/rs-remove.js @@ -0,0 +1,7 @@ +// rs.remove() - Remove a member from the replica set + +// Remove member by hostname +rs.remove("mongo4:27017") + +// Remove member with full hostname +rs.remove("mongo4.example.com:27017") diff --git a/mongodb/examples/rs-status.js b/mongodb/examples/rs-status.js new file mode 100644 index 0000000..8aae3eb --- /dev/null +++ b/mongodb/examples/rs-status.js @@ -0,0 +1,7 @@ +// rs.status() - Get replica set status + +// Basic usage +rs.status() + +// With options +rs.status({ initialSync: 1 }) diff --git a/mongodb/examples/sh-abortReshardCollection.js b/mongodb/examples/sh-abortReshardCollection.js new file mode 100644 index 0000000..a62ba5e --- /dev/null +++ b/mongodb/examples/sh-abortReshardCollection.js @@ -0,0 +1,7 @@ +// sh.abortReshardCollection() - Abort an in-progress resharding operation + +// Basic usage +sh.abortReshardCollection("mydb.users") + +// Abort resharding for specific namespace +sh.abortReshardCollection("test.orders") diff --git a/mongodb/examples/sh-addShard.js b/mongodb/examples/sh-addShard.js new file mode 100644 index 0000000..3387fc7 --- /dev/null +++ b/mongodb/examples/sh-addShard.js @@ -0,0 +1,13 @@ +// sh.addShard() - Add a shard to a sharded cluster + +// Add a standalone mongod +sh.addShard("hostname:27017") + +// Add a replica set shard +sh.addShard("rs0/hostname1:27017,hostname2:27017,hostname3:27017") + +// Add with replica set name prefix +sh.addShard("shard0001/mongodb0.example.net:27017") + +// Add multiple hosts for replica set +sh.addShard("rs1/host1:27017,host2:27017") diff --git a/mongodb/examples/sh-addShardTag.js b/mongodb/examples/sh-addShardTag.js new file mode 100644 index 0000000..3841728 --- /dev/null +++ b/mongodb/examples/sh-addShardTag.js @@ -0,0 +1,11 @@ +// sh.addShardTag() - Associate a tag with a shard (deprecated, use addShardToZone) + +// Basic usage +sh.addShardTag("shard0000", "NYC") + +// Add tag for geographic distribution +sh.addShardTag("shard0001", "LAX") + +// Add multiple tags to same shard +sh.addShardTag("shard0002", "EU") +sh.addShardTag("shard0002", "EMEA") diff --git a/mongodb/examples/sh-addShardToZone.js b/mongodb/examples/sh-addShardToZone.js new file mode 100644 index 0000000..b4e0928 --- /dev/null +++ b/mongodb/examples/sh-addShardToZone.js @@ -0,0 +1,14 @@ +// sh.addShardToZone() - Associate a shard with a zone + +// Basic usage +sh.addShardToZone("shard0000", "NYC") + +// Add shard to geographic zone +sh.addShardToZone("shard0001", "EU-WEST") + +// Add shard to data center zone +sh.addShardToZone("shard0002", "DC1") + +// Multiple shards in same zone +sh.addShardToZone("shard0003", "US-EAST") +sh.addShardToZone("shard0004", "US-EAST") diff --git a/mongodb/examples/sh-addTagRange.js b/mongodb/examples/sh-addTagRange.js new file mode 100644 index 0000000..e4b2052 --- /dev/null +++ b/mongodb/examples/sh-addTagRange.js @@ -0,0 +1,15 @@ +// sh.addTagRange() - Associate a range of shard key values with a tag (deprecated, use updateZoneKeyRange) + +// Basic usage with numeric range +sh.addTagRange("mydb.users", { zipcode: "10001" }, { zipcode: "10099" }, "NYC") + +// Range with MinKey/MaxKey +sh.addTagRange("mydb.orders", { region: "A" }, { region: "M" }, "REGION_A_M") + +// Compound shard key range +sh.addTagRange( + "mydb.events", + { date: ISODate("2024-01-01"), region: "US" }, + { date: ISODate("2024-12-31"), region: "US" }, + "US_2024" +) diff --git a/mongodb/examples/sh-analyzeShardKey.js b/mongodb/examples/sh-analyzeShardKey.js new file mode 100644 index 0000000..37378d3 --- /dev/null +++ b/mongodb/examples/sh-analyzeShardKey.js @@ -0,0 +1,13 @@ +// sh.analyzeShardKey() - Analyze a potential shard key + +// Basic usage +sh.analyzeShardKey("mydb.users", { email: 1 }) + +// Analyze hashed key +sh.analyzeShardKey("mydb.orders", { orderId: "hashed" }) + +// Analyze compound key +sh.analyzeShardKey("mydb.events", { region: 1, timestamp: 1 }) + +// With options +sh.analyzeShardKey("mydb.logs", { deviceId: 1 }, { sampleRate: 0.5 }) diff --git a/mongodb/examples/sh-balancerCollectionStatus.js b/mongodb/examples/sh-balancerCollectionStatus.js new file mode 100644 index 0000000..4e4d939 --- /dev/null +++ b/mongodb/examples/sh-balancerCollectionStatus.js @@ -0,0 +1,10 @@ +// sh.balancerCollectionStatus() - Get balancer status for a specific collection + +// Basic usage +sh.balancerCollectionStatus("mydb.users") + +// Check status for sharded collection +sh.balancerCollectionStatus("test.orders") + +// Namespace with dot notation +sh.balancerCollectionStatus("analytics.events") diff --git a/mongodb/examples/sh-checkMetadataConsistency.js b/mongodb/examples/sh-checkMetadataConsistency.js new file mode 100644 index 0000000..3c7628b --- /dev/null +++ b/mongodb/examples/sh-checkMetadataConsistency.js @@ -0,0 +1,7 @@ +// sh.checkMetadataConsistency() - Check metadata consistency + +// Basic usage (no arguments) +sh.checkMetadataConsistency() + +// With options +sh.checkMetadataConsistency({ checkIndexes: true }) diff --git a/mongodb/examples/sh-clearBalancerWindow.js b/mongodb/examples/sh-clearBalancerWindow.js new file mode 100644 index 0000000..7f63bdf --- /dev/null +++ b/mongodb/examples/sh-clearBalancerWindow.js @@ -0,0 +1,4 @@ +// sh.clearBalancerWindow() - Clear the balancer window + +// Basic usage (no arguments) +sh.clearBalancerWindow() diff --git a/mongodb/examples/sh-commitReshardCollection.js b/mongodb/examples/sh-commitReshardCollection.js new file mode 100644 index 0000000..456443c --- /dev/null +++ b/mongodb/examples/sh-commitReshardCollection.js @@ -0,0 +1,7 @@ +// sh.commitReshardCollection() - Commit a resharding operation + +// Basic usage +sh.commitReshardCollection("mydb.users") + +// Commit resharding for specific namespace +sh.commitReshardCollection("test.orders") diff --git a/mongodb/examples/sh-configureQueryAnalyzer.js b/mongodb/examples/sh-configureQueryAnalyzer.js new file mode 100644 index 0000000..70d1876 --- /dev/null +++ b/mongodb/examples/sh-configureQueryAnalyzer.js @@ -0,0 +1,10 @@ +// sh.configureQueryAnalyzer() - Configure the query analyzer for a collection + +// Enable query analysis +sh.configureQueryAnalyzer("mydb.users", { mode: "full", sampleRate: 1.0 }) + +// Disable query analysis +sh.configureQueryAnalyzer("mydb.users", { mode: "off" }) + +// Sample a portion of queries +sh.configureQueryAnalyzer("mydb.orders", { mode: "full", sampleRate: 0.1 }) diff --git a/mongodb/examples/sh-disableAutoMerger.js b/mongodb/examples/sh-disableAutoMerger.js new file mode 100644 index 0000000..2f0a9f5 --- /dev/null +++ b/mongodb/examples/sh-disableAutoMerger.js @@ -0,0 +1,4 @@ +// sh.disableAutoMerger() - Disable the auto-merger for the sharded cluster + +// Basic usage (no arguments) +sh.disableAutoMerger() diff --git a/mongodb/examples/sh-disableAutoSplit.js b/mongodb/examples/sh-disableAutoSplit.js new file mode 100644 index 0000000..37712c0 --- /dev/null +++ b/mongodb/examples/sh-disableAutoSplit.js @@ -0,0 +1,4 @@ +// sh.disableAutoSplit() - Disable auto-splitting of chunks + +// Basic usage (no arguments, deprecated in MongoDB 6.1) +sh.disableAutoSplit() diff --git a/mongodb/examples/sh-disableBalancing.js b/mongodb/examples/sh-disableBalancing.js new file mode 100644 index 0000000..a580a04 --- /dev/null +++ b/mongodb/examples/sh-disableBalancing.js @@ -0,0 +1,10 @@ +// sh.disableBalancing() - Disable balancing for a specific collection + +// Basic usage +sh.disableBalancing("mydb.users") + +// Disable for specific namespace +sh.disableBalancing("test.orders") + +// Disable for collection in analytics database +sh.disableBalancing("analytics.events") diff --git a/mongodb/examples/sh-enableAutoMerger.js b/mongodb/examples/sh-enableAutoMerger.js new file mode 100644 index 0000000..3e94325 --- /dev/null +++ b/mongodb/examples/sh-enableAutoMerger.js @@ -0,0 +1,4 @@ +// sh.enableAutoMerger() - Enable the auto-merger for the sharded cluster + +// Basic usage (no arguments) +sh.enableAutoMerger() diff --git a/mongodb/examples/sh-enableAutoSplit.js b/mongodb/examples/sh-enableAutoSplit.js new file mode 100644 index 0000000..a5cbe9a --- /dev/null +++ b/mongodb/examples/sh-enableAutoSplit.js @@ -0,0 +1,4 @@ +// sh.enableAutoSplit() - Enable auto-splitting of chunks + +// Basic usage (no arguments, deprecated in MongoDB 6.1) +sh.enableAutoSplit() diff --git a/mongodb/examples/sh-enableBalancing.js b/mongodb/examples/sh-enableBalancing.js new file mode 100644 index 0000000..499eb04 --- /dev/null +++ b/mongodb/examples/sh-enableBalancing.js @@ -0,0 +1,10 @@ +// sh.enableBalancing() - Enable balancing for a specific collection + +// Basic usage +sh.enableBalancing("mydb.users") + +// Enable for specific namespace +sh.enableBalancing("test.orders") + +// Enable after maintenance window +sh.enableBalancing("analytics.events") diff --git a/mongodb/examples/sh-enableSharding.js b/mongodb/examples/sh-enableSharding.js new file mode 100644 index 0000000..20abf1c --- /dev/null +++ b/mongodb/examples/sh-enableSharding.js @@ -0,0 +1,13 @@ +// sh.enableSharding() - Enable sharding for a database + +// Basic usage +sh.enableSharding("myDatabase") + +// With primaryShard option +sh.enableSharding("myDatabase", { primaryShard: "shard0001" }) + +// Enable sharding for test database +sh.enableSharding("test") + +// Enable with specific primary shard +sh.enableSharding("analytics", { primaryShard: "shard0002" }) diff --git a/mongodb/examples/sh-flushRouterConfig.js b/mongodb/examples/sh-flushRouterConfig.js new file mode 100644 index 0000000..c18bc0c --- /dev/null +++ b/mongodb/examples/sh-flushRouterConfig.js @@ -0,0 +1,7 @@ +// sh.flushRouterConfig() - Flush the routing table cache + +// Basic usage (no arguments) +sh.flushRouterConfig() + +// Flush for specific namespace +sh.flushRouterConfig("mydb.users") diff --git a/mongodb/examples/sh-getBalancerHost.js b/mongodb/examples/sh-getBalancerHost.js new file mode 100644 index 0000000..4cfc2f2 --- /dev/null +++ b/mongodb/examples/sh-getBalancerHost.js @@ -0,0 +1,4 @@ +// sh.getBalancerHost() - Get the host running the balancer + +// Basic usage (no arguments, deprecated) +sh.getBalancerHost() diff --git a/mongodb/examples/sh-getBalancerLockDetails.js b/mongodb/examples/sh-getBalancerLockDetails.js new file mode 100644 index 0000000..35d7385 --- /dev/null +++ b/mongodb/examples/sh-getBalancerLockDetails.js @@ -0,0 +1,4 @@ +// sh.getBalancerLockDetails() - Get details about the balancer lock + +// Basic usage (no arguments) +sh.getBalancerLockDetails() diff --git a/mongodb/examples/sh-getBalancerState.js b/mongodb/examples/sh-getBalancerState.js new file mode 100644 index 0000000..55c0e87 --- /dev/null +++ b/mongodb/examples/sh-getBalancerState.js @@ -0,0 +1,4 @@ +// sh.getBalancerState() - Get the current balancer state + +// Basic usage (no arguments) +sh.getBalancerState() diff --git a/mongodb/examples/sh-getBalancerWindow.js b/mongodb/examples/sh-getBalancerWindow.js new file mode 100644 index 0000000..3c61b35 --- /dev/null +++ b/mongodb/examples/sh-getBalancerWindow.js @@ -0,0 +1,4 @@ +// sh.getBalancerWindow() - Get the balancer window settings + +// Basic usage (no arguments) +sh.getBalancerWindow() diff --git a/mongodb/examples/sh-getRecentFailedRounds.js b/mongodb/examples/sh-getRecentFailedRounds.js new file mode 100644 index 0000000..65bc055 --- /dev/null +++ b/mongodb/examples/sh-getRecentFailedRounds.js @@ -0,0 +1,4 @@ +// sh.getRecentFailedRounds() - Get recent failed balancer rounds + +// Basic usage (no arguments) +sh.getRecentFailedRounds() diff --git a/mongodb/examples/sh-getRecentMigrations.js b/mongodb/examples/sh-getRecentMigrations.js new file mode 100644 index 0000000..9423363 --- /dev/null +++ b/mongodb/examples/sh-getRecentMigrations.js @@ -0,0 +1,7 @@ +// sh.getRecentMigrations() - Get recent chunk migrations + +// Basic usage (no arguments) +sh.getRecentMigrations() + +// With limit +sh.getRecentMigrations(10) diff --git a/mongodb/examples/sh-getShardedDataDistribution.js b/mongodb/examples/sh-getShardedDataDistribution.js new file mode 100644 index 0000000..1489b26 --- /dev/null +++ b/mongodb/examples/sh-getShardedDataDistribution.js @@ -0,0 +1,4 @@ +// sh.getShardedDataDistribution() - Get data distribution across shards + +// Basic usage (no arguments) +sh.getShardedDataDistribution() diff --git a/mongodb/examples/sh-getShouldAutoSplit.js b/mongodb/examples/sh-getShouldAutoSplit.js new file mode 100644 index 0000000..719ddac --- /dev/null +++ b/mongodb/examples/sh-getShouldAutoSplit.js @@ -0,0 +1,4 @@ +// sh.getShouldAutoSplit() - Check if auto-split is enabled + +// Basic usage (no arguments, deprecated in MongoDB 6.1) +sh.getShouldAutoSplit() diff --git a/mongodb/examples/sh-help.js b/mongodb/examples/sh-help.js new file mode 100644 index 0000000..3d53255 --- /dev/null +++ b/mongodb/examples/sh-help.js @@ -0,0 +1,4 @@ +// sh.help() - Display sharding helper methods + +// Basic usage +sh.help() diff --git a/mongodb/examples/sh-isBalancerRunning.js b/mongodb/examples/sh-isBalancerRunning.js new file mode 100644 index 0000000..524fa20 --- /dev/null +++ b/mongodb/examples/sh-isBalancerRunning.js @@ -0,0 +1,4 @@ +// sh.isBalancerRunning() - Check if the balancer is currently running + +// Basic usage (no arguments) +sh.isBalancerRunning() diff --git a/mongodb/examples/sh-listShards.js b/mongodb/examples/sh-listShards.js new file mode 100644 index 0000000..051e072 --- /dev/null +++ b/mongodb/examples/sh-listShards.js @@ -0,0 +1,4 @@ +// sh.listShards() - List all shards in the cluster + +// Basic usage (no arguments) +sh.listShards() diff --git a/mongodb/examples/sh-moveChunk.js b/mongodb/examples/sh-moveChunk.js new file mode 100644 index 0000000..9aaf8ec --- /dev/null +++ b/mongodb/examples/sh-moveChunk.js @@ -0,0 +1,10 @@ +// sh.moveChunk() - Move a chunk to a different shard + +// Move by find query +sh.moveChunk("mydb.users", { zipcode: "10001" }, "shard0001") + +// Move chunk containing specific document +sh.moveChunk("test.orders", { _id: ObjectId("507f1f77bcf86cd799439011") }, "shard0002") + +// Move by shard key value +sh.moveChunk("analytics.events", { region: "US", timestamp: ISODate("2024-01-01") }, "shard0003") diff --git a/mongodb/examples/sh-moveRange.js b/mongodb/examples/sh-moveRange.js new file mode 100644 index 0000000..f836320 --- /dev/null +++ b/mongodb/examples/sh-moveRange.js @@ -0,0 +1,19 @@ +// sh.moveRange() - Move a range of shard key values to a shard + +// Basic usage +sh.moveRange("mydb.users", { min: { zipcode: "10001" }, max: { zipcode: "20000" } }, "shard0001") + +// Move range with specific bounds +sh.moveRange( + "test.orders", + { min: { customerId: 1000 }, max: { customerId: 2000 } }, + "shard0002" +) + +// Move with forceJumbo option +sh.moveRange( + "mydb.events", + { min: { region: "US" }, max: { region: "UZ" } }, + "shard0003", + { forceJumbo: true } +) diff --git a/mongodb/examples/sh-refineCollectionShardKey.js b/mongodb/examples/sh-refineCollectionShardKey.js new file mode 100644 index 0000000..145506d --- /dev/null +++ b/mongodb/examples/sh-refineCollectionShardKey.js @@ -0,0 +1,10 @@ +// sh.refineCollectionShardKey() - Refine the shard key of a sharded collection + +// Basic usage - add suffix fields +sh.refineCollectionShardKey("mydb.users", { region: 1, email: 1 }) + +// Refine with additional timestamp +sh.refineCollectionShardKey("mydb.orders", { customerId: 1, orderId: 1, timestamp: 1 }) + +// Add more specificity to shard key +sh.refineCollectionShardKey("mydb.events", { category: 1, subCategory: 1, eventId: 1 }) diff --git a/mongodb/examples/sh-removeShard.js b/mongodb/examples/sh-removeShard.js new file mode 100644 index 0000000..049d5e2 --- /dev/null +++ b/mongodb/examples/sh-removeShard.js @@ -0,0 +1,10 @@ +// sh.removeShard() - Remove a shard from the cluster + +// Basic usage +sh.removeShard("shard0003") + +// Remove shard by name +sh.removeShard("rs2") + +// Remove replica set shard +sh.removeShard("shard0001") diff --git a/mongodb/examples/sh-removeShardFromZone.js b/mongodb/examples/sh-removeShardFromZone.js new file mode 100644 index 0000000..a4d0813 --- /dev/null +++ b/mongodb/examples/sh-removeShardFromZone.js @@ -0,0 +1,10 @@ +// sh.removeShardFromZone() - Remove a shard from a zone + +// Basic usage +sh.removeShardFromZone("shard0000", "NYC") + +// Remove from geographic zone +sh.removeShardFromZone("shard0001", "EU-WEST") + +// Remove from data center zone +sh.removeShardFromZone("shard0002", "DC1") diff --git a/mongodb/examples/sh-removeShardTag.js b/mongodb/examples/sh-removeShardTag.js new file mode 100644 index 0000000..e071045 --- /dev/null +++ b/mongodb/examples/sh-removeShardTag.js @@ -0,0 +1,10 @@ +// sh.removeShardTag() - Remove a tag from a shard (deprecated, use removeShardFromZone) + +// Basic usage +sh.removeShardTag("shard0000", "NYC") + +// Remove geographic tag +sh.removeShardTag("shard0001", "LAX") + +// Remove data center tag +sh.removeShardTag("shard0002", "DC1") diff --git a/mongodb/examples/sh-removeTagRange.js b/mongodb/examples/sh-removeTagRange.js new file mode 100644 index 0000000..79304b0 --- /dev/null +++ b/mongodb/examples/sh-removeTagRange.js @@ -0,0 +1,12 @@ +// sh.removeTagRange() - Remove a tag range (deprecated, use updateZoneKeyRange) + +// Basic usage +sh.removeTagRange("mydb.users", { zipcode: "10001" }, { zipcode: "10099" }, "NYC") + +// Remove compound key range +sh.removeTagRange( + "mydb.events", + { date: ISODate("2024-01-01"), region: "US" }, + { date: ISODate("2024-12-31"), region: "US" }, + "US_2024" +) diff --git a/mongodb/examples/sh-reshardCollection.js b/mongodb/examples/sh-reshardCollection.js new file mode 100644 index 0000000..3f70291 --- /dev/null +++ b/mongodb/examples/sh-reshardCollection.js @@ -0,0 +1,24 @@ +// sh.reshardCollection() - Reshard a collection with a new shard key + +// Basic usage - change to hashed shard key +sh.reshardCollection("mydb.users", { email: "hashed" }) + +// Reshard with range-based key +sh.reshardCollection("mydb.orders", { orderId: 1 }) + +// Reshard with compound key +sh.reshardCollection("mydb.events", { region: 1, timestamp: 1 }) + +// With options +sh.reshardCollection( + "mydb.products", + { category: 1, productId: 1 }, + { unique: false, numInitialChunks: 8 } +) + +// With zone specification +sh.reshardCollection( + "mydb.customers", + { country: 1, customerId: 1 }, + { zones: [{ zone: "EU", min: { country: "AA" }, max: { country: "MZ" } }] } +) diff --git a/mongodb/examples/sh-setBalancerState.js b/mongodb/examples/sh-setBalancerState.js new file mode 100644 index 0000000..9d63470 --- /dev/null +++ b/mongodb/examples/sh-setBalancerState.js @@ -0,0 +1,7 @@ +// sh.setBalancerState() - Enable or disable the balancer + +// Enable the balancer +sh.setBalancerState(true) + +// Disable the balancer +sh.setBalancerState(false) diff --git a/mongodb/examples/sh-setBalancerWindow.js b/mongodb/examples/sh-setBalancerWindow.js new file mode 100644 index 0000000..2f0c67e --- /dev/null +++ b/mongodb/examples/sh-setBalancerWindow.js @@ -0,0 +1,10 @@ +// sh.setBalancerWindow() - Set the balancer window + +// Set balancer window with start and stop times +sh.setBalancerWindow("23:00", "06:00") + +// Set overnight balancing window +sh.setBalancerWindow("02:00", "04:00") + +// Set with options +sh.setBalancerWindow({ start: "00:00", stop: "05:00" }) diff --git a/mongodb/examples/sh-shardCollection.js b/mongodb/examples/sh-shardCollection.js new file mode 100644 index 0000000..a91178e --- /dev/null +++ b/mongodb/examples/sh-shardCollection.js @@ -0,0 +1,33 @@ +// sh.shardCollection() - Shard a collection + +// Shard with hashed key +sh.shardCollection("mydb.users", { _id: "hashed" }) + +// Shard with range-based key +sh.shardCollection("mydb.orders", { customerId: 1 }) + +// Compound shard key +sh.shardCollection("mydb.events", { region: 1, timestamp: 1 }) + +// With unique constraint +sh.shardCollection("mydb.products", { sku: 1 }, { unique: true }) + +// With numInitialChunks +sh.shardCollection("mydb.logs", { timestamp: 1 }, { numInitialChunks: 4 }) + +// Hashed with presplit chunks +sh.shardCollection("mydb.telemetry", { deviceId: "hashed" }, { numInitialChunks: 10 }) + +// With collation +sh.shardCollection( + "mydb.customers", + { lastName: 1 }, + { collation: { locale: "en", strength: 2 } } +) + +// With timeseries collection +sh.shardCollection( + "mydb.metrics", + { "metadata.sensorId": 1, timestamp: 1 }, + { timeseries: { timeField: "timestamp", metaField: "metadata" } } +) diff --git a/mongodb/examples/sh-splitAt.js b/mongodb/examples/sh-splitAt.js new file mode 100644 index 0000000..b979228 --- /dev/null +++ b/mongodb/examples/sh-splitAt.js @@ -0,0 +1,13 @@ +// sh.splitAt() - Split a chunk at a specific shard key value + +// Basic usage +sh.splitAt("mydb.users", { zipcode: "50000" }) + +// Split at specific point +sh.splitAt("test.orders", { orderId: 1000000 }) + +// Split with compound key +sh.splitAt("analytics.events", { region: "US", timestamp: ISODate("2024-06-01") }) + +// Split at ObjectId boundary +sh.splitAt("mydb.documents", { _id: ObjectId("507f1f77bcf86cd799439011") }) diff --git a/mongodb/examples/sh-splitFind.js b/mongodb/examples/sh-splitFind.js new file mode 100644 index 0000000..3ad47db --- /dev/null +++ b/mongodb/examples/sh-splitFind.js @@ -0,0 +1,10 @@ +// sh.splitFind() - Split the chunk that contains a document matching the query + +// Basic usage +sh.splitFind("mydb.users", { zipcode: "10001" }) + +// Split chunk containing document +sh.splitFind("test.orders", { customerId: 12345 }) + +// Split with compound key query +sh.splitFind("analytics.events", { region: "EU", timestamp: ISODate("2024-03-15") }) diff --git a/mongodb/examples/sh-startBalancer.js b/mongodb/examples/sh-startBalancer.js new file mode 100644 index 0000000..699bd3c --- /dev/null +++ b/mongodb/examples/sh-startBalancer.js @@ -0,0 +1,10 @@ +// sh.startBalancer() - Start the balancer + +// Basic usage (no arguments) +sh.startBalancer() + +// With timeout in milliseconds +sh.startBalancer(60000) + +// Start with options +sh.startBalancer({ timeout: 60000 }) diff --git a/mongodb/examples/sh-status.js b/mongodb/examples/sh-status.js new file mode 100644 index 0000000..995fd63 --- /dev/null +++ b/mongodb/examples/sh-status.js @@ -0,0 +1,13 @@ +// sh.status() - Display sharding status + +// Basic usage +sh.status() + +// Verbose output +sh.status(true) + +// With verbose option object +sh.status({ verbose: true }) + +// Show detailed chunk information +sh.status({ verbose: 1 }) diff --git a/mongodb/examples/sh-stopBalancer.js b/mongodb/examples/sh-stopBalancer.js new file mode 100644 index 0000000..47f492c --- /dev/null +++ b/mongodb/examples/sh-stopBalancer.js @@ -0,0 +1,10 @@ +// sh.stopBalancer() - Stop the balancer + +// Basic usage (no arguments) +sh.stopBalancer() + +// With timeout in milliseconds +sh.stopBalancer(60000) + +// Stop with options +sh.stopBalancer({ timeout: 60000 }) diff --git a/mongodb/examples/sh-transitionFromDedicatedConfigServer.js b/mongodb/examples/sh-transitionFromDedicatedConfigServer.js new file mode 100644 index 0000000..e5327e3 --- /dev/null +++ b/mongodb/examples/sh-transitionFromDedicatedConfigServer.js @@ -0,0 +1,4 @@ +// sh.transitionFromDedicatedConfigServer() - Transition from dedicated config server + +// Basic usage (no arguments) +sh.transitionFromDedicatedConfigServer() diff --git a/mongodb/examples/sh-transitionToDedicatedConfigServer.js b/mongodb/examples/sh-transitionToDedicatedConfigServer.js new file mode 100644 index 0000000..3bbd848 --- /dev/null +++ b/mongodb/examples/sh-transitionToDedicatedConfigServer.js @@ -0,0 +1,4 @@ +// sh.transitionToDedicatedConfigServer() - Transition to dedicated config server + +// Basic usage (no arguments) +sh.transitionToDedicatedConfigServer() diff --git a/mongodb/examples/sh-unshardCollection.js b/mongodb/examples/sh-unshardCollection.js new file mode 100644 index 0000000..b866007 --- /dev/null +++ b/mongodb/examples/sh-unshardCollection.js @@ -0,0 +1,10 @@ +// sh.unshardCollection() - Unshard a collection (move all data to a single shard) + +// Basic usage +sh.unshardCollection("mydb.users") + +// Unshard to specific shard +sh.unshardCollection("mydb.orders", "shard0001") + +// With options +sh.unshardCollection("mydb.logs", { toShard: "shard0002" }) diff --git a/mongodb/examples/sh-updateZoneKeyRange.js b/mongodb/examples/sh-updateZoneKeyRange.js new file mode 100644 index 0000000..43e351a --- /dev/null +++ b/mongodb/examples/sh-updateZoneKeyRange.js @@ -0,0 +1,23 @@ +// sh.updateZoneKeyRange() - Associate a range of shard key values with a zone + +// Basic usage +sh.updateZoneKeyRange("mydb.users", { zipcode: "10001" }, { zipcode: "10099" }, "NYC") + +// Remove zone assignment (null zone) +sh.updateZoneKeyRange("mydb.users", { zipcode: "10001" }, { zipcode: "10099" }, null) + +// Compound shard key range +sh.updateZoneKeyRange( + "mydb.events", + { region: "US", timestamp: ISODate("2024-01-01") }, + { region: "US", timestamp: ISODate("2025-01-01") }, + "US_2024" +) + +// Geographic zone assignment +sh.updateZoneKeyRange( + "mydb.customers", + { country: "FR" }, + { country: "FZ" }, + "EU-WEST" +) diff --git a/mongodb/examples/sh-waitForBalancer.js b/mongodb/examples/sh-waitForBalancer.js new file mode 100644 index 0000000..de9bdc7 --- /dev/null +++ b/mongodb/examples/sh-waitForBalancer.js @@ -0,0 +1,10 @@ +// sh.waitForBalancer() - Wait for a balancing round to complete + +// Basic usage (no arguments) +sh.waitForBalancer() + +// With timeout +sh.waitForBalancer(true) + +// With timeout in milliseconds +sh.waitForBalancer(true, 60000) diff --git a/mongodb/examples/sh-waitForBalancerOff.js b/mongodb/examples/sh-waitForBalancerOff.js new file mode 100644 index 0000000..111ea66 --- /dev/null +++ b/mongodb/examples/sh-waitForBalancerOff.js @@ -0,0 +1,7 @@ +// sh.waitForBalancerOff() - Wait for the balancer to stop + +// Basic usage (no arguments) +sh.waitForBalancerOff() + +// With timeout in milliseconds +sh.waitForBalancerOff(60000) diff --git a/mongodb/examples/sh-waitForPingChange.js b/mongodb/examples/sh-waitForPingChange.js new file mode 100644 index 0000000..290b3f5 --- /dev/null +++ b/mongodb/examples/sh-waitForPingChange.js @@ -0,0 +1,10 @@ +// sh.waitForPingChange() - Wait for a change in ping times + +// Basic usage with activePings array +sh.waitForPingChange([{ _id: "shard0000" }, { _id: "shard0001" }]) + +// With timeout +sh.waitForPingChange([{ _id: "shard0000" }], 60000) + +// With options +sh.waitForPingChange([{ _id: "shard0000" }], { timeout: 60000 }) diff --git a/mongodb/examples/sp-createStreamProcessor.js b/mongodb/examples/sp-createStreamProcessor.js new file mode 100644 index 0000000..deeba09 --- /dev/null +++ b/mongodb/examples/sp-createStreamProcessor.js @@ -0,0 +1,59 @@ +// sp.createStreamProcessor() - Create a stream processor + +// Basic stream processor +sp.createStreamProcessor("myProcessor", { + pipeline: [ + { $source: { connectionName: "connection1" } }, + { $match: { status: "active" } }, + { $emit: { connectionName: "connection2" } } + ] +}) + +// With options +sp.createStreamProcessor("analyticsProcessor", { + pipeline: [ + { $source: { connectionName: "logs" } }, + { $merge: { into: "processed_logs" } } + ], + options: { dlq: { connectionName: "dlq_connection" } } +}) + +// Stream processor with aggregation stages +sp.createStreamProcessor("aggregateProcessor", { + pipeline: [ + { $source: { connectionName: "events" } }, + { $match: { type: "purchase" } }, + { $group: { _id: "$userId", total: { $sum: "$amount" } } }, + { $emit: { connectionName: "aggregated_events" } } + ] +}) + +// Stream processor with window operations +sp.createStreamProcessor("windowProcessor", { + pipeline: [ + { $source: { connectionName: "metrics" } }, + { $tumblingWindow: { + interval: { size: 1, unit: "minute" }, + pipeline: [ + { $group: { _id: "$sensor", avg: { $avg: "$value" } } } + ] + }}, + { $merge: { into: "metric_averages" } } + ] +}) + +// Stream processor with dead letter queue +sp.createStreamProcessor("dlqProcessor", { + pipeline: [ + { $source: { connectionName: "input_stream" } }, + { $match: { valid: true } }, + { $emit: { connectionName: "output_stream" } } + ], + options: { + dlq: { + connectionName: "dlq_connection", + db: "errors", + coll: "failed_records" + } + } +}) diff --git a/mongodb/examples/sp-drop.js b/mongodb/examples/sp-drop.js new file mode 100644 index 0000000..9d9f353 --- /dev/null +++ b/mongodb/examples/sp-drop.js @@ -0,0 +1,24 @@ +// sp..drop() - Drop (delete) a stream processor + +// Drop processor via direct access +sp.myProcessor.drop() + +// Drop various processors +sp.analyticsProcessor.drop() +sp.dataProcessor.drop() +sp.eventProcessor.drop() +sp.sensorProcessor.drop() + +// Drop processors with different naming patterns +sp.my_stream_processor.drop() +sp.processor1.drop() +sp.stream_v2.drop() + +// Drop old or deprecated processors +sp.oldProcessor.drop() +sp.legacyProcessor.drop() +sp.testProcessor.drop() + +// Drop pipeline processors +sp.deprecatedPipeline.drop() +sp.temporaryProcessor.drop() diff --git a/mongodb/examples/sp-getProcessor.js b/mongodb/examples/sp-getProcessor.js new file mode 100644 index 0000000..99eb63c --- /dev/null +++ b/mongodb/examples/sp-getProcessor.js @@ -0,0 +1,17 @@ +// sp.getProcessor() - Get a stream processor by name + +// Get processor by name +sp.getProcessor("myProcessor") + +// Get processor and check its state +sp.getProcessor("analyticsProcessor") + +// Get processor with different names +sp.getProcessor("dataProcessor") +sp.getProcessor("eventProcessor") +sp.getProcessor("sensorProcessor") + +// Get processor with special naming patterns +sp.getProcessor("my_stream_processor") +sp.getProcessor("processor-v1") +sp.getProcessor("stream_2024") diff --git a/mongodb/examples/sp-listStreamProcessors.js b/mongodb/examples/sp-listStreamProcessors.js new file mode 100644 index 0000000..d549ee6 --- /dev/null +++ b/mongodb/examples/sp-listStreamProcessors.js @@ -0,0 +1,18 @@ +// sp.listStreamProcessors() - List all stream processors + +// List all stream processors +sp.listStreamProcessors() + +// List stream processors with filter +sp.listStreamProcessors({ name: "myProcessor" }) + +// List stream processors by state +sp.listStreamProcessors({ state: "RUNNING" }) +sp.listStreamProcessors({ state: "STOPPED" }) +sp.listStreamProcessors({ state: "CREATED" }) + +// List stream processors with multiple filters +sp.listStreamProcessors({ state: "RUNNING", name: "analyticsProcessor" }) + +// List stream processors with regex pattern +sp.listStreamProcessors({ name: /^analytics.*/ }) diff --git a/mongodb/examples/sp-process.js b/mongodb/examples/sp-process.js new file mode 100644 index 0000000..77d928e --- /dev/null +++ b/mongodb/examples/sp-process.js @@ -0,0 +1,40 @@ +// sp.process() - Run an inline stream processing pipeline + +// Basic process with pipeline +sp.process([ + { $source: { connectionName: "sample_stream_solar" } }, + { $match: { status: "active" } }, + { $emit: { connectionName: "output_stream" } } +]) + +// Process with aggregation +sp.process([ + { $source: { connectionName: "events" } }, + { $group: { _id: "$category", count: { $sum: 1 } } }, + { $merge: { into: "event_counts" } } +]) + +// Process with window function +sp.process([ + { $source: { connectionName: "sensor_data" } }, + { $tumblingWindow: { + interval: { size: 5, unit: "second" }, + pipeline: [ + { $group: { _id: null, avgTemp: { $avg: "$temperature" } } } + ] + }}, + { $emit: { connectionName: "temp_averages" } } +]) + +// Process with complex transformations +sp.process([ + { $source: { connectionName: "raw_logs" } }, + { $match: { level: { $in: ["ERROR", "WARN"] } } }, + { $project: { + timestamp: 1, + level: 1, + message: 1, + processed: true + }}, + { $merge: { into: "filtered_logs" } } +]) diff --git a/mongodb/examples/sp-processor.js b/mongodb/examples/sp-processor.js new file mode 100644 index 0000000..7cd7abb --- /dev/null +++ b/mongodb/examples/sp-processor.js @@ -0,0 +1,28 @@ +// sp. - Access a specific stream processor + +// Access processor by name and check stats +sp.myProcessor.stats() + +// Access processor and start it +sp.analyticsProcessor.start() + +// Access processor and stop it +sp.dataProcessor.stop() + +// Access processor and drop it +sp.oldProcessor.drop() + +// Access processor and get sample data +sp.sensorProcessor.sample() + +// Chain operations on processor +sp.eventProcessor.stats() +sp.eventProcessor.start() +sp.eventProcessor.stop() + +// Access processor with underscore in name +sp.my_stream_processor.stats() + +// Access processor with number in name +sp.processor1.stats() +sp.stream_v2.start() diff --git a/mongodb/examples/sp-sample.js b/mongodb/examples/sp-sample.js new file mode 100644 index 0000000..6d54cd7 --- /dev/null +++ b/mongodb/examples/sp-sample.js @@ -0,0 +1,24 @@ +// sp..sample() - Sample documents from a stream processor + +// Sample from processor via direct access +sp.myProcessor.sample() + +// Sample from various processors +sp.analyticsProcessor.sample() +sp.dataProcessor.sample() +sp.eventProcessor.sample() +sp.sensorProcessor.sample() + +// Sample from processors with different naming patterns +sp.my_stream_processor.sample() +sp.processor1.sample() +sp.stream_v2.sample() + +// Sample from pipeline processors +sp.ingestPipeline.sample() +sp.transformPipeline.sample() +sp.outputPipeline.sample() + +// Sample for debugging +sp.debugProcessor.sample() +sp.testProcessor.sample() diff --git a/mongodb/examples/sp-start.js b/mongodb/examples/sp-start.js new file mode 100644 index 0000000..be23aad --- /dev/null +++ b/mongodb/examples/sp-start.js @@ -0,0 +1,20 @@ +// sp..start() - Start a stream processor + +// Start processor via direct access +sp.myProcessor.start() + +// Start various processors +sp.analyticsProcessor.start() +sp.dataProcessor.start() +sp.eventProcessor.start() +sp.sensorProcessor.start() + +// Start processors with different naming patterns +sp.my_stream_processor.start() +sp.processor1.start() +sp.stream_v2.start() + +// Start a specific processor for data pipeline +sp.ingestPipeline.start() +sp.transformPipeline.start() +sp.outputPipeline.start() diff --git a/mongodb/examples/sp-stop.js b/mongodb/examples/sp-stop.js new file mode 100644 index 0000000..e4dd30e --- /dev/null +++ b/mongodb/examples/sp-stop.js @@ -0,0 +1,24 @@ +// sp..stop() - Stop a stream processor + +// Stop processor via direct access +sp.myProcessor.stop() + +// Stop various processors +sp.analyticsProcessor.stop() +sp.dataProcessor.stop() +sp.eventProcessor.stop() +sp.sensorProcessor.stop() + +// Stop processors with different naming patterns +sp.my_stream_processor.stop() +sp.processor1.stop() +sp.stream_v2.stop() + +// Stop pipeline processors +sp.ingestPipeline.stop() +sp.transformPipeline.stop() +sp.outputPipeline.stop() + +// Stop for maintenance +sp.productionProcessor.stop() +sp.stagingProcessor.stop() diff --git a/mongodb/mongoshell_lexer.go b/mongodb/mongoshell_lexer.go index 04797dc..0fed6ba 100644 --- a/mongodb/mongoshell_lexer.go +++ b/mongodb/mongoshell_lexer.go @@ -47,320 +47,940 @@ func mongoshelllexerLexerInit() { "'true'", "'false'", "'null'", "'getCollection'", "'getCollectionNames'", "'getCollectionInfos'", "'ObjectId'", "'ISODate'", "'Date'", "'UUID'", "'Long'", "'NumberLong'", "'Int32'", "'NumberInt'", "'Double'", "'Decimal128'", - "'NumberDecimal'", "'Timestamp'", "'RegExp'", "'find'", "'findOne'", - "'countDocuments'", "'estimatedDocumentCount'", "'distinct'", "'aggregate'", - "'getIndexes'", "'sort'", "'limit'", "'skip'", "'projection'", "'project'", - "'count'", "'('", "')'", "'{'", "'}'", "'['", "']'", "':'", "','", "'.'", - "';'", "'$'", + "'NumberDecimal'", "'Timestamp'", "'RegExp'", "'BinData'", "'Binary'", + "'BSONRegExp'", "'HexData'", "'find'", "'findOne'", "'countDocuments'", + "'estimatedDocumentCount'", "'distinct'", "'aggregate'", "'getIndexes'", + "'insertOne'", "'insertMany'", "'updateOne'", "'updateMany'", "'deleteOne'", + "'deleteMany'", "'replaceOne'", "'findOneAndUpdate'", "'findOneAndReplace'", + "'findOneAndDelete'", "'createIndex'", "'createIndexes'", "'dropIndex'", + "'dropIndexes'", "'drop'", "'renameCollection'", "'stats'", "'storageSize'", + "'totalIndexSize'", "'totalSize'", "'dataSize'", "'isCapped'", "'validate'", + "'latencyStats'", "'createCollection'", "'dropDatabase'", "'hostInfo'", + "'listCommands'", "'serverBuildInfo'", "'serverStatus'", "'version'", + "'runCommand'", "'adminCommand'", "'getName'", "'getMongo'", "'getSiblingDB'", + "'Mongo'", "'connect'", "'rs'", "'sh'", "'sp'", "'getDB'", "'getReadConcern'", + "'getReadPref'", "'getReadPrefMode'", "'getReadPrefTagSet'", "'getWriteConcern'", + "'setReadPref'", "'setReadConcern'", "'setWriteConcern'", "'startSession'", + "'watch'", "'getDBNames'", "'getKeyVault'", "'getClientEncryption'", + "'getPlanCache'", "'sort'", "'limit'", "'skip'", "'projection'", "'project'", + "'count'", "'initializeOrderedBulkOp'", "'initializeUnorderedBulkOp'", + "'execute'", "'getOperations'", "'toString'", "'insert'", "'remove'", + "'batchSize'", "'close'", "'collation'", "'comment'", "'explain'", "'forEach'", + "'hasNext'", "'hint'", "'isClosed'", "'isExhausted'", "'itcount'", "'map'", + "'max'", "'maxAwaitTimeMS'", "'maxTimeMS'", "'min'", "'next'", "'noCursorTimeout'", + "'objsLeftInBatch'", "'pretty'", "'readConcern'", "'readPref'", "'returnKey'", + "'showRecordId'", "'size'", "'tailable'", "'toArray'", "'tryNext'", + "'allowDiskUse'", "'addOption'", "'('", "')'", "'{'", "'}'", "'['", + "']'", "':'", "','", "'.'", "';'", "'$'", } staticData.SymbolicNames = []string{ "", "SHOW", "DBS", "DATABASES", "COLLECTIONS", "DB", "NEW", "TRUE", "FALSE", "NULL", "GET_COLLECTION", "GET_COLLECTION_NAMES", "GET_COLLECTION_INFOS", "OBJECT_ID", "ISO_DATE", "DATE", "UUID", "LONG", "NUMBER_LONG", "INT32", "NUMBER_INT", "DOUBLE", "DECIMAL128", "NUMBER_DECIMAL", "TIMESTAMP", - "REG_EXP", "FIND", "FIND_ONE", "COUNT_DOCUMENTS", "ESTIMATED_DOCUMENT_COUNT", - "DISTINCT", "AGGREGATE", "GET_INDEXES", "SORT", "LIMIT", "SKIP_", "PROJECTION", - "PROJECT", "COUNT", "LPAREN", "RPAREN", "LBRACE", "RBRACE", "LBRACKET", - "RBRACKET", "COLON", "COMMA", "DOT", "SEMI", "DOLLAR", "LINE_COMMENT", - "BLOCK_COMMENT", "REGEX_LITERAL", "NUMBER", "DOUBLE_QUOTED_STRING", - "SINGLE_QUOTED_STRING", "IDENTIFIER", "WS", + "REG_EXP", "BIN_DATA", "BINARY", "BSON_REG_EXP", "HEX_DATA", "FIND", + "FIND_ONE", "COUNT_DOCUMENTS", "ESTIMATED_DOCUMENT_COUNT", "DISTINCT", + "AGGREGATE", "GET_INDEXES", "INSERT_ONE", "INSERT_MANY", "UPDATE_ONE", + "UPDATE_MANY", "DELETE_ONE", "DELETE_MANY", "REPLACE_ONE", "FIND_ONE_AND_UPDATE", + "FIND_ONE_AND_REPLACE", "FIND_ONE_AND_DELETE", "CREATE_INDEX", "CREATE_INDEXES", + "DROP_INDEX", "DROP_INDEXES", "DROP", "RENAME_COLLECTION", "STATS", + "STORAGE_SIZE", "TOTAL_INDEX_SIZE", "TOTAL_SIZE", "DATA_SIZE", "IS_CAPPED", + "VALIDATE", "LATENCY_STATS", "CREATE_COLLECTION", "DROP_DATABASE", "HOST_INFO", + "LIST_COMMANDS", "SERVER_BUILD_INFO", "SERVER_STATUS", "VERSION", "RUN_COMMAND", + "ADMIN_COMMAND", "GET_NAME", "GET_MONGO", "GET_SIBLING_DB", "MONGO", + "CONNECT", "RS", "SH", "SP", "GET_DB", "GET_READ_CONCERN", "GET_READ_PREF", + "GET_READ_PREF_MODE", "GET_READ_PREF_TAG_SET", "GET_WRITE_CONCERN", + "SET_READ_PREF", "SET_READ_CONCERN", "SET_WRITE_CONCERN", "START_SESSION", + "WATCH", "GET_DB_NAMES", "GET_KEY_VAULT", "GET_CLIENT_ENCRYPTION", "GET_PLAN_CACHE", + "SORT", "LIMIT", "SKIP_", "PROJECTION", "PROJECT", "COUNT", "INITIALIZE_ORDERED_BULK_OP", + "INITIALIZE_UNORDERED_BULK_OP", "EXECUTE", "GET_OPERATIONS", "TO_STRING", + "INSERT", "REMOVE", "BATCH_SIZE", "CLOSE", "COLLATION", "COMMENT", "EXPLAIN", + "FOR_EACH", "HAS_NEXT", "HINT", "IS_CLOSED", "IS_EXHAUSTED", "IT_COUNT", + "MAP", "MAX", "MAX_AWAIT_TIME_MS", "MAX_TIME_MS", "MIN", "NEXT", "NO_CURSOR_TIMEOUT", + "OBJS_LEFT_IN_BATCH", "PRETTY", "READ_CONCERN", "READ_PREF", "RETURN_KEY", + "SHOW_RECORD_ID", "SIZE", "TAILABLE", "TO_ARRAY", "TRY_NEXT", "ALLOW_DISK_USE", + "ADD_OPTION", "LPAREN", "RPAREN", "LBRACE", "RBRACE", "LBRACKET", "RBRACKET", + "COLON", "COMMA", "DOT", "SEMI", "DOLLAR", "LINE_COMMENT", "BLOCK_COMMENT", + "REGEX_LITERAL", "NUMBER", "DOUBLE_QUOTED_STRING", "SINGLE_QUOTED_STRING", + "IDENTIFIER", "WS", } staticData.RuleNames = []string{ "SHOW", "DBS", "DATABASES", "COLLECTIONS", "DB", "NEW", "TRUE", "FALSE", "NULL", "GET_COLLECTION", "GET_COLLECTION_NAMES", "GET_COLLECTION_INFOS", "OBJECT_ID", "ISO_DATE", "DATE", "UUID", "LONG", "NUMBER_LONG", "INT32", "NUMBER_INT", "DOUBLE", "DECIMAL128", "NUMBER_DECIMAL", "TIMESTAMP", - "REG_EXP", "FIND", "FIND_ONE", "COUNT_DOCUMENTS", "ESTIMATED_DOCUMENT_COUNT", - "DISTINCT", "AGGREGATE", "GET_INDEXES", "SORT", "LIMIT", "SKIP_", "PROJECTION", - "PROJECT", "COUNT", "LPAREN", "RPAREN", "LBRACE", "RBRACE", "LBRACKET", - "RBRACKET", "COLON", "COMMA", "DOT", "SEMI", "DOLLAR", "LINE_COMMENT", - "BLOCK_COMMENT", "REGEX_LITERAL", "REGEX_BODY", "REGEX_CHAR", "REGEX_FLAGS", - "NUMBER", "INT", "EXPONENT", "DOUBLE_QUOTED_STRING", "SINGLE_QUOTED_STRING", - "ESC", "UNICODE", "HEX", "IDENTIFIER", "WS", + "REG_EXP", "BIN_DATA", "BINARY", "BSON_REG_EXP", "HEX_DATA", "FIND", + "FIND_ONE", "COUNT_DOCUMENTS", "ESTIMATED_DOCUMENT_COUNT", "DISTINCT", + "AGGREGATE", "GET_INDEXES", "INSERT_ONE", "INSERT_MANY", "UPDATE_ONE", + "UPDATE_MANY", "DELETE_ONE", "DELETE_MANY", "REPLACE_ONE", "FIND_ONE_AND_UPDATE", + "FIND_ONE_AND_REPLACE", "FIND_ONE_AND_DELETE", "CREATE_INDEX", "CREATE_INDEXES", + "DROP_INDEX", "DROP_INDEXES", "DROP", "RENAME_COLLECTION", "STATS", + "STORAGE_SIZE", "TOTAL_INDEX_SIZE", "TOTAL_SIZE", "DATA_SIZE", "IS_CAPPED", + "VALIDATE", "LATENCY_STATS", "CREATE_COLLECTION", "DROP_DATABASE", "HOST_INFO", + "LIST_COMMANDS", "SERVER_BUILD_INFO", "SERVER_STATUS", "VERSION", "RUN_COMMAND", + "ADMIN_COMMAND", "GET_NAME", "GET_MONGO", "GET_SIBLING_DB", "MONGO", + "CONNECT", "RS", "SH", "SP", "GET_DB", "GET_READ_CONCERN", "GET_READ_PREF", + "GET_READ_PREF_MODE", "GET_READ_PREF_TAG_SET", "GET_WRITE_CONCERN", + "SET_READ_PREF", "SET_READ_CONCERN", "SET_WRITE_CONCERN", "START_SESSION", + "WATCH", "GET_DB_NAMES", "GET_KEY_VAULT", "GET_CLIENT_ENCRYPTION", "GET_PLAN_CACHE", + "SORT", "LIMIT", "SKIP_", "PROJECTION", "PROJECT", "COUNT", "INITIALIZE_ORDERED_BULK_OP", + "INITIALIZE_UNORDERED_BULK_OP", "EXECUTE", "GET_OPERATIONS", "TO_STRING", + "INSERT", "REMOVE", "BATCH_SIZE", "CLOSE", "COLLATION", "COMMENT", "EXPLAIN", + "FOR_EACH", "HAS_NEXT", "HINT", "IS_CLOSED", "IS_EXHAUSTED", "IT_COUNT", + "MAP", "MAX", "MAX_AWAIT_TIME_MS", "MAX_TIME_MS", "MIN", "NEXT", "NO_CURSOR_TIMEOUT", + "OBJS_LEFT_IN_BATCH", "PRETTY", "READ_CONCERN", "READ_PREF", "RETURN_KEY", + "SHOW_RECORD_ID", "SIZE", "TAILABLE", "TO_ARRAY", "TRY_NEXT", "ALLOW_DISK_USE", + "ADD_OPTION", "LPAREN", "RPAREN", "LBRACE", "RBRACE", "LBRACKET", "RBRACKET", + "COLON", "COMMA", "DOT", "SEMI", "DOLLAR", "LINE_COMMENT", "BLOCK_COMMENT", + "REGEX_LITERAL", "REGEX_BODY", "REGEX_CHAR", "REGEX_FLAGS", "NUMBER", + "INT", "EXPONENT", "DOUBLE_QUOTED_STRING", "SINGLE_QUOTED_STRING", "ESC", + "UNICODE", "HEX", "IDENTIFIER", "WS", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 0, 57, 631, 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, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, - 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, - 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, - 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, - 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, - 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, + 4, 0, 154, 1870, 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, 2, 111, 7, 111, 2, 112, 7, 112, + 2, 113, 7, 113, 2, 114, 7, 114, 2, 115, 7, 115, 2, 116, 7, 116, 2, 117, + 7, 117, 2, 118, 7, 118, 2, 119, 7, 119, 2, 120, 7, 120, 2, 121, 7, 121, + 2, 122, 7, 122, 2, 123, 7, 123, 2, 124, 7, 124, 2, 125, 7, 125, 2, 126, + 7, 126, 2, 127, 7, 127, 2, 128, 7, 128, 2, 129, 7, 129, 2, 130, 7, 130, + 2, 131, 7, 131, 2, 132, 7, 132, 2, 133, 7, 133, 2, 134, 7, 134, 2, 135, + 7, 135, 2, 136, 7, 136, 2, 137, 7, 137, 2, 138, 7, 138, 2, 139, 7, 139, + 2, 140, 7, 140, 2, 141, 7, 141, 2, 142, 7, 142, 2, 143, 7, 143, 2, 144, + 7, 144, 2, 145, 7, 145, 2, 146, 7, 146, 2, 147, 7, 147, 2, 148, 7, 148, + 2, 149, 7, 149, 2, 150, 7, 150, 2, 151, 7, 151, 2, 152, 7, 152, 2, 153, + 7, 153, 2, 154, 7, 154, 2, 155, 7, 155, 2, 156, 7, 156, 2, 157, 7, 157, + 2, 158, 7, 158, 2, 159, 7, 159, 2, 160, 7, 160, 2, 161, 7, 161, 1, 0, 1, + 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, + 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, + 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, + 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, + 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, + 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, - 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, - 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, - 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, - 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, - 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, - 1, 17, 1, 17, 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, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, - 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, - 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, - 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, - 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, - 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, - 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, - 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, - 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, - 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, - 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, - 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 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, 31, 1, 31, 1, 31, - 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, - 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, - 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, - 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, - 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 39, 1, - 39, 1, 40, 1, 40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 43, 1, 43, 1, 44, 1, 44, - 1, 45, 1, 45, 1, 46, 1, 46, 1, 47, 1, 47, 1, 48, 1, 48, 1, 49, 1, 49, 1, - 49, 1, 49, 5, 49, 494, 8, 49, 10, 49, 12, 49, 497, 9, 49, 1, 49, 1, 49, - 1, 50, 1, 50, 1, 50, 1, 50, 5, 50, 505, 8, 50, 10, 50, 12, 50, 508, 9, - 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 51, 3, 51, - 519, 8, 51, 1, 52, 4, 52, 522, 8, 52, 11, 52, 12, 52, 523, 1, 53, 1, 53, - 1, 53, 3, 53, 529, 8, 53, 1, 54, 4, 54, 532, 8, 54, 11, 54, 12, 54, 533, - 1, 55, 3, 55, 537, 8, 55, 1, 55, 1, 55, 1, 55, 4, 55, 542, 8, 55, 11, 55, - 12, 55, 543, 3, 55, 546, 8, 55, 1, 55, 3, 55, 549, 8, 55, 1, 55, 3, 55, - 552, 8, 55, 1, 55, 1, 55, 4, 55, 556, 8, 55, 11, 55, 12, 55, 557, 1, 55, - 3, 55, 561, 8, 55, 3, 55, 563, 8, 55, 1, 56, 1, 56, 1, 56, 5, 56, 568, - 8, 56, 10, 56, 12, 56, 571, 9, 56, 3, 56, 573, 8, 56, 1, 57, 1, 57, 3, - 57, 577, 8, 57, 1, 57, 4, 57, 580, 8, 57, 11, 57, 12, 57, 581, 1, 58, 1, - 58, 1, 58, 5, 58, 587, 8, 58, 10, 58, 12, 58, 590, 9, 58, 1, 58, 1, 58, - 1, 59, 1, 59, 1, 59, 5, 59, 597, 8, 59, 10, 59, 12, 59, 600, 9, 59, 1, - 59, 1, 59, 1, 60, 1, 60, 1, 60, 1, 60, 3, 60, 608, 8, 60, 1, 61, 1, 61, - 1, 61, 1, 61, 1, 61, 1, 61, 1, 62, 1, 62, 1, 63, 1, 63, 5, 63, 620, 8, - 63, 10, 63, 12, 63, 623, 9, 63, 1, 64, 4, 64, 626, 8, 64, 11, 64, 12, 64, - 627, 1, 64, 1, 64, 1, 506, 0, 65, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, - 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, - 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, - 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, - 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, - 43, 87, 44, 89, 45, 91, 46, 93, 47, 95, 48, 97, 49, 99, 50, 101, 51, 103, - 52, 105, 0, 107, 0, 109, 0, 111, 53, 113, 0, 115, 0, 117, 54, 119, 55, - 121, 0, 123, 0, 125, 0, 127, 56, 129, 57, 1, 0, 14, 2, 0, 10, 10, 13, 13, - 4, 0, 10, 10, 13, 13, 47, 47, 92, 92, 6, 0, 103, 103, 105, 105, 109, 109, - 115, 115, 117, 117, 121, 121, 1, 0, 48, 57, 1, 0, 49, 57, 2, 0, 69, 69, - 101, 101, 2, 0, 43, 43, 45, 45, 2, 0, 34, 34, 92, 92, 2, 0, 39, 39, 92, - 92, 8, 0, 34, 34, 47, 47, 92, 92, 98, 98, 102, 102, 110, 110, 114, 114, - 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 4, 0, 36, 36, 65, 90, 95, 95, - 97, 122, 5, 0, 36, 36, 48, 57, 65, 90, 95, 95, 97, 122, 3, 0, 9, 10, 13, - 13, 32, 32, 648, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, - 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, - 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, - 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, - 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, - 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, - 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, - 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, - 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, - 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, - 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, - 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, - 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, 0, 0, 97, 1, 0, 0, 0, - 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, 0, 0, 0, 103, 1, 0, 0, 0, 0, 111, 1, 0, - 0, 0, 0, 117, 1, 0, 0, 0, 0, 119, 1, 0, 0, 0, 0, 127, 1, 0, 0, 0, 0, 129, - 1, 0, 0, 0, 1, 131, 1, 0, 0, 0, 3, 136, 1, 0, 0, 0, 5, 140, 1, 0, 0, 0, - 7, 150, 1, 0, 0, 0, 9, 162, 1, 0, 0, 0, 11, 165, 1, 0, 0, 0, 13, 169, 1, - 0, 0, 0, 15, 174, 1, 0, 0, 0, 17, 180, 1, 0, 0, 0, 19, 185, 1, 0, 0, 0, - 21, 199, 1, 0, 0, 0, 23, 218, 1, 0, 0, 0, 25, 237, 1, 0, 0, 0, 27, 246, - 1, 0, 0, 0, 29, 254, 1, 0, 0, 0, 31, 259, 1, 0, 0, 0, 33, 264, 1, 0, 0, - 0, 35, 269, 1, 0, 0, 0, 37, 280, 1, 0, 0, 0, 39, 286, 1, 0, 0, 0, 41, 296, - 1, 0, 0, 0, 43, 303, 1, 0, 0, 0, 45, 314, 1, 0, 0, 0, 47, 328, 1, 0, 0, - 0, 49, 338, 1, 0, 0, 0, 51, 345, 1, 0, 0, 0, 53, 350, 1, 0, 0, 0, 55, 358, - 1, 0, 0, 0, 57, 373, 1, 0, 0, 0, 59, 396, 1, 0, 0, 0, 61, 405, 1, 0, 0, - 0, 63, 415, 1, 0, 0, 0, 65, 426, 1, 0, 0, 0, 67, 431, 1, 0, 0, 0, 69, 437, - 1, 0, 0, 0, 71, 442, 1, 0, 0, 0, 73, 453, 1, 0, 0, 0, 75, 461, 1, 0, 0, - 0, 77, 467, 1, 0, 0, 0, 79, 469, 1, 0, 0, 0, 81, 471, 1, 0, 0, 0, 83, 473, - 1, 0, 0, 0, 85, 475, 1, 0, 0, 0, 87, 477, 1, 0, 0, 0, 89, 479, 1, 0, 0, - 0, 91, 481, 1, 0, 0, 0, 93, 483, 1, 0, 0, 0, 95, 485, 1, 0, 0, 0, 97, 487, - 1, 0, 0, 0, 99, 489, 1, 0, 0, 0, 101, 500, 1, 0, 0, 0, 103, 514, 1, 0, - 0, 0, 105, 521, 1, 0, 0, 0, 107, 528, 1, 0, 0, 0, 109, 531, 1, 0, 0, 0, - 111, 562, 1, 0, 0, 0, 113, 572, 1, 0, 0, 0, 115, 574, 1, 0, 0, 0, 117, - 583, 1, 0, 0, 0, 119, 593, 1, 0, 0, 0, 121, 603, 1, 0, 0, 0, 123, 609, - 1, 0, 0, 0, 125, 615, 1, 0, 0, 0, 127, 617, 1, 0, 0, 0, 129, 625, 1, 0, - 0, 0, 131, 132, 5, 115, 0, 0, 132, 133, 5, 104, 0, 0, 133, 134, 5, 111, - 0, 0, 134, 135, 5, 119, 0, 0, 135, 2, 1, 0, 0, 0, 136, 137, 5, 100, 0, - 0, 137, 138, 5, 98, 0, 0, 138, 139, 5, 115, 0, 0, 139, 4, 1, 0, 0, 0, 140, - 141, 5, 100, 0, 0, 141, 142, 5, 97, 0, 0, 142, 143, 5, 116, 0, 0, 143, - 144, 5, 97, 0, 0, 144, 145, 5, 98, 0, 0, 145, 146, 5, 97, 0, 0, 146, 147, - 5, 115, 0, 0, 147, 148, 5, 101, 0, 0, 148, 149, 5, 115, 0, 0, 149, 6, 1, - 0, 0, 0, 150, 151, 5, 99, 0, 0, 151, 152, 5, 111, 0, 0, 152, 153, 5, 108, - 0, 0, 153, 154, 5, 108, 0, 0, 154, 155, 5, 101, 0, 0, 155, 156, 5, 99, - 0, 0, 156, 157, 5, 116, 0, 0, 157, 158, 5, 105, 0, 0, 158, 159, 5, 111, - 0, 0, 159, 160, 5, 110, 0, 0, 160, 161, 5, 115, 0, 0, 161, 8, 1, 0, 0, - 0, 162, 163, 5, 100, 0, 0, 163, 164, 5, 98, 0, 0, 164, 10, 1, 0, 0, 0, - 165, 166, 5, 110, 0, 0, 166, 167, 5, 101, 0, 0, 167, 168, 5, 119, 0, 0, - 168, 12, 1, 0, 0, 0, 169, 170, 5, 116, 0, 0, 170, 171, 5, 114, 0, 0, 171, - 172, 5, 117, 0, 0, 172, 173, 5, 101, 0, 0, 173, 14, 1, 0, 0, 0, 174, 175, - 5, 102, 0, 0, 175, 176, 5, 97, 0, 0, 176, 177, 5, 108, 0, 0, 177, 178, - 5, 115, 0, 0, 178, 179, 5, 101, 0, 0, 179, 16, 1, 0, 0, 0, 180, 181, 5, - 110, 0, 0, 181, 182, 5, 117, 0, 0, 182, 183, 5, 108, 0, 0, 183, 184, 5, - 108, 0, 0, 184, 18, 1, 0, 0, 0, 185, 186, 5, 103, 0, 0, 186, 187, 5, 101, - 0, 0, 187, 188, 5, 116, 0, 0, 188, 189, 5, 67, 0, 0, 189, 190, 5, 111, - 0, 0, 190, 191, 5, 108, 0, 0, 191, 192, 5, 108, 0, 0, 192, 193, 5, 101, - 0, 0, 193, 194, 5, 99, 0, 0, 194, 195, 5, 116, 0, 0, 195, 196, 5, 105, - 0, 0, 196, 197, 5, 111, 0, 0, 197, 198, 5, 110, 0, 0, 198, 20, 1, 0, 0, - 0, 199, 200, 5, 103, 0, 0, 200, 201, 5, 101, 0, 0, 201, 202, 5, 116, 0, - 0, 202, 203, 5, 67, 0, 0, 203, 204, 5, 111, 0, 0, 204, 205, 5, 108, 0, - 0, 205, 206, 5, 108, 0, 0, 206, 207, 5, 101, 0, 0, 207, 208, 5, 99, 0, - 0, 208, 209, 5, 116, 0, 0, 209, 210, 5, 105, 0, 0, 210, 211, 5, 111, 0, - 0, 211, 212, 5, 110, 0, 0, 212, 213, 5, 78, 0, 0, 213, 214, 5, 97, 0, 0, - 214, 215, 5, 109, 0, 0, 215, 216, 5, 101, 0, 0, 216, 217, 5, 115, 0, 0, - 217, 22, 1, 0, 0, 0, 218, 219, 5, 103, 0, 0, 219, 220, 5, 101, 0, 0, 220, - 221, 5, 116, 0, 0, 221, 222, 5, 67, 0, 0, 222, 223, 5, 111, 0, 0, 223, - 224, 5, 108, 0, 0, 224, 225, 5, 108, 0, 0, 225, 226, 5, 101, 0, 0, 226, - 227, 5, 99, 0, 0, 227, 228, 5, 116, 0, 0, 228, 229, 5, 105, 0, 0, 229, - 230, 5, 111, 0, 0, 230, 231, 5, 110, 0, 0, 231, 232, 5, 73, 0, 0, 232, - 233, 5, 110, 0, 0, 233, 234, 5, 102, 0, 0, 234, 235, 5, 111, 0, 0, 235, - 236, 5, 115, 0, 0, 236, 24, 1, 0, 0, 0, 237, 238, 5, 79, 0, 0, 238, 239, - 5, 98, 0, 0, 239, 240, 5, 106, 0, 0, 240, 241, 5, 101, 0, 0, 241, 242, - 5, 99, 0, 0, 242, 243, 5, 116, 0, 0, 243, 244, 5, 73, 0, 0, 244, 245, 5, - 100, 0, 0, 245, 26, 1, 0, 0, 0, 246, 247, 5, 73, 0, 0, 247, 248, 5, 83, - 0, 0, 248, 249, 5, 79, 0, 0, 249, 250, 5, 68, 0, 0, 250, 251, 5, 97, 0, - 0, 251, 252, 5, 116, 0, 0, 252, 253, 5, 101, 0, 0, 253, 28, 1, 0, 0, 0, - 254, 255, 5, 68, 0, 0, 255, 256, 5, 97, 0, 0, 256, 257, 5, 116, 0, 0, 257, - 258, 5, 101, 0, 0, 258, 30, 1, 0, 0, 0, 259, 260, 5, 85, 0, 0, 260, 261, - 5, 85, 0, 0, 261, 262, 5, 73, 0, 0, 262, 263, 5, 68, 0, 0, 263, 32, 1, - 0, 0, 0, 264, 265, 5, 76, 0, 0, 265, 266, 5, 111, 0, 0, 266, 267, 5, 110, - 0, 0, 267, 268, 5, 103, 0, 0, 268, 34, 1, 0, 0, 0, 269, 270, 5, 78, 0, - 0, 270, 271, 5, 117, 0, 0, 271, 272, 5, 109, 0, 0, 272, 273, 5, 98, 0, - 0, 273, 274, 5, 101, 0, 0, 274, 275, 5, 114, 0, 0, 275, 276, 5, 76, 0, - 0, 276, 277, 5, 111, 0, 0, 277, 278, 5, 110, 0, 0, 278, 279, 5, 103, 0, - 0, 279, 36, 1, 0, 0, 0, 280, 281, 5, 73, 0, 0, 281, 282, 5, 110, 0, 0, - 282, 283, 5, 116, 0, 0, 283, 284, 5, 51, 0, 0, 284, 285, 5, 50, 0, 0, 285, - 38, 1, 0, 0, 0, 286, 287, 5, 78, 0, 0, 287, 288, 5, 117, 0, 0, 288, 289, - 5, 109, 0, 0, 289, 290, 5, 98, 0, 0, 290, 291, 5, 101, 0, 0, 291, 292, - 5, 114, 0, 0, 292, 293, 5, 73, 0, 0, 293, 294, 5, 110, 0, 0, 294, 295, - 5, 116, 0, 0, 295, 40, 1, 0, 0, 0, 296, 297, 5, 68, 0, 0, 297, 298, 5, - 111, 0, 0, 298, 299, 5, 117, 0, 0, 299, 300, 5, 98, 0, 0, 300, 301, 5, - 108, 0, 0, 301, 302, 5, 101, 0, 0, 302, 42, 1, 0, 0, 0, 303, 304, 5, 68, - 0, 0, 304, 305, 5, 101, 0, 0, 305, 306, 5, 99, 0, 0, 306, 307, 5, 105, - 0, 0, 307, 308, 5, 109, 0, 0, 308, 309, 5, 97, 0, 0, 309, 310, 5, 108, - 0, 0, 310, 311, 5, 49, 0, 0, 311, 312, 5, 50, 0, 0, 312, 313, 5, 56, 0, - 0, 313, 44, 1, 0, 0, 0, 314, 315, 5, 78, 0, 0, 315, 316, 5, 117, 0, 0, - 316, 317, 5, 109, 0, 0, 317, 318, 5, 98, 0, 0, 318, 319, 5, 101, 0, 0, - 319, 320, 5, 114, 0, 0, 320, 321, 5, 68, 0, 0, 321, 322, 5, 101, 0, 0, - 322, 323, 5, 99, 0, 0, 323, 324, 5, 105, 0, 0, 324, 325, 5, 109, 0, 0, - 325, 326, 5, 97, 0, 0, 326, 327, 5, 108, 0, 0, 327, 46, 1, 0, 0, 0, 328, - 329, 5, 84, 0, 0, 329, 330, 5, 105, 0, 0, 330, 331, 5, 109, 0, 0, 331, - 332, 5, 101, 0, 0, 332, 333, 5, 115, 0, 0, 333, 334, 5, 116, 0, 0, 334, - 335, 5, 97, 0, 0, 335, 336, 5, 109, 0, 0, 336, 337, 5, 112, 0, 0, 337, - 48, 1, 0, 0, 0, 338, 339, 5, 82, 0, 0, 339, 340, 5, 101, 0, 0, 340, 341, - 5, 103, 0, 0, 341, 342, 5, 69, 0, 0, 342, 343, 5, 120, 0, 0, 343, 344, - 5, 112, 0, 0, 344, 50, 1, 0, 0, 0, 345, 346, 5, 102, 0, 0, 346, 347, 5, - 105, 0, 0, 347, 348, 5, 110, 0, 0, 348, 349, 5, 100, 0, 0, 349, 52, 1, - 0, 0, 0, 350, 351, 5, 102, 0, 0, 351, 352, 5, 105, 0, 0, 352, 353, 5, 110, - 0, 0, 353, 354, 5, 100, 0, 0, 354, 355, 5, 79, 0, 0, 355, 356, 5, 110, - 0, 0, 356, 357, 5, 101, 0, 0, 357, 54, 1, 0, 0, 0, 358, 359, 5, 99, 0, - 0, 359, 360, 5, 111, 0, 0, 360, 361, 5, 117, 0, 0, 361, 362, 5, 110, 0, - 0, 362, 363, 5, 116, 0, 0, 363, 364, 5, 68, 0, 0, 364, 365, 5, 111, 0, - 0, 365, 366, 5, 99, 0, 0, 366, 367, 5, 117, 0, 0, 367, 368, 5, 109, 0, - 0, 368, 369, 5, 101, 0, 0, 369, 370, 5, 110, 0, 0, 370, 371, 5, 116, 0, - 0, 371, 372, 5, 115, 0, 0, 372, 56, 1, 0, 0, 0, 373, 374, 5, 101, 0, 0, - 374, 375, 5, 115, 0, 0, 375, 376, 5, 116, 0, 0, 376, 377, 5, 105, 0, 0, - 377, 378, 5, 109, 0, 0, 378, 379, 5, 97, 0, 0, 379, 380, 5, 116, 0, 0, - 380, 381, 5, 101, 0, 0, 381, 382, 5, 100, 0, 0, 382, 383, 5, 68, 0, 0, - 383, 384, 5, 111, 0, 0, 384, 385, 5, 99, 0, 0, 385, 386, 5, 117, 0, 0, - 386, 387, 5, 109, 0, 0, 387, 388, 5, 101, 0, 0, 388, 389, 5, 110, 0, 0, - 389, 390, 5, 116, 0, 0, 390, 391, 5, 67, 0, 0, 391, 392, 5, 111, 0, 0, - 392, 393, 5, 117, 0, 0, 393, 394, 5, 110, 0, 0, 394, 395, 5, 116, 0, 0, - 395, 58, 1, 0, 0, 0, 396, 397, 5, 100, 0, 0, 397, 398, 5, 105, 0, 0, 398, - 399, 5, 115, 0, 0, 399, 400, 5, 116, 0, 0, 400, 401, 5, 105, 0, 0, 401, - 402, 5, 110, 0, 0, 402, 403, 5, 99, 0, 0, 403, 404, 5, 116, 0, 0, 404, - 60, 1, 0, 0, 0, 405, 406, 5, 97, 0, 0, 406, 407, 5, 103, 0, 0, 407, 408, - 5, 103, 0, 0, 408, 409, 5, 114, 0, 0, 409, 410, 5, 101, 0, 0, 410, 411, - 5, 103, 0, 0, 411, 412, 5, 97, 0, 0, 412, 413, 5, 116, 0, 0, 413, 414, - 5, 101, 0, 0, 414, 62, 1, 0, 0, 0, 415, 416, 5, 103, 0, 0, 416, 417, 5, - 101, 0, 0, 417, 418, 5, 116, 0, 0, 418, 419, 5, 73, 0, 0, 419, 420, 5, - 110, 0, 0, 420, 421, 5, 100, 0, 0, 421, 422, 5, 101, 0, 0, 422, 423, 5, - 120, 0, 0, 423, 424, 5, 101, 0, 0, 424, 425, 5, 115, 0, 0, 425, 64, 1, - 0, 0, 0, 426, 427, 5, 115, 0, 0, 427, 428, 5, 111, 0, 0, 428, 429, 5, 114, - 0, 0, 429, 430, 5, 116, 0, 0, 430, 66, 1, 0, 0, 0, 431, 432, 5, 108, 0, - 0, 432, 433, 5, 105, 0, 0, 433, 434, 5, 109, 0, 0, 434, 435, 5, 105, 0, - 0, 435, 436, 5, 116, 0, 0, 436, 68, 1, 0, 0, 0, 437, 438, 5, 115, 0, 0, - 438, 439, 5, 107, 0, 0, 439, 440, 5, 105, 0, 0, 440, 441, 5, 112, 0, 0, - 441, 70, 1, 0, 0, 0, 442, 443, 5, 112, 0, 0, 443, 444, 5, 114, 0, 0, 444, - 445, 5, 111, 0, 0, 445, 446, 5, 106, 0, 0, 446, 447, 5, 101, 0, 0, 447, - 448, 5, 99, 0, 0, 448, 449, 5, 116, 0, 0, 449, 450, 5, 105, 0, 0, 450, - 451, 5, 111, 0, 0, 451, 452, 5, 110, 0, 0, 452, 72, 1, 0, 0, 0, 453, 454, - 5, 112, 0, 0, 454, 455, 5, 114, 0, 0, 455, 456, 5, 111, 0, 0, 456, 457, - 5, 106, 0, 0, 457, 458, 5, 101, 0, 0, 458, 459, 5, 99, 0, 0, 459, 460, - 5, 116, 0, 0, 460, 74, 1, 0, 0, 0, 461, 462, 5, 99, 0, 0, 462, 463, 5, - 111, 0, 0, 463, 464, 5, 117, 0, 0, 464, 465, 5, 110, 0, 0, 465, 466, 5, - 116, 0, 0, 466, 76, 1, 0, 0, 0, 467, 468, 5, 40, 0, 0, 468, 78, 1, 0, 0, - 0, 469, 470, 5, 41, 0, 0, 470, 80, 1, 0, 0, 0, 471, 472, 5, 123, 0, 0, - 472, 82, 1, 0, 0, 0, 473, 474, 5, 125, 0, 0, 474, 84, 1, 0, 0, 0, 475, - 476, 5, 91, 0, 0, 476, 86, 1, 0, 0, 0, 477, 478, 5, 93, 0, 0, 478, 88, - 1, 0, 0, 0, 479, 480, 5, 58, 0, 0, 480, 90, 1, 0, 0, 0, 481, 482, 5, 44, - 0, 0, 482, 92, 1, 0, 0, 0, 483, 484, 5, 46, 0, 0, 484, 94, 1, 0, 0, 0, - 485, 486, 5, 59, 0, 0, 486, 96, 1, 0, 0, 0, 487, 488, 5, 36, 0, 0, 488, - 98, 1, 0, 0, 0, 489, 490, 5, 47, 0, 0, 490, 491, 5, 47, 0, 0, 491, 495, - 1, 0, 0, 0, 492, 494, 8, 0, 0, 0, 493, 492, 1, 0, 0, 0, 494, 497, 1, 0, - 0, 0, 495, 493, 1, 0, 0, 0, 495, 496, 1, 0, 0, 0, 496, 498, 1, 0, 0, 0, - 497, 495, 1, 0, 0, 0, 498, 499, 6, 49, 0, 0, 499, 100, 1, 0, 0, 0, 500, - 501, 5, 47, 0, 0, 501, 502, 5, 42, 0, 0, 502, 506, 1, 0, 0, 0, 503, 505, - 9, 0, 0, 0, 504, 503, 1, 0, 0, 0, 505, 508, 1, 0, 0, 0, 506, 507, 1, 0, - 0, 0, 506, 504, 1, 0, 0, 0, 507, 509, 1, 0, 0, 0, 508, 506, 1, 0, 0, 0, - 509, 510, 5, 42, 0, 0, 510, 511, 5, 47, 0, 0, 511, 512, 1, 0, 0, 0, 512, - 513, 6, 50, 0, 0, 513, 102, 1, 0, 0, 0, 514, 515, 5, 47, 0, 0, 515, 516, - 3, 105, 52, 0, 516, 518, 5, 47, 0, 0, 517, 519, 3, 109, 54, 0, 518, 517, - 1, 0, 0, 0, 518, 519, 1, 0, 0, 0, 519, 104, 1, 0, 0, 0, 520, 522, 3, 107, - 53, 0, 521, 520, 1, 0, 0, 0, 522, 523, 1, 0, 0, 0, 523, 521, 1, 0, 0, 0, - 523, 524, 1, 0, 0, 0, 524, 106, 1, 0, 0, 0, 525, 529, 8, 1, 0, 0, 526, - 527, 5, 92, 0, 0, 527, 529, 9, 0, 0, 0, 528, 525, 1, 0, 0, 0, 528, 526, - 1, 0, 0, 0, 529, 108, 1, 0, 0, 0, 530, 532, 7, 2, 0, 0, 531, 530, 1, 0, - 0, 0, 532, 533, 1, 0, 0, 0, 533, 531, 1, 0, 0, 0, 533, 534, 1, 0, 0, 0, - 534, 110, 1, 0, 0, 0, 535, 537, 5, 45, 0, 0, 536, 535, 1, 0, 0, 0, 536, - 537, 1, 0, 0, 0, 537, 538, 1, 0, 0, 0, 538, 545, 3, 113, 56, 0, 539, 541, - 5, 46, 0, 0, 540, 542, 7, 3, 0, 0, 541, 540, 1, 0, 0, 0, 542, 543, 1, 0, - 0, 0, 543, 541, 1, 0, 0, 0, 543, 544, 1, 0, 0, 0, 544, 546, 1, 0, 0, 0, - 545, 539, 1, 0, 0, 0, 545, 546, 1, 0, 0, 0, 546, 548, 1, 0, 0, 0, 547, - 549, 3, 115, 57, 0, 548, 547, 1, 0, 0, 0, 548, 549, 1, 0, 0, 0, 549, 563, - 1, 0, 0, 0, 550, 552, 5, 45, 0, 0, 551, 550, 1, 0, 0, 0, 551, 552, 1, 0, - 0, 0, 552, 553, 1, 0, 0, 0, 553, 555, 5, 46, 0, 0, 554, 556, 7, 3, 0, 0, - 555, 554, 1, 0, 0, 0, 556, 557, 1, 0, 0, 0, 557, 555, 1, 0, 0, 0, 557, - 558, 1, 0, 0, 0, 558, 560, 1, 0, 0, 0, 559, 561, 3, 115, 57, 0, 560, 559, - 1, 0, 0, 0, 560, 561, 1, 0, 0, 0, 561, 563, 1, 0, 0, 0, 562, 536, 1, 0, - 0, 0, 562, 551, 1, 0, 0, 0, 563, 112, 1, 0, 0, 0, 564, 573, 5, 48, 0, 0, - 565, 569, 7, 4, 0, 0, 566, 568, 7, 3, 0, 0, 567, 566, 1, 0, 0, 0, 568, - 571, 1, 0, 0, 0, 569, 567, 1, 0, 0, 0, 569, 570, 1, 0, 0, 0, 570, 573, - 1, 0, 0, 0, 571, 569, 1, 0, 0, 0, 572, 564, 1, 0, 0, 0, 572, 565, 1, 0, - 0, 0, 573, 114, 1, 0, 0, 0, 574, 576, 7, 5, 0, 0, 575, 577, 7, 6, 0, 0, - 576, 575, 1, 0, 0, 0, 576, 577, 1, 0, 0, 0, 577, 579, 1, 0, 0, 0, 578, - 580, 7, 3, 0, 0, 579, 578, 1, 0, 0, 0, 580, 581, 1, 0, 0, 0, 581, 579, - 1, 0, 0, 0, 581, 582, 1, 0, 0, 0, 582, 116, 1, 0, 0, 0, 583, 588, 5, 34, - 0, 0, 584, 587, 3, 121, 60, 0, 585, 587, 8, 7, 0, 0, 586, 584, 1, 0, 0, - 0, 586, 585, 1, 0, 0, 0, 587, 590, 1, 0, 0, 0, 588, 586, 1, 0, 0, 0, 588, - 589, 1, 0, 0, 0, 589, 591, 1, 0, 0, 0, 590, 588, 1, 0, 0, 0, 591, 592, - 5, 34, 0, 0, 592, 118, 1, 0, 0, 0, 593, 598, 5, 39, 0, 0, 594, 597, 3, - 121, 60, 0, 595, 597, 8, 8, 0, 0, 596, 594, 1, 0, 0, 0, 596, 595, 1, 0, - 0, 0, 597, 600, 1, 0, 0, 0, 598, 596, 1, 0, 0, 0, 598, 599, 1, 0, 0, 0, - 599, 601, 1, 0, 0, 0, 600, 598, 1, 0, 0, 0, 601, 602, 5, 39, 0, 0, 602, - 120, 1, 0, 0, 0, 603, 607, 5, 92, 0, 0, 604, 608, 7, 9, 0, 0, 605, 608, - 3, 123, 61, 0, 606, 608, 5, 39, 0, 0, 607, 604, 1, 0, 0, 0, 607, 605, 1, - 0, 0, 0, 607, 606, 1, 0, 0, 0, 608, 122, 1, 0, 0, 0, 609, 610, 5, 117, - 0, 0, 610, 611, 3, 125, 62, 0, 611, 612, 3, 125, 62, 0, 612, 613, 3, 125, - 62, 0, 613, 614, 3, 125, 62, 0, 614, 124, 1, 0, 0, 0, 615, 616, 7, 10, - 0, 0, 616, 126, 1, 0, 0, 0, 617, 621, 7, 11, 0, 0, 618, 620, 7, 12, 0, - 0, 619, 618, 1, 0, 0, 0, 620, 623, 1, 0, 0, 0, 621, 619, 1, 0, 0, 0, 621, - 622, 1, 0, 0, 0, 622, 128, 1, 0, 0, 0, 623, 621, 1, 0, 0, 0, 624, 626, - 7, 13, 0, 0, 625, 624, 1, 0, 0, 0, 626, 627, 1, 0, 0, 0, 627, 625, 1, 0, - 0, 0, 627, 628, 1, 0, 0, 0, 628, 629, 1, 0, 0, 0, 629, 630, 6, 64, 0, 0, - 630, 130, 1, 0, 0, 0, 26, 0, 495, 506, 518, 523, 528, 533, 536, 543, 545, - 548, 551, 557, 560, 562, 569, 572, 576, 581, 586, 588, 596, 598, 607, 621, - 627, 1, 0, 1, 0, + 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, + 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, + 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, + 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, + 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, + 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 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, 19, 1, 19, + 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, + 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, + 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, + 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, + 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, + 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, + 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, + 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, + 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, + 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, + 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, + 31, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, + 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, + 32, 1, 32, 1, 32, 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, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, + 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, + 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, + 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, + 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 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, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, + 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, + 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, + 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, + 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, + 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, 45, 1, 45, 1, + 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 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, + 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, 47, 1, 47, 1, 47, 1, 48, 1, + 48, 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, 49, 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, 51, 1, 51, 1, 51, 1, + 51, 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, 53, 1, 53, 1, 53, 1, 54, 1, 54, 1, + 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, + 1, 54, 1, 54, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, + 55, 1, 55, 1, 56, 1, 56, 1, 56, 1, 56, 1, 56, 1, 56, 1, 56, 1, 56, 1, 56, + 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 58, 1, + 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 59, 1, 59, 1, 59, + 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, + 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, + 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 61, 1, 61, 1, 61, 1, 61, 1, + 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 61, 1, 62, 1, 62, + 1, 62, 1, 62, 1, 62, 1, 62, 1, 62, 1, 62, 1, 62, 1, 63, 1, 63, 1, 63, 1, + 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 64, + 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, + 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, + 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 65, 1, 66, 1, 66, 1, 66, 1, + 66, 1, 66, 1, 66, 1, 66, 1, 66, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, + 1, 67, 1, 67, 1, 67, 1, 67, 1, 67, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, + 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, + 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, + 70, 1, 70, 1, 70, 1, 70, 1, 71, 1, 71, 1, 71, 1, 71, 1, 71, 1, 71, 1, 71, + 1, 71, 1, 71, 1, 71, 1, 71, 1, 71, 1, 71, 1, 72, 1, 72, 1, 72, 1, 72, 1, + 72, 1, 72, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 73, 1, 74, + 1, 74, 1, 74, 1, 75, 1, 75, 1, 75, 1, 76, 1, 76, 1, 76, 1, 77, 1, 77, 1, + 77, 1, 77, 1, 77, 1, 77, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, + 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 79, 1, 79, 1, + 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 79, 1, 80, + 1, 80, 1, 80, 1, 80, 1, 80, 1, 80, 1, 80, 1, 80, 1, 80, 1, 80, 1, 80, 1, + 80, 1, 80, 1, 80, 1, 80, 1, 80, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, + 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, 81, 1, + 81, 1, 81, 1, 82, 1, 82, 1, 82, 1, 82, 1, 82, 1, 82, 1, 82, 1, 82, 1, 82, + 1, 82, 1, 82, 1, 82, 1, 82, 1, 82, 1, 82, 1, 82, 1, 83, 1, 83, 1, 83, 1, + 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 83, 1, 84, 1, 84, + 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, 84, 1, + 84, 1, 84, 1, 84, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, + 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 85, 1, 86, 1, 86, 1, + 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, + 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, 1, 88, 1, + 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 88, 1, 89, 1, 89, 1, 89, 1, 89, + 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 89, 1, 90, 1, 90, 1, + 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, + 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 90, 1, 91, 1, 91, 1, 91, 1, + 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 91, 1, 92, + 1, 92, 1, 92, 1, 92, 1, 92, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, + 94, 1, 94, 1, 94, 1, 94, 1, 94, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, + 1, 95, 1, 95, 1, 95, 1, 95, 1, 95, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, + 96, 1, 96, 1, 96, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 98, 1, 98, + 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, + 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, 1, 98, + 1, 98, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, + 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, + 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 99, 1, 100, 1, 100, 1, 100, 1, 100, + 1, 100, 1, 100, 1, 100, 1, 100, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, + 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, 1, 101, + 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, + 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 103, 1, 104, 1, 104, + 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 105, 1, 105, 1, 105, 1, 105, + 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 106, 1, 106, 1, 106, + 1, 106, 1, 106, 1, 106, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, + 1, 107, 1, 107, 1, 107, 1, 107, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, + 1, 108, 1, 108, 1, 108, 1, 109, 1, 109, 1, 109, 1, 109, 1, 109, 1, 109, + 1, 109, 1, 109, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, + 1, 110, 1, 111, 1, 111, 1, 111, 1, 111, 1, 111, 1, 111, 1, 111, 1, 111, + 1, 112, 1, 112, 1, 112, 1, 112, 1, 112, 1, 113, 1, 113, 1, 113, 1, 113, + 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 114, 1, 114, 1, 114, 1, 114, + 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 114, 1, 115, + 1, 115, 1, 115, 1, 115, 1, 115, 1, 115, 1, 115, 1, 115, 1, 116, 1, 116, + 1, 116, 1, 116, 1, 117, 1, 117, 1, 117, 1, 117, 1, 118, 1, 118, 1, 118, + 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, 1, 118, + 1, 118, 1, 118, 1, 118, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, 1, 119, + 1, 119, 1, 119, 1, 119, 1, 119, 1, 120, 1, 120, 1, 120, 1, 120, 1, 121, + 1, 121, 1, 121, 1, 121, 1, 121, 1, 122, 1, 122, 1, 122, 1, 122, 1, 122, + 1, 122, 1, 122, 1, 122, 1, 122, 1, 122, 1, 122, 1, 122, 1, 122, 1, 122, + 1, 122, 1, 122, 1, 123, 1, 123, 1, 123, 1, 123, 1, 123, 1, 123, 1, 123, + 1, 123, 1, 123, 1, 123, 1, 123, 1, 123, 1, 123, 1, 123, 1, 123, 1, 123, + 1, 124, 1, 124, 1, 124, 1, 124, 1, 124, 1, 124, 1, 124, 1, 125, 1, 125, + 1, 125, 1, 125, 1, 125, 1, 125, 1, 125, 1, 125, 1, 125, 1, 125, 1, 125, + 1, 125, 1, 126, 1, 126, 1, 126, 1, 126, 1, 126, 1, 126, 1, 126, 1, 126, + 1, 126, 1, 127, 1, 127, 1, 127, 1, 127, 1, 127, 1, 127, 1, 127, 1, 127, + 1, 127, 1, 127, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, + 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 1, 128, 1, 129, 1, 129, 1, 129, + 1, 129, 1, 129, 1, 130, 1, 130, 1, 130, 1, 130, 1, 130, 1, 130, 1, 130, + 1, 130, 1, 130, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, 1, 131, + 1, 131, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, 1, 132, + 1, 133, 1, 133, 1, 133, 1, 133, 1, 133, 1, 133, 1, 133, 1, 133, 1, 133, + 1, 133, 1, 133, 1, 133, 1, 133, 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, + 1, 134, 1, 134, 1, 134, 1, 134, 1, 134, 1, 135, 1, 135, 1, 136, 1, 136, + 1, 137, 1, 137, 1, 138, 1, 138, 1, 139, 1, 139, 1, 140, 1, 140, 1, 141, + 1, 141, 1, 142, 1, 142, 1, 143, 1, 143, 1, 144, 1, 144, 1, 145, 1, 145, + 1, 146, 1, 146, 1, 146, 1, 146, 5, 146, 1733, 8, 146, 10, 146, 12, 146, + 1736, 9, 146, 1, 146, 1, 146, 1, 147, 1, 147, 1, 147, 1, 147, 5, 147, 1744, + 8, 147, 10, 147, 12, 147, 1747, 9, 147, 1, 147, 1, 147, 1, 147, 1, 147, + 1, 147, 1, 148, 1, 148, 1, 148, 1, 148, 3, 148, 1758, 8, 148, 1, 149, 4, + 149, 1761, 8, 149, 11, 149, 12, 149, 1762, 1, 150, 1, 150, 1, 150, 3, 150, + 1768, 8, 150, 1, 151, 4, 151, 1771, 8, 151, 11, 151, 12, 151, 1772, 1, + 152, 3, 152, 1776, 8, 152, 1, 152, 1, 152, 1, 152, 4, 152, 1781, 8, 152, + 11, 152, 12, 152, 1782, 3, 152, 1785, 8, 152, 1, 152, 3, 152, 1788, 8, + 152, 1, 152, 3, 152, 1791, 8, 152, 1, 152, 1, 152, 4, 152, 1795, 8, 152, + 11, 152, 12, 152, 1796, 1, 152, 3, 152, 1800, 8, 152, 3, 152, 1802, 8, + 152, 1, 153, 1, 153, 1, 153, 5, 153, 1807, 8, 153, 10, 153, 12, 153, 1810, + 9, 153, 3, 153, 1812, 8, 153, 1, 154, 1, 154, 3, 154, 1816, 8, 154, 1, + 154, 4, 154, 1819, 8, 154, 11, 154, 12, 154, 1820, 1, 155, 1, 155, 1, 155, + 5, 155, 1826, 8, 155, 10, 155, 12, 155, 1829, 9, 155, 1, 155, 1, 155, 1, + 156, 1, 156, 1, 156, 5, 156, 1836, 8, 156, 10, 156, 12, 156, 1839, 9, 156, + 1, 156, 1, 156, 1, 157, 1, 157, 1, 157, 1, 157, 3, 157, 1847, 8, 157, 1, + 158, 1, 158, 1, 158, 1, 158, 1, 158, 1, 158, 1, 159, 1, 159, 1, 160, 1, + 160, 5, 160, 1859, 8, 160, 10, 160, 12, 160, 1862, 9, 160, 1, 161, 4, 161, + 1865, 8, 161, 11, 161, 12, 161, 1866, 1, 161, 1, 161, 1, 1745, 0, 162, + 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, + 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, + 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, + 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, + 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 47, + 95, 48, 97, 49, 99, 50, 101, 51, 103, 52, 105, 53, 107, 54, 109, 55, 111, + 56, 113, 57, 115, 58, 117, 59, 119, 60, 121, 61, 123, 62, 125, 63, 127, + 64, 129, 65, 131, 66, 133, 67, 135, 68, 137, 69, 139, 70, 141, 71, 143, + 72, 145, 73, 147, 74, 149, 75, 151, 76, 153, 77, 155, 78, 157, 79, 159, + 80, 161, 81, 163, 82, 165, 83, 167, 84, 169, 85, 171, 86, 173, 87, 175, + 88, 177, 89, 179, 90, 181, 91, 183, 92, 185, 93, 187, 94, 189, 95, 191, + 96, 193, 97, 195, 98, 197, 99, 199, 100, 201, 101, 203, 102, 205, 103, + 207, 104, 209, 105, 211, 106, 213, 107, 215, 108, 217, 109, 219, 110, 221, + 111, 223, 112, 225, 113, 227, 114, 229, 115, 231, 116, 233, 117, 235, 118, + 237, 119, 239, 120, 241, 121, 243, 122, 245, 123, 247, 124, 249, 125, 251, + 126, 253, 127, 255, 128, 257, 129, 259, 130, 261, 131, 263, 132, 265, 133, + 267, 134, 269, 135, 271, 136, 273, 137, 275, 138, 277, 139, 279, 140, 281, + 141, 283, 142, 285, 143, 287, 144, 289, 145, 291, 146, 293, 147, 295, 148, + 297, 149, 299, 0, 301, 0, 303, 0, 305, 150, 307, 0, 309, 0, 311, 151, 313, + 152, 315, 0, 317, 0, 319, 0, 321, 153, 323, 154, 1, 0, 14, 2, 0, 10, 10, + 13, 13, 4, 0, 10, 10, 13, 13, 47, 47, 92, 92, 6, 0, 103, 103, 105, 105, + 109, 109, 115, 115, 117, 117, 121, 121, 1, 0, 48, 57, 1, 0, 49, 57, 2, + 0, 69, 69, 101, 101, 2, 0, 43, 43, 45, 45, 2, 0, 34, 34, 92, 92, 2, 0, + 39, 39, 92, 92, 8, 0, 34, 34, 47, 47, 92, 92, 98, 98, 102, 102, 110, 110, + 114, 114, 116, 116, 3, 0, 48, 57, 65, 70, 97, 102, 4, 0, 36, 36, 65, 90, + 95, 95, 97, 122, 5, 0, 36, 36, 48, 57, 65, 90, 95, 95, 97, 122, 3, 0, 9, + 10, 13, 13, 32, 32, 1887, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, + 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, + 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, + 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, + 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, + 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, + 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, + 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, + 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, + 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, + 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, + 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, + 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, 0, 0, 97, 1, + 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, 0, 0, 0, 103, 1, 0, 0, 0, 0, + 105, 1, 0, 0, 0, 0, 107, 1, 0, 0, 0, 0, 109, 1, 0, 0, 0, 0, 111, 1, 0, + 0, 0, 0, 113, 1, 0, 0, 0, 0, 115, 1, 0, 0, 0, 0, 117, 1, 0, 0, 0, 0, 119, + 1, 0, 0, 0, 0, 121, 1, 0, 0, 0, 0, 123, 1, 0, 0, 0, 0, 125, 1, 0, 0, 0, + 0, 127, 1, 0, 0, 0, 0, 129, 1, 0, 0, 0, 0, 131, 1, 0, 0, 0, 0, 133, 1, + 0, 0, 0, 0, 135, 1, 0, 0, 0, 0, 137, 1, 0, 0, 0, 0, 139, 1, 0, 0, 0, 0, + 141, 1, 0, 0, 0, 0, 143, 1, 0, 0, 0, 0, 145, 1, 0, 0, 0, 0, 147, 1, 0, + 0, 0, 0, 149, 1, 0, 0, 0, 0, 151, 1, 0, 0, 0, 0, 153, 1, 0, 0, 0, 0, 155, + 1, 0, 0, 0, 0, 157, 1, 0, 0, 0, 0, 159, 1, 0, 0, 0, 0, 161, 1, 0, 0, 0, + 0, 163, 1, 0, 0, 0, 0, 165, 1, 0, 0, 0, 0, 167, 1, 0, 0, 0, 0, 169, 1, + 0, 0, 0, 0, 171, 1, 0, 0, 0, 0, 173, 1, 0, 0, 0, 0, 175, 1, 0, 0, 0, 0, + 177, 1, 0, 0, 0, 0, 179, 1, 0, 0, 0, 0, 181, 1, 0, 0, 0, 0, 183, 1, 0, + 0, 0, 0, 185, 1, 0, 0, 0, 0, 187, 1, 0, 0, 0, 0, 189, 1, 0, 0, 0, 0, 191, + 1, 0, 0, 0, 0, 193, 1, 0, 0, 0, 0, 195, 1, 0, 0, 0, 0, 197, 1, 0, 0, 0, + 0, 199, 1, 0, 0, 0, 0, 201, 1, 0, 0, 0, 0, 203, 1, 0, 0, 0, 0, 205, 1, + 0, 0, 0, 0, 207, 1, 0, 0, 0, 0, 209, 1, 0, 0, 0, 0, 211, 1, 0, 0, 0, 0, + 213, 1, 0, 0, 0, 0, 215, 1, 0, 0, 0, 0, 217, 1, 0, 0, 0, 0, 219, 1, 0, + 0, 0, 0, 221, 1, 0, 0, 0, 0, 223, 1, 0, 0, 0, 0, 225, 1, 0, 0, 0, 0, 227, + 1, 0, 0, 0, 0, 229, 1, 0, 0, 0, 0, 231, 1, 0, 0, 0, 0, 233, 1, 0, 0, 0, + 0, 235, 1, 0, 0, 0, 0, 237, 1, 0, 0, 0, 0, 239, 1, 0, 0, 0, 0, 241, 1, + 0, 0, 0, 0, 243, 1, 0, 0, 0, 0, 245, 1, 0, 0, 0, 0, 247, 1, 0, 0, 0, 0, + 249, 1, 0, 0, 0, 0, 251, 1, 0, 0, 0, 0, 253, 1, 0, 0, 0, 0, 255, 1, 0, + 0, 0, 0, 257, 1, 0, 0, 0, 0, 259, 1, 0, 0, 0, 0, 261, 1, 0, 0, 0, 0, 263, + 1, 0, 0, 0, 0, 265, 1, 0, 0, 0, 0, 267, 1, 0, 0, 0, 0, 269, 1, 0, 0, 0, + 0, 271, 1, 0, 0, 0, 0, 273, 1, 0, 0, 0, 0, 275, 1, 0, 0, 0, 0, 277, 1, + 0, 0, 0, 0, 279, 1, 0, 0, 0, 0, 281, 1, 0, 0, 0, 0, 283, 1, 0, 0, 0, 0, + 285, 1, 0, 0, 0, 0, 287, 1, 0, 0, 0, 0, 289, 1, 0, 0, 0, 0, 291, 1, 0, + 0, 0, 0, 293, 1, 0, 0, 0, 0, 295, 1, 0, 0, 0, 0, 297, 1, 0, 0, 0, 0, 305, + 1, 0, 0, 0, 0, 311, 1, 0, 0, 0, 0, 313, 1, 0, 0, 0, 0, 321, 1, 0, 0, 0, + 0, 323, 1, 0, 0, 0, 1, 325, 1, 0, 0, 0, 3, 330, 1, 0, 0, 0, 5, 334, 1, + 0, 0, 0, 7, 344, 1, 0, 0, 0, 9, 356, 1, 0, 0, 0, 11, 359, 1, 0, 0, 0, 13, + 363, 1, 0, 0, 0, 15, 368, 1, 0, 0, 0, 17, 374, 1, 0, 0, 0, 19, 379, 1, + 0, 0, 0, 21, 393, 1, 0, 0, 0, 23, 412, 1, 0, 0, 0, 25, 431, 1, 0, 0, 0, + 27, 440, 1, 0, 0, 0, 29, 448, 1, 0, 0, 0, 31, 453, 1, 0, 0, 0, 33, 458, + 1, 0, 0, 0, 35, 463, 1, 0, 0, 0, 37, 474, 1, 0, 0, 0, 39, 480, 1, 0, 0, + 0, 41, 490, 1, 0, 0, 0, 43, 497, 1, 0, 0, 0, 45, 508, 1, 0, 0, 0, 47, 522, + 1, 0, 0, 0, 49, 532, 1, 0, 0, 0, 51, 539, 1, 0, 0, 0, 53, 547, 1, 0, 0, + 0, 55, 554, 1, 0, 0, 0, 57, 565, 1, 0, 0, 0, 59, 573, 1, 0, 0, 0, 61, 578, + 1, 0, 0, 0, 63, 586, 1, 0, 0, 0, 65, 601, 1, 0, 0, 0, 67, 624, 1, 0, 0, + 0, 69, 633, 1, 0, 0, 0, 71, 643, 1, 0, 0, 0, 73, 654, 1, 0, 0, 0, 75, 664, + 1, 0, 0, 0, 77, 675, 1, 0, 0, 0, 79, 685, 1, 0, 0, 0, 81, 696, 1, 0, 0, + 0, 83, 706, 1, 0, 0, 0, 85, 717, 1, 0, 0, 0, 87, 728, 1, 0, 0, 0, 89, 745, + 1, 0, 0, 0, 91, 763, 1, 0, 0, 0, 93, 780, 1, 0, 0, 0, 95, 792, 1, 0, 0, + 0, 97, 806, 1, 0, 0, 0, 99, 816, 1, 0, 0, 0, 101, 828, 1, 0, 0, 0, 103, + 833, 1, 0, 0, 0, 105, 850, 1, 0, 0, 0, 107, 856, 1, 0, 0, 0, 109, 868, + 1, 0, 0, 0, 111, 883, 1, 0, 0, 0, 113, 893, 1, 0, 0, 0, 115, 902, 1, 0, + 0, 0, 117, 911, 1, 0, 0, 0, 119, 920, 1, 0, 0, 0, 121, 933, 1, 0, 0, 0, + 123, 950, 1, 0, 0, 0, 125, 963, 1, 0, 0, 0, 127, 972, 1, 0, 0, 0, 129, + 985, 1, 0, 0, 0, 131, 1001, 1, 0, 0, 0, 133, 1014, 1, 0, 0, 0, 135, 1022, + 1, 0, 0, 0, 137, 1033, 1, 0, 0, 0, 139, 1046, 1, 0, 0, 0, 141, 1054, 1, + 0, 0, 0, 143, 1063, 1, 0, 0, 0, 145, 1076, 1, 0, 0, 0, 147, 1082, 1, 0, + 0, 0, 149, 1090, 1, 0, 0, 0, 151, 1093, 1, 0, 0, 0, 153, 1096, 1, 0, 0, + 0, 155, 1099, 1, 0, 0, 0, 157, 1105, 1, 0, 0, 0, 159, 1120, 1, 0, 0, 0, + 161, 1132, 1, 0, 0, 0, 163, 1148, 1, 0, 0, 0, 165, 1166, 1, 0, 0, 0, 167, + 1182, 1, 0, 0, 0, 169, 1194, 1, 0, 0, 0, 171, 1209, 1, 0, 0, 0, 173, 1225, + 1, 0, 0, 0, 175, 1238, 1, 0, 0, 0, 177, 1244, 1, 0, 0, 0, 179, 1255, 1, + 0, 0, 0, 181, 1267, 1, 0, 0, 0, 183, 1287, 1, 0, 0, 0, 185, 1300, 1, 0, + 0, 0, 187, 1305, 1, 0, 0, 0, 189, 1311, 1, 0, 0, 0, 191, 1316, 1, 0, 0, + 0, 193, 1327, 1, 0, 0, 0, 195, 1335, 1, 0, 0, 0, 197, 1341, 1, 0, 0, 0, + 199, 1365, 1, 0, 0, 0, 201, 1391, 1, 0, 0, 0, 203, 1399, 1, 0, 0, 0, 205, + 1413, 1, 0, 0, 0, 207, 1422, 1, 0, 0, 0, 209, 1429, 1, 0, 0, 0, 211, 1436, + 1, 0, 0, 0, 213, 1446, 1, 0, 0, 0, 215, 1452, 1, 0, 0, 0, 217, 1462, 1, + 0, 0, 0, 219, 1470, 1, 0, 0, 0, 221, 1478, 1, 0, 0, 0, 223, 1486, 1, 0, + 0, 0, 225, 1494, 1, 0, 0, 0, 227, 1499, 1, 0, 0, 0, 229, 1508, 1, 0, 0, + 0, 231, 1520, 1, 0, 0, 0, 233, 1528, 1, 0, 0, 0, 235, 1532, 1, 0, 0, 0, + 237, 1536, 1, 0, 0, 0, 239, 1551, 1, 0, 0, 0, 241, 1561, 1, 0, 0, 0, 243, + 1565, 1, 0, 0, 0, 245, 1570, 1, 0, 0, 0, 247, 1586, 1, 0, 0, 0, 249, 1602, + 1, 0, 0, 0, 251, 1609, 1, 0, 0, 0, 253, 1621, 1, 0, 0, 0, 255, 1630, 1, + 0, 0, 0, 257, 1640, 1, 0, 0, 0, 259, 1653, 1, 0, 0, 0, 261, 1658, 1, 0, + 0, 0, 263, 1667, 1, 0, 0, 0, 265, 1675, 1, 0, 0, 0, 267, 1683, 1, 0, 0, + 0, 269, 1696, 1, 0, 0, 0, 271, 1706, 1, 0, 0, 0, 273, 1708, 1, 0, 0, 0, + 275, 1710, 1, 0, 0, 0, 277, 1712, 1, 0, 0, 0, 279, 1714, 1, 0, 0, 0, 281, + 1716, 1, 0, 0, 0, 283, 1718, 1, 0, 0, 0, 285, 1720, 1, 0, 0, 0, 287, 1722, + 1, 0, 0, 0, 289, 1724, 1, 0, 0, 0, 291, 1726, 1, 0, 0, 0, 293, 1728, 1, + 0, 0, 0, 295, 1739, 1, 0, 0, 0, 297, 1753, 1, 0, 0, 0, 299, 1760, 1, 0, + 0, 0, 301, 1767, 1, 0, 0, 0, 303, 1770, 1, 0, 0, 0, 305, 1801, 1, 0, 0, + 0, 307, 1811, 1, 0, 0, 0, 309, 1813, 1, 0, 0, 0, 311, 1822, 1, 0, 0, 0, + 313, 1832, 1, 0, 0, 0, 315, 1842, 1, 0, 0, 0, 317, 1848, 1, 0, 0, 0, 319, + 1854, 1, 0, 0, 0, 321, 1856, 1, 0, 0, 0, 323, 1864, 1, 0, 0, 0, 325, 326, + 5, 115, 0, 0, 326, 327, 5, 104, 0, 0, 327, 328, 5, 111, 0, 0, 328, 329, + 5, 119, 0, 0, 329, 2, 1, 0, 0, 0, 330, 331, 5, 100, 0, 0, 331, 332, 5, + 98, 0, 0, 332, 333, 5, 115, 0, 0, 333, 4, 1, 0, 0, 0, 334, 335, 5, 100, + 0, 0, 335, 336, 5, 97, 0, 0, 336, 337, 5, 116, 0, 0, 337, 338, 5, 97, 0, + 0, 338, 339, 5, 98, 0, 0, 339, 340, 5, 97, 0, 0, 340, 341, 5, 115, 0, 0, + 341, 342, 5, 101, 0, 0, 342, 343, 5, 115, 0, 0, 343, 6, 1, 0, 0, 0, 344, + 345, 5, 99, 0, 0, 345, 346, 5, 111, 0, 0, 346, 347, 5, 108, 0, 0, 347, + 348, 5, 108, 0, 0, 348, 349, 5, 101, 0, 0, 349, 350, 5, 99, 0, 0, 350, + 351, 5, 116, 0, 0, 351, 352, 5, 105, 0, 0, 352, 353, 5, 111, 0, 0, 353, + 354, 5, 110, 0, 0, 354, 355, 5, 115, 0, 0, 355, 8, 1, 0, 0, 0, 356, 357, + 5, 100, 0, 0, 357, 358, 5, 98, 0, 0, 358, 10, 1, 0, 0, 0, 359, 360, 5, + 110, 0, 0, 360, 361, 5, 101, 0, 0, 361, 362, 5, 119, 0, 0, 362, 12, 1, + 0, 0, 0, 363, 364, 5, 116, 0, 0, 364, 365, 5, 114, 0, 0, 365, 366, 5, 117, + 0, 0, 366, 367, 5, 101, 0, 0, 367, 14, 1, 0, 0, 0, 368, 369, 5, 102, 0, + 0, 369, 370, 5, 97, 0, 0, 370, 371, 5, 108, 0, 0, 371, 372, 5, 115, 0, + 0, 372, 373, 5, 101, 0, 0, 373, 16, 1, 0, 0, 0, 374, 375, 5, 110, 0, 0, + 375, 376, 5, 117, 0, 0, 376, 377, 5, 108, 0, 0, 377, 378, 5, 108, 0, 0, + 378, 18, 1, 0, 0, 0, 379, 380, 5, 103, 0, 0, 380, 381, 5, 101, 0, 0, 381, + 382, 5, 116, 0, 0, 382, 383, 5, 67, 0, 0, 383, 384, 5, 111, 0, 0, 384, + 385, 5, 108, 0, 0, 385, 386, 5, 108, 0, 0, 386, 387, 5, 101, 0, 0, 387, + 388, 5, 99, 0, 0, 388, 389, 5, 116, 0, 0, 389, 390, 5, 105, 0, 0, 390, + 391, 5, 111, 0, 0, 391, 392, 5, 110, 0, 0, 392, 20, 1, 0, 0, 0, 393, 394, + 5, 103, 0, 0, 394, 395, 5, 101, 0, 0, 395, 396, 5, 116, 0, 0, 396, 397, + 5, 67, 0, 0, 397, 398, 5, 111, 0, 0, 398, 399, 5, 108, 0, 0, 399, 400, + 5, 108, 0, 0, 400, 401, 5, 101, 0, 0, 401, 402, 5, 99, 0, 0, 402, 403, + 5, 116, 0, 0, 403, 404, 5, 105, 0, 0, 404, 405, 5, 111, 0, 0, 405, 406, + 5, 110, 0, 0, 406, 407, 5, 78, 0, 0, 407, 408, 5, 97, 0, 0, 408, 409, 5, + 109, 0, 0, 409, 410, 5, 101, 0, 0, 410, 411, 5, 115, 0, 0, 411, 22, 1, + 0, 0, 0, 412, 413, 5, 103, 0, 0, 413, 414, 5, 101, 0, 0, 414, 415, 5, 116, + 0, 0, 415, 416, 5, 67, 0, 0, 416, 417, 5, 111, 0, 0, 417, 418, 5, 108, + 0, 0, 418, 419, 5, 108, 0, 0, 419, 420, 5, 101, 0, 0, 420, 421, 5, 99, + 0, 0, 421, 422, 5, 116, 0, 0, 422, 423, 5, 105, 0, 0, 423, 424, 5, 111, + 0, 0, 424, 425, 5, 110, 0, 0, 425, 426, 5, 73, 0, 0, 426, 427, 5, 110, + 0, 0, 427, 428, 5, 102, 0, 0, 428, 429, 5, 111, 0, 0, 429, 430, 5, 115, + 0, 0, 430, 24, 1, 0, 0, 0, 431, 432, 5, 79, 0, 0, 432, 433, 5, 98, 0, 0, + 433, 434, 5, 106, 0, 0, 434, 435, 5, 101, 0, 0, 435, 436, 5, 99, 0, 0, + 436, 437, 5, 116, 0, 0, 437, 438, 5, 73, 0, 0, 438, 439, 5, 100, 0, 0, + 439, 26, 1, 0, 0, 0, 440, 441, 5, 73, 0, 0, 441, 442, 5, 83, 0, 0, 442, + 443, 5, 79, 0, 0, 443, 444, 5, 68, 0, 0, 444, 445, 5, 97, 0, 0, 445, 446, + 5, 116, 0, 0, 446, 447, 5, 101, 0, 0, 447, 28, 1, 0, 0, 0, 448, 449, 5, + 68, 0, 0, 449, 450, 5, 97, 0, 0, 450, 451, 5, 116, 0, 0, 451, 452, 5, 101, + 0, 0, 452, 30, 1, 0, 0, 0, 453, 454, 5, 85, 0, 0, 454, 455, 5, 85, 0, 0, + 455, 456, 5, 73, 0, 0, 456, 457, 5, 68, 0, 0, 457, 32, 1, 0, 0, 0, 458, + 459, 5, 76, 0, 0, 459, 460, 5, 111, 0, 0, 460, 461, 5, 110, 0, 0, 461, + 462, 5, 103, 0, 0, 462, 34, 1, 0, 0, 0, 463, 464, 5, 78, 0, 0, 464, 465, + 5, 117, 0, 0, 465, 466, 5, 109, 0, 0, 466, 467, 5, 98, 0, 0, 467, 468, + 5, 101, 0, 0, 468, 469, 5, 114, 0, 0, 469, 470, 5, 76, 0, 0, 470, 471, + 5, 111, 0, 0, 471, 472, 5, 110, 0, 0, 472, 473, 5, 103, 0, 0, 473, 36, + 1, 0, 0, 0, 474, 475, 5, 73, 0, 0, 475, 476, 5, 110, 0, 0, 476, 477, 5, + 116, 0, 0, 477, 478, 5, 51, 0, 0, 478, 479, 5, 50, 0, 0, 479, 38, 1, 0, + 0, 0, 480, 481, 5, 78, 0, 0, 481, 482, 5, 117, 0, 0, 482, 483, 5, 109, + 0, 0, 483, 484, 5, 98, 0, 0, 484, 485, 5, 101, 0, 0, 485, 486, 5, 114, + 0, 0, 486, 487, 5, 73, 0, 0, 487, 488, 5, 110, 0, 0, 488, 489, 5, 116, + 0, 0, 489, 40, 1, 0, 0, 0, 490, 491, 5, 68, 0, 0, 491, 492, 5, 111, 0, + 0, 492, 493, 5, 117, 0, 0, 493, 494, 5, 98, 0, 0, 494, 495, 5, 108, 0, + 0, 495, 496, 5, 101, 0, 0, 496, 42, 1, 0, 0, 0, 497, 498, 5, 68, 0, 0, + 498, 499, 5, 101, 0, 0, 499, 500, 5, 99, 0, 0, 500, 501, 5, 105, 0, 0, + 501, 502, 5, 109, 0, 0, 502, 503, 5, 97, 0, 0, 503, 504, 5, 108, 0, 0, + 504, 505, 5, 49, 0, 0, 505, 506, 5, 50, 0, 0, 506, 507, 5, 56, 0, 0, 507, + 44, 1, 0, 0, 0, 508, 509, 5, 78, 0, 0, 509, 510, 5, 117, 0, 0, 510, 511, + 5, 109, 0, 0, 511, 512, 5, 98, 0, 0, 512, 513, 5, 101, 0, 0, 513, 514, + 5, 114, 0, 0, 514, 515, 5, 68, 0, 0, 515, 516, 5, 101, 0, 0, 516, 517, + 5, 99, 0, 0, 517, 518, 5, 105, 0, 0, 518, 519, 5, 109, 0, 0, 519, 520, + 5, 97, 0, 0, 520, 521, 5, 108, 0, 0, 521, 46, 1, 0, 0, 0, 522, 523, 5, + 84, 0, 0, 523, 524, 5, 105, 0, 0, 524, 525, 5, 109, 0, 0, 525, 526, 5, + 101, 0, 0, 526, 527, 5, 115, 0, 0, 527, 528, 5, 116, 0, 0, 528, 529, 5, + 97, 0, 0, 529, 530, 5, 109, 0, 0, 530, 531, 5, 112, 0, 0, 531, 48, 1, 0, + 0, 0, 532, 533, 5, 82, 0, 0, 533, 534, 5, 101, 0, 0, 534, 535, 5, 103, + 0, 0, 535, 536, 5, 69, 0, 0, 536, 537, 5, 120, 0, 0, 537, 538, 5, 112, + 0, 0, 538, 50, 1, 0, 0, 0, 539, 540, 5, 66, 0, 0, 540, 541, 5, 105, 0, + 0, 541, 542, 5, 110, 0, 0, 542, 543, 5, 68, 0, 0, 543, 544, 5, 97, 0, 0, + 544, 545, 5, 116, 0, 0, 545, 546, 5, 97, 0, 0, 546, 52, 1, 0, 0, 0, 547, + 548, 5, 66, 0, 0, 548, 549, 5, 105, 0, 0, 549, 550, 5, 110, 0, 0, 550, + 551, 5, 97, 0, 0, 551, 552, 5, 114, 0, 0, 552, 553, 5, 121, 0, 0, 553, + 54, 1, 0, 0, 0, 554, 555, 5, 66, 0, 0, 555, 556, 5, 83, 0, 0, 556, 557, + 5, 79, 0, 0, 557, 558, 5, 78, 0, 0, 558, 559, 5, 82, 0, 0, 559, 560, 5, + 101, 0, 0, 560, 561, 5, 103, 0, 0, 561, 562, 5, 69, 0, 0, 562, 563, 5, + 120, 0, 0, 563, 564, 5, 112, 0, 0, 564, 56, 1, 0, 0, 0, 565, 566, 5, 72, + 0, 0, 566, 567, 5, 101, 0, 0, 567, 568, 5, 120, 0, 0, 568, 569, 5, 68, + 0, 0, 569, 570, 5, 97, 0, 0, 570, 571, 5, 116, 0, 0, 571, 572, 5, 97, 0, + 0, 572, 58, 1, 0, 0, 0, 573, 574, 5, 102, 0, 0, 574, 575, 5, 105, 0, 0, + 575, 576, 5, 110, 0, 0, 576, 577, 5, 100, 0, 0, 577, 60, 1, 0, 0, 0, 578, + 579, 5, 102, 0, 0, 579, 580, 5, 105, 0, 0, 580, 581, 5, 110, 0, 0, 581, + 582, 5, 100, 0, 0, 582, 583, 5, 79, 0, 0, 583, 584, 5, 110, 0, 0, 584, + 585, 5, 101, 0, 0, 585, 62, 1, 0, 0, 0, 586, 587, 5, 99, 0, 0, 587, 588, + 5, 111, 0, 0, 588, 589, 5, 117, 0, 0, 589, 590, 5, 110, 0, 0, 590, 591, + 5, 116, 0, 0, 591, 592, 5, 68, 0, 0, 592, 593, 5, 111, 0, 0, 593, 594, + 5, 99, 0, 0, 594, 595, 5, 117, 0, 0, 595, 596, 5, 109, 0, 0, 596, 597, + 5, 101, 0, 0, 597, 598, 5, 110, 0, 0, 598, 599, 5, 116, 0, 0, 599, 600, + 5, 115, 0, 0, 600, 64, 1, 0, 0, 0, 601, 602, 5, 101, 0, 0, 602, 603, 5, + 115, 0, 0, 603, 604, 5, 116, 0, 0, 604, 605, 5, 105, 0, 0, 605, 606, 5, + 109, 0, 0, 606, 607, 5, 97, 0, 0, 607, 608, 5, 116, 0, 0, 608, 609, 5, + 101, 0, 0, 609, 610, 5, 100, 0, 0, 610, 611, 5, 68, 0, 0, 611, 612, 5, + 111, 0, 0, 612, 613, 5, 99, 0, 0, 613, 614, 5, 117, 0, 0, 614, 615, 5, + 109, 0, 0, 615, 616, 5, 101, 0, 0, 616, 617, 5, 110, 0, 0, 617, 618, 5, + 116, 0, 0, 618, 619, 5, 67, 0, 0, 619, 620, 5, 111, 0, 0, 620, 621, 5, + 117, 0, 0, 621, 622, 5, 110, 0, 0, 622, 623, 5, 116, 0, 0, 623, 66, 1, + 0, 0, 0, 624, 625, 5, 100, 0, 0, 625, 626, 5, 105, 0, 0, 626, 627, 5, 115, + 0, 0, 627, 628, 5, 116, 0, 0, 628, 629, 5, 105, 0, 0, 629, 630, 5, 110, + 0, 0, 630, 631, 5, 99, 0, 0, 631, 632, 5, 116, 0, 0, 632, 68, 1, 0, 0, + 0, 633, 634, 5, 97, 0, 0, 634, 635, 5, 103, 0, 0, 635, 636, 5, 103, 0, + 0, 636, 637, 5, 114, 0, 0, 637, 638, 5, 101, 0, 0, 638, 639, 5, 103, 0, + 0, 639, 640, 5, 97, 0, 0, 640, 641, 5, 116, 0, 0, 641, 642, 5, 101, 0, + 0, 642, 70, 1, 0, 0, 0, 643, 644, 5, 103, 0, 0, 644, 645, 5, 101, 0, 0, + 645, 646, 5, 116, 0, 0, 646, 647, 5, 73, 0, 0, 647, 648, 5, 110, 0, 0, + 648, 649, 5, 100, 0, 0, 649, 650, 5, 101, 0, 0, 650, 651, 5, 120, 0, 0, + 651, 652, 5, 101, 0, 0, 652, 653, 5, 115, 0, 0, 653, 72, 1, 0, 0, 0, 654, + 655, 5, 105, 0, 0, 655, 656, 5, 110, 0, 0, 656, 657, 5, 115, 0, 0, 657, + 658, 5, 101, 0, 0, 658, 659, 5, 114, 0, 0, 659, 660, 5, 116, 0, 0, 660, + 661, 5, 79, 0, 0, 661, 662, 5, 110, 0, 0, 662, 663, 5, 101, 0, 0, 663, + 74, 1, 0, 0, 0, 664, 665, 5, 105, 0, 0, 665, 666, 5, 110, 0, 0, 666, 667, + 5, 115, 0, 0, 667, 668, 5, 101, 0, 0, 668, 669, 5, 114, 0, 0, 669, 670, + 5, 116, 0, 0, 670, 671, 5, 77, 0, 0, 671, 672, 5, 97, 0, 0, 672, 673, 5, + 110, 0, 0, 673, 674, 5, 121, 0, 0, 674, 76, 1, 0, 0, 0, 675, 676, 5, 117, + 0, 0, 676, 677, 5, 112, 0, 0, 677, 678, 5, 100, 0, 0, 678, 679, 5, 97, + 0, 0, 679, 680, 5, 116, 0, 0, 680, 681, 5, 101, 0, 0, 681, 682, 5, 79, + 0, 0, 682, 683, 5, 110, 0, 0, 683, 684, 5, 101, 0, 0, 684, 78, 1, 0, 0, + 0, 685, 686, 5, 117, 0, 0, 686, 687, 5, 112, 0, 0, 687, 688, 5, 100, 0, + 0, 688, 689, 5, 97, 0, 0, 689, 690, 5, 116, 0, 0, 690, 691, 5, 101, 0, + 0, 691, 692, 5, 77, 0, 0, 692, 693, 5, 97, 0, 0, 693, 694, 5, 110, 0, 0, + 694, 695, 5, 121, 0, 0, 695, 80, 1, 0, 0, 0, 696, 697, 5, 100, 0, 0, 697, + 698, 5, 101, 0, 0, 698, 699, 5, 108, 0, 0, 699, 700, 5, 101, 0, 0, 700, + 701, 5, 116, 0, 0, 701, 702, 5, 101, 0, 0, 702, 703, 5, 79, 0, 0, 703, + 704, 5, 110, 0, 0, 704, 705, 5, 101, 0, 0, 705, 82, 1, 0, 0, 0, 706, 707, + 5, 100, 0, 0, 707, 708, 5, 101, 0, 0, 708, 709, 5, 108, 0, 0, 709, 710, + 5, 101, 0, 0, 710, 711, 5, 116, 0, 0, 711, 712, 5, 101, 0, 0, 712, 713, + 5, 77, 0, 0, 713, 714, 5, 97, 0, 0, 714, 715, 5, 110, 0, 0, 715, 716, 5, + 121, 0, 0, 716, 84, 1, 0, 0, 0, 717, 718, 5, 114, 0, 0, 718, 719, 5, 101, + 0, 0, 719, 720, 5, 112, 0, 0, 720, 721, 5, 108, 0, 0, 721, 722, 5, 97, + 0, 0, 722, 723, 5, 99, 0, 0, 723, 724, 5, 101, 0, 0, 724, 725, 5, 79, 0, + 0, 725, 726, 5, 110, 0, 0, 726, 727, 5, 101, 0, 0, 727, 86, 1, 0, 0, 0, + 728, 729, 5, 102, 0, 0, 729, 730, 5, 105, 0, 0, 730, 731, 5, 110, 0, 0, + 731, 732, 5, 100, 0, 0, 732, 733, 5, 79, 0, 0, 733, 734, 5, 110, 0, 0, + 734, 735, 5, 101, 0, 0, 735, 736, 5, 65, 0, 0, 736, 737, 5, 110, 0, 0, + 737, 738, 5, 100, 0, 0, 738, 739, 5, 85, 0, 0, 739, 740, 5, 112, 0, 0, + 740, 741, 5, 100, 0, 0, 741, 742, 5, 97, 0, 0, 742, 743, 5, 116, 0, 0, + 743, 744, 5, 101, 0, 0, 744, 88, 1, 0, 0, 0, 745, 746, 5, 102, 0, 0, 746, + 747, 5, 105, 0, 0, 747, 748, 5, 110, 0, 0, 748, 749, 5, 100, 0, 0, 749, + 750, 5, 79, 0, 0, 750, 751, 5, 110, 0, 0, 751, 752, 5, 101, 0, 0, 752, + 753, 5, 65, 0, 0, 753, 754, 5, 110, 0, 0, 754, 755, 5, 100, 0, 0, 755, + 756, 5, 82, 0, 0, 756, 757, 5, 101, 0, 0, 757, 758, 5, 112, 0, 0, 758, + 759, 5, 108, 0, 0, 759, 760, 5, 97, 0, 0, 760, 761, 5, 99, 0, 0, 761, 762, + 5, 101, 0, 0, 762, 90, 1, 0, 0, 0, 763, 764, 5, 102, 0, 0, 764, 765, 5, + 105, 0, 0, 765, 766, 5, 110, 0, 0, 766, 767, 5, 100, 0, 0, 767, 768, 5, + 79, 0, 0, 768, 769, 5, 110, 0, 0, 769, 770, 5, 101, 0, 0, 770, 771, 5, + 65, 0, 0, 771, 772, 5, 110, 0, 0, 772, 773, 5, 100, 0, 0, 773, 774, 5, + 68, 0, 0, 774, 775, 5, 101, 0, 0, 775, 776, 5, 108, 0, 0, 776, 777, 5, + 101, 0, 0, 777, 778, 5, 116, 0, 0, 778, 779, 5, 101, 0, 0, 779, 92, 1, + 0, 0, 0, 780, 781, 5, 99, 0, 0, 781, 782, 5, 114, 0, 0, 782, 783, 5, 101, + 0, 0, 783, 784, 5, 97, 0, 0, 784, 785, 5, 116, 0, 0, 785, 786, 5, 101, + 0, 0, 786, 787, 5, 73, 0, 0, 787, 788, 5, 110, 0, 0, 788, 789, 5, 100, + 0, 0, 789, 790, 5, 101, 0, 0, 790, 791, 5, 120, 0, 0, 791, 94, 1, 0, 0, + 0, 792, 793, 5, 99, 0, 0, 793, 794, 5, 114, 0, 0, 794, 795, 5, 101, 0, + 0, 795, 796, 5, 97, 0, 0, 796, 797, 5, 116, 0, 0, 797, 798, 5, 101, 0, + 0, 798, 799, 5, 73, 0, 0, 799, 800, 5, 110, 0, 0, 800, 801, 5, 100, 0, + 0, 801, 802, 5, 101, 0, 0, 802, 803, 5, 120, 0, 0, 803, 804, 5, 101, 0, + 0, 804, 805, 5, 115, 0, 0, 805, 96, 1, 0, 0, 0, 806, 807, 5, 100, 0, 0, + 807, 808, 5, 114, 0, 0, 808, 809, 5, 111, 0, 0, 809, 810, 5, 112, 0, 0, + 810, 811, 5, 73, 0, 0, 811, 812, 5, 110, 0, 0, 812, 813, 5, 100, 0, 0, + 813, 814, 5, 101, 0, 0, 814, 815, 5, 120, 0, 0, 815, 98, 1, 0, 0, 0, 816, + 817, 5, 100, 0, 0, 817, 818, 5, 114, 0, 0, 818, 819, 5, 111, 0, 0, 819, + 820, 5, 112, 0, 0, 820, 821, 5, 73, 0, 0, 821, 822, 5, 110, 0, 0, 822, + 823, 5, 100, 0, 0, 823, 824, 5, 101, 0, 0, 824, 825, 5, 120, 0, 0, 825, + 826, 5, 101, 0, 0, 826, 827, 5, 115, 0, 0, 827, 100, 1, 0, 0, 0, 828, 829, + 5, 100, 0, 0, 829, 830, 5, 114, 0, 0, 830, 831, 5, 111, 0, 0, 831, 832, + 5, 112, 0, 0, 832, 102, 1, 0, 0, 0, 833, 834, 5, 114, 0, 0, 834, 835, 5, + 101, 0, 0, 835, 836, 5, 110, 0, 0, 836, 837, 5, 97, 0, 0, 837, 838, 5, + 109, 0, 0, 838, 839, 5, 101, 0, 0, 839, 840, 5, 67, 0, 0, 840, 841, 5, + 111, 0, 0, 841, 842, 5, 108, 0, 0, 842, 843, 5, 108, 0, 0, 843, 844, 5, + 101, 0, 0, 844, 845, 5, 99, 0, 0, 845, 846, 5, 116, 0, 0, 846, 847, 5, + 105, 0, 0, 847, 848, 5, 111, 0, 0, 848, 849, 5, 110, 0, 0, 849, 104, 1, + 0, 0, 0, 850, 851, 5, 115, 0, 0, 851, 852, 5, 116, 0, 0, 852, 853, 5, 97, + 0, 0, 853, 854, 5, 116, 0, 0, 854, 855, 5, 115, 0, 0, 855, 106, 1, 0, 0, + 0, 856, 857, 5, 115, 0, 0, 857, 858, 5, 116, 0, 0, 858, 859, 5, 111, 0, + 0, 859, 860, 5, 114, 0, 0, 860, 861, 5, 97, 0, 0, 861, 862, 5, 103, 0, + 0, 862, 863, 5, 101, 0, 0, 863, 864, 5, 83, 0, 0, 864, 865, 5, 105, 0, + 0, 865, 866, 5, 122, 0, 0, 866, 867, 5, 101, 0, 0, 867, 108, 1, 0, 0, 0, + 868, 869, 5, 116, 0, 0, 869, 870, 5, 111, 0, 0, 870, 871, 5, 116, 0, 0, + 871, 872, 5, 97, 0, 0, 872, 873, 5, 108, 0, 0, 873, 874, 5, 73, 0, 0, 874, + 875, 5, 110, 0, 0, 875, 876, 5, 100, 0, 0, 876, 877, 5, 101, 0, 0, 877, + 878, 5, 120, 0, 0, 878, 879, 5, 83, 0, 0, 879, 880, 5, 105, 0, 0, 880, + 881, 5, 122, 0, 0, 881, 882, 5, 101, 0, 0, 882, 110, 1, 0, 0, 0, 883, 884, + 5, 116, 0, 0, 884, 885, 5, 111, 0, 0, 885, 886, 5, 116, 0, 0, 886, 887, + 5, 97, 0, 0, 887, 888, 5, 108, 0, 0, 888, 889, 5, 83, 0, 0, 889, 890, 5, + 105, 0, 0, 890, 891, 5, 122, 0, 0, 891, 892, 5, 101, 0, 0, 892, 112, 1, + 0, 0, 0, 893, 894, 5, 100, 0, 0, 894, 895, 5, 97, 0, 0, 895, 896, 5, 116, + 0, 0, 896, 897, 5, 97, 0, 0, 897, 898, 5, 83, 0, 0, 898, 899, 5, 105, 0, + 0, 899, 900, 5, 122, 0, 0, 900, 901, 5, 101, 0, 0, 901, 114, 1, 0, 0, 0, + 902, 903, 5, 105, 0, 0, 903, 904, 5, 115, 0, 0, 904, 905, 5, 67, 0, 0, + 905, 906, 5, 97, 0, 0, 906, 907, 5, 112, 0, 0, 907, 908, 5, 112, 0, 0, + 908, 909, 5, 101, 0, 0, 909, 910, 5, 100, 0, 0, 910, 116, 1, 0, 0, 0, 911, + 912, 5, 118, 0, 0, 912, 913, 5, 97, 0, 0, 913, 914, 5, 108, 0, 0, 914, + 915, 5, 105, 0, 0, 915, 916, 5, 100, 0, 0, 916, 917, 5, 97, 0, 0, 917, + 918, 5, 116, 0, 0, 918, 919, 5, 101, 0, 0, 919, 118, 1, 0, 0, 0, 920, 921, + 5, 108, 0, 0, 921, 922, 5, 97, 0, 0, 922, 923, 5, 116, 0, 0, 923, 924, + 5, 101, 0, 0, 924, 925, 5, 110, 0, 0, 925, 926, 5, 99, 0, 0, 926, 927, + 5, 121, 0, 0, 927, 928, 5, 83, 0, 0, 928, 929, 5, 116, 0, 0, 929, 930, + 5, 97, 0, 0, 930, 931, 5, 116, 0, 0, 931, 932, 5, 115, 0, 0, 932, 120, + 1, 0, 0, 0, 933, 934, 5, 99, 0, 0, 934, 935, 5, 114, 0, 0, 935, 936, 5, + 101, 0, 0, 936, 937, 5, 97, 0, 0, 937, 938, 5, 116, 0, 0, 938, 939, 5, + 101, 0, 0, 939, 940, 5, 67, 0, 0, 940, 941, 5, 111, 0, 0, 941, 942, 5, + 108, 0, 0, 942, 943, 5, 108, 0, 0, 943, 944, 5, 101, 0, 0, 944, 945, 5, + 99, 0, 0, 945, 946, 5, 116, 0, 0, 946, 947, 5, 105, 0, 0, 947, 948, 5, + 111, 0, 0, 948, 949, 5, 110, 0, 0, 949, 122, 1, 0, 0, 0, 950, 951, 5, 100, + 0, 0, 951, 952, 5, 114, 0, 0, 952, 953, 5, 111, 0, 0, 953, 954, 5, 112, + 0, 0, 954, 955, 5, 68, 0, 0, 955, 956, 5, 97, 0, 0, 956, 957, 5, 116, 0, + 0, 957, 958, 5, 97, 0, 0, 958, 959, 5, 98, 0, 0, 959, 960, 5, 97, 0, 0, + 960, 961, 5, 115, 0, 0, 961, 962, 5, 101, 0, 0, 962, 124, 1, 0, 0, 0, 963, + 964, 5, 104, 0, 0, 964, 965, 5, 111, 0, 0, 965, 966, 5, 115, 0, 0, 966, + 967, 5, 116, 0, 0, 967, 968, 5, 73, 0, 0, 968, 969, 5, 110, 0, 0, 969, + 970, 5, 102, 0, 0, 970, 971, 5, 111, 0, 0, 971, 126, 1, 0, 0, 0, 972, 973, + 5, 108, 0, 0, 973, 974, 5, 105, 0, 0, 974, 975, 5, 115, 0, 0, 975, 976, + 5, 116, 0, 0, 976, 977, 5, 67, 0, 0, 977, 978, 5, 111, 0, 0, 978, 979, + 5, 109, 0, 0, 979, 980, 5, 109, 0, 0, 980, 981, 5, 97, 0, 0, 981, 982, + 5, 110, 0, 0, 982, 983, 5, 100, 0, 0, 983, 984, 5, 115, 0, 0, 984, 128, + 1, 0, 0, 0, 985, 986, 5, 115, 0, 0, 986, 987, 5, 101, 0, 0, 987, 988, 5, + 114, 0, 0, 988, 989, 5, 118, 0, 0, 989, 990, 5, 101, 0, 0, 990, 991, 5, + 114, 0, 0, 991, 992, 5, 66, 0, 0, 992, 993, 5, 117, 0, 0, 993, 994, 5, + 105, 0, 0, 994, 995, 5, 108, 0, 0, 995, 996, 5, 100, 0, 0, 996, 997, 5, + 73, 0, 0, 997, 998, 5, 110, 0, 0, 998, 999, 5, 102, 0, 0, 999, 1000, 5, + 111, 0, 0, 1000, 130, 1, 0, 0, 0, 1001, 1002, 5, 115, 0, 0, 1002, 1003, + 5, 101, 0, 0, 1003, 1004, 5, 114, 0, 0, 1004, 1005, 5, 118, 0, 0, 1005, + 1006, 5, 101, 0, 0, 1006, 1007, 5, 114, 0, 0, 1007, 1008, 5, 83, 0, 0, + 1008, 1009, 5, 116, 0, 0, 1009, 1010, 5, 97, 0, 0, 1010, 1011, 5, 116, + 0, 0, 1011, 1012, 5, 117, 0, 0, 1012, 1013, 5, 115, 0, 0, 1013, 132, 1, + 0, 0, 0, 1014, 1015, 5, 118, 0, 0, 1015, 1016, 5, 101, 0, 0, 1016, 1017, + 5, 114, 0, 0, 1017, 1018, 5, 115, 0, 0, 1018, 1019, 5, 105, 0, 0, 1019, + 1020, 5, 111, 0, 0, 1020, 1021, 5, 110, 0, 0, 1021, 134, 1, 0, 0, 0, 1022, + 1023, 5, 114, 0, 0, 1023, 1024, 5, 117, 0, 0, 1024, 1025, 5, 110, 0, 0, + 1025, 1026, 5, 67, 0, 0, 1026, 1027, 5, 111, 0, 0, 1027, 1028, 5, 109, + 0, 0, 1028, 1029, 5, 109, 0, 0, 1029, 1030, 5, 97, 0, 0, 1030, 1031, 5, + 110, 0, 0, 1031, 1032, 5, 100, 0, 0, 1032, 136, 1, 0, 0, 0, 1033, 1034, + 5, 97, 0, 0, 1034, 1035, 5, 100, 0, 0, 1035, 1036, 5, 109, 0, 0, 1036, + 1037, 5, 105, 0, 0, 1037, 1038, 5, 110, 0, 0, 1038, 1039, 5, 67, 0, 0, + 1039, 1040, 5, 111, 0, 0, 1040, 1041, 5, 109, 0, 0, 1041, 1042, 5, 109, + 0, 0, 1042, 1043, 5, 97, 0, 0, 1043, 1044, 5, 110, 0, 0, 1044, 1045, 5, + 100, 0, 0, 1045, 138, 1, 0, 0, 0, 1046, 1047, 5, 103, 0, 0, 1047, 1048, + 5, 101, 0, 0, 1048, 1049, 5, 116, 0, 0, 1049, 1050, 5, 78, 0, 0, 1050, + 1051, 5, 97, 0, 0, 1051, 1052, 5, 109, 0, 0, 1052, 1053, 5, 101, 0, 0, + 1053, 140, 1, 0, 0, 0, 1054, 1055, 5, 103, 0, 0, 1055, 1056, 5, 101, 0, + 0, 1056, 1057, 5, 116, 0, 0, 1057, 1058, 5, 77, 0, 0, 1058, 1059, 5, 111, + 0, 0, 1059, 1060, 5, 110, 0, 0, 1060, 1061, 5, 103, 0, 0, 1061, 1062, 5, + 111, 0, 0, 1062, 142, 1, 0, 0, 0, 1063, 1064, 5, 103, 0, 0, 1064, 1065, + 5, 101, 0, 0, 1065, 1066, 5, 116, 0, 0, 1066, 1067, 5, 83, 0, 0, 1067, + 1068, 5, 105, 0, 0, 1068, 1069, 5, 98, 0, 0, 1069, 1070, 5, 108, 0, 0, + 1070, 1071, 5, 105, 0, 0, 1071, 1072, 5, 110, 0, 0, 1072, 1073, 5, 103, + 0, 0, 1073, 1074, 5, 68, 0, 0, 1074, 1075, 5, 66, 0, 0, 1075, 144, 1, 0, + 0, 0, 1076, 1077, 5, 77, 0, 0, 1077, 1078, 5, 111, 0, 0, 1078, 1079, 5, + 110, 0, 0, 1079, 1080, 5, 103, 0, 0, 1080, 1081, 5, 111, 0, 0, 1081, 146, + 1, 0, 0, 0, 1082, 1083, 5, 99, 0, 0, 1083, 1084, 5, 111, 0, 0, 1084, 1085, + 5, 110, 0, 0, 1085, 1086, 5, 110, 0, 0, 1086, 1087, 5, 101, 0, 0, 1087, + 1088, 5, 99, 0, 0, 1088, 1089, 5, 116, 0, 0, 1089, 148, 1, 0, 0, 0, 1090, + 1091, 5, 114, 0, 0, 1091, 1092, 5, 115, 0, 0, 1092, 150, 1, 0, 0, 0, 1093, + 1094, 5, 115, 0, 0, 1094, 1095, 5, 104, 0, 0, 1095, 152, 1, 0, 0, 0, 1096, + 1097, 5, 115, 0, 0, 1097, 1098, 5, 112, 0, 0, 1098, 154, 1, 0, 0, 0, 1099, + 1100, 5, 103, 0, 0, 1100, 1101, 5, 101, 0, 0, 1101, 1102, 5, 116, 0, 0, + 1102, 1103, 5, 68, 0, 0, 1103, 1104, 5, 66, 0, 0, 1104, 156, 1, 0, 0, 0, + 1105, 1106, 5, 103, 0, 0, 1106, 1107, 5, 101, 0, 0, 1107, 1108, 5, 116, + 0, 0, 1108, 1109, 5, 82, 0, 0, 1109, 1110, 5, 101, 0, 0, 1110, 1111, 5, + 97, 0, 0, 1111, 1112, 5, 100, 0, 0, 1112, 1113, 5, 67, 0, 0, 1113, 1114, + 5, 111, 0, 0, 1114, 1115, 5, 110, 0, 0, 1115, 1116, 5, 99, 0, 0, 1116, + 1117, 5, 101, 0, 0, 1117, 1118, 5, 114, 0, 0, 1118, 1119, 5, 110, 0, 0, + 1119, 158, 1, 0, 0, 0, 1120, 1121, 5, 103, 0, 0, 1121, 1122, 5, 101, 0, + 0, 1122, 1123, 5, 116, 0, 0, 1123, 1124, 5, 82, 0, 0, 1124, 1125, 5, 101, + 0, 0, 1125, 1126, 5, 97, 0, 0, 1126, 1127, 5, 100, 0, 0, 1127, 1128, 5, + 80, 0, 0, 1128, 1129, 5, 114, 0, 0, 1129, 1130, 5, 101, 0, 0, 1130, 1131, + 5, 102, 0, 0, 1131, 160, 1, 0, 0, 0, 1132, 1133, 5, 103, 0, 0, 1133, 1134, + 5, 101, 0, 0, 1134, 1135, 5, 116, 0, 0, 1135, 1136, 5, 82, 0, 0, 1136, + 1137, 5, 101, 0, 0, 1137, 1138, 5, 97, 0, 0, 1138, 1139, 5, 100, 0, 0, + 1139, 1140, 5, 80, 0, 0, 1140, 1141, 5, 114, 0, 0, 1141, 1142, 5, 101, + 0, 0, 1142, 1143, 5, 102, 0, 0, 1143, 1144, 5, 77, 0, 0, 1144, 1145, 5, + 111, 0, 0, 1145, 1146, 5, 100, 0, 0, 1146, 1147, 5, 101, 0, 0, 1147, 162, + 1, 0, 0, 0, 1148, 1149, 5, 103, 0, 0, 1149, 1150, 5, 101, 0, 0, 1150, 1151, + 5, 116, 0, 0, 1151, 1152, 5, 82, 0, 0, 1152, 1153, 5, 101, 0, 0, 1153, + 1154, 5, 97, 0, 0, 1154, 1155, 5, 100, 0, 0, 1155, 1156, 5, 80, 0, 0, 1156, + 1157, 5, 114, 0, 0, 1157, 1158, 5, 101, 0, 0, 1158, 1159, 5, 102, 0, 0, + 1159, 1160, 5, 84, 0, 0, 1160, 1161, 5, 97, 0, 0, 1161, 1162, 5, 103, 0, + 0, 1162, 1163, 5, 83, 0, 0, 1163, 1164, 5, 101, 0, 0, 1164, 1165, 5, 116, + 0, 0, 1165, 164, 1, 0, 0, 0, 1166, 1167, 5, 103, 0, 0, 1167, 1168, 5, 101, + 0, 0, 1168, 1169, 5, 116, 0, 0, 1169, 1170, 5, 87, 0, 0, 1170, 1171, 5, + 114, 0, 0, 1171, 1172, 5, 105, 0, 0, 1172, 1173, 5, 116, 0, 0, 1173, 1174, + 5, 101, 0, 0, 1174, 1175, 5, 67, 0, 0, 1175, 1176, 5, 111, 0, 0, 1176, + 1177, 5, 110, 0, 0, 1177, 1178, 5, 99, 0, 0, 1178, 1179, 5, 101, 0, 0, + 1179, 1180, 5, 114, 0, 0, 1180, 1181, 5, 110, 0, 0, 1181, 166, 1, 0, 0, + 0, 1182, 1183, 5, 115, 0, 0, 1183, 1184, 5, 101, 0, 0, 1184, 1185, 5, 116, + 0, 0, 1185, 1186, 5, 82, 0, 0, 1186, 1187, 5, 101, 0, 0, 1187, 1188, 5, + 97, 0, 0, 1188, 1189, 5, 100, 0, 0, 1189, 1190, 5, 80, 0, 0, 1190, 1191, + 5, 114, 0, 0, 1191, 1192, 5, 101, 0, 0, 1192, 1193, 5, 102, 0, 0, 1193, + 168, 1, 0, 0, 0, 1194, 1195, 5, 115, 0, 0, 1195, 1196, 5, 101, 0, 0, 1196, + 1197, 5, 116, 0, 0, 1197, 1198, 5, 82, 0, 0, 1198, 1199, 5, 101, 0, 0, + 1199, 1200, 5, 97, 0, 0, 1200, 1201, 5, 100, 0, 0, 1201, 1202, 5, 67, 0, + 0, 1202, 1203, 5, 111, 0, 0, 1203, 1204, 5, 110, 0, 0, 1204, 1205, 5, 99, + 0, 0, 1205, 1206, 5, 101, 0, 0, 1206, 1207, 5, 114, 0, 0, 1207, 1208, 5, + 110, 0, 0, 1208, 170, 1, 0, 0, 0, 1209, 1210, 5, 115, 0, 0, 1210, 1211, + 5, 101, 0, 0, 1211, 1212, 5, 116, 0, 0, 1212, 1213, 5, 87, 0, 0, 1213, + 1214, 5, 114, 0, 0, 1214, 1215, 5, 105, 0, 0, 1215, 1216, 5, 116, 0, 0, + 1216, 1217, 5, 101, 0, 0, 1217, 1218, 5, 67, 0, 0, 1218, 1219, 5, 111, + 0, 0, 1219, 1220, 5, 110, 0, 0, 1220, 1221, 5, 99, 0, 0, 1221, 1222, 5, + 101, 0, 0, 1222, 1223, 5, 114, 0, 0, 1223, 1224, 5, 110, 0, 0, 1224, 172, + 1, 0, 0, 0, 1225, 1226, 5, 115, 0, 0, 1226, 1227, 5, 116, 0, 0, 1227, 1228, + 5, 97, 0, 0, 1228, 1229, 5, 114, 0, 0, 1229, 1230, 5, 116, 0, 0, 1230, + 1231, 5, 83, 0, 0, 1231, 1232, 5, 101, 0, 0, 1232, 1233, 5, 115, 0, 0, + 1233, 1234, 5, 115, 0, 0, 1234, 1235, 5, 105, 0, 0, 1235, 1236, 5, 111, + 0, 0, 1236, 1237, 5, 110, 0, 0, 1237, 174, 1, 0, 0, 0, 1238, 1239, 5, 119, + 0, 0, 1239, 1240, 5, 97, 0, 0, 1240, 1241, 5, 116, 0, 0, 1241, 1242, 5, + 99, 0, 0, 1242, 1243, 5, 104, 0, 0, 1243, 176, 1, 0, 0, 0, 1244, 1245, + 5, 103, 0, 0, 1245, 1246, 5, 101, 0, 0, 1246, 1247, 5, 116, 0, 0, 1247, + 1248, 5, 68, 0, 0, 1248, 1249, 5, 66, 0, 0, 1249, 1250, 5, 78, 0, 0, 1250, + 1251, 5, 97, 0, 0, 1251, 1252, 5, 109, 0, 0, 1252, 1253, 5, 101, 0, 0, + 1253, 1254, 5, 115, 0, 0, 1254, 178, 1, 0, 0, 0, 1255, 1256, 5, 103, 0, + 0, 1256, 1257, 5, 101, 0, 0, 1257, 1258, 5, 116, 0, 0, 1258, 1259, 5, 75, + 0, 0, 1259, 1260, 5, 101, 0, 0, 1260, 1261, 5, 121, 0, 0, 1261, 1262, 5, + 86, 0, 0, 1262, 1263, 5, 97, 0, 0, 1263, 1264, 5, 117, 0, 0, 1264, 1265, + 5, 108, 0, 0, 1265, 1266, 5, 116, 0, 0, 1266, 180, 1, 0, 0, 0, 1267, 1268, + 5, 103, 0, 0, 1268, 1269, 5, 101, 0, 0, 1269, 1270, 5, 116, 0, 0, 1270, + 1271, 5, 67, 0, 0, 1271, 1272, 5, 108, 0, 0, 1272, 1273, 5, 105, 0, 0, + 1273, 1274, 5, 101, 0, 0, 1274, 1275, 5, 110, 0, 0, 1275, 1276, 5, 116, + 0, 0, 1276, 1277, 5, 69, 0, 0, 1277, 1278, 5, 110, 0, 0, 1278, 1279, 5, + 99, 0, 0, 1279, 1280, 5, 114, 0, 0, 1280, 1281, 5, 121, 0, 0, 1281, 1282, + 5, 112, 0, 0, 1282, 1283, 5, 116, 0, 0, 1283, 1284, 5, 105, 0, 0, 1284, + 1285, 5, 111, 0, 0, 1285, 1286, 5, 110, 0, 0, 1286, 182, 1, 0, 0, 0, 1287, + 1288, 5, 103, 0, 0, 1288, 1289, 5, 101, 0, 0, 1289, 1290, 5, 116, 0, 0, + 1290, 1291, 5, 80, 0, 0, 1291, 1292, 5, 108, 0, 0, 1292, 1293, 5, 97, 0, + 0, 1293, 1294, 5, 110, 0, 0, 1294, 1295, 5, 67, 0, 0, 1295, 1296, 5, 97, + 0, 0, 1296, 1297, 5, 99, 0, 0, 1297, 1298, 5, 104, 0, 0, 1298, 1299, 5, + 101, 0, 0, 1299, 184, 1, 0, 0, 0, 1300, 1301, 5, 115, 0, 0, 1301, 1302, + 5, 111, 0, 0, 1302, 1303, 5, 114, 0, 0, 1303, 1304, 5, 116, 0, 0, 1304, + 186, 1, 0, 0, 0, 1305, 1306, 5, 108, 0, 0, 1306, 1307, 5, 105, 0, 0, 1307, + 1308, 5, 109, 0, 0, 1308, 1309, 5, 105, 0, 0, 1309, 1310, 5, 116, 0, 0, + 1310, 188, 1, 0, 0, 0, 1311, 1312, 5, 115, 0, 0, 1312, 1313, 5, 107, 0, + 0, 1313, 1314, 5, 105, 0, 0, 1314, 1315, 5, 112, 0, 0, 1315, 190, 1, 0, + 0, 0, 1316, 1317, 5, 112, 0, 0, 1317, 1318, 5, 114, 0, 0, 1318, 1319, 5, + 111, 0, 0, 1319, 1320, 5, 106, 0, 0, 1320, 1321, 5, 101, 0, 0, 1321, 1322, + 5, 99, 0, 0, 1322, 1323, 5, 116, 0, 0, 1323, 1324, 5, 105, 0, 0, 1324, + 1325, 5, 111, 0, 0, 1325, 1326, 5, 110, 0, 0, 1326, 192, 1, 0, 0, 0, 1327, + 1328, 5, 112, 0, 0, 1328, 1329, 5, 114, 0, 0, 1329, 1330, 5, 111, 0, 0, + 1330, 1331, 5, 106, 0, 0, 1331, 1332, 5, 101, 0, 0, 1332, 1333, 5, 99, + 0, 0, 1333, 1334, 5, 116, 0, 0, 1334, 194, 1, 0, 0, 0, 1335, 1336, 5, 99, + 0, 0, 1336, 1337, 5, 111, 0, 0, 1337, 1338, 5, 117, 0, 0, 1338, 1339, 5, + 110, 0, 0, 1339, 1340, 5, 116, 0, 0, 1340, 196, 1, 0, 0, 0, 1341, 1342, + 5, 105, 0, 0, 1342, 1343, 5, 110, 0, 0, 1343, 1344, 5, 105, 0, 0, 1344, + 1345, 5, 116, 0, 0, 1345, 1346, 5, 105, 0, 0, 1346, 1347, 5, 97, 0, 0, + 1347, 1348, 5, 108, 0, 0, 1348, 1349, 5, 105, 0, 0, 1349, 1350, 5, 122, + 0, 0, 1350, 1351, 5, 101, 0, 0, 1351, 1352, 5, 79, 0, 0, 1352, 1353, 5, + 114, 0, 0, 1353, 1354, 5, 100, 0, 0, 1354, 1355, 5, 101, 0, 0, 1355, 1356, + 5, 114, 0, 0, 1356, 1357, 5, 101, 0, 0, 1357, 1358, 5, 100, 0, 0, 1358, + 1359, 5, 66, 0, 0, 1359, 1360, 5, 117, 0, 0, 1360, 1361, 5, 108, 0, 0, + 1361, 1362, 5, 107, 0, 0, 1362, 1363, 5, 79, 0, 0, 1363, 1364, 5, 112, + 0, 0, 1364, 198, 1, 0, 0, 0, 1365, 1366, 5, 105, 0, 0, 1366, 1367, 5, 110, + 0, 0, 1367, 1368, 5, 105, 0, 0, 1368, 1369, 5, 116, 0, 0, 1369, 1370, 5, + 105, 0, 0, 1370, 1371, 5, 97, 0, 0, 1371, 1372, 5, 108, 0, 0, 1372, 1373, + 5, 105, 0, 0, 1373, 1374, 5, 122, 0, 0, 1374, 1375, 5, 101, 0, 0, 1375, + 1376, 5, 85, 0, 0, 1376, 1377, 5, 110, 0, 0, 1377, 1378, 5, 111, 0, 0, + 1378, 1379, 5, 114, 0, 0, 1379, 1380, 5, 100, 0, 0, 1380, 1381, 5, 101, + 0, 0, 1381, 1382, 5, 114, 0, 0, 1382, 1383, 5, 101, 0, 0, 1383, 1384, 5, + 100, 0, 0, 1384, 1385, 5, 66, 0, 0, 1385, 1386, 5, 117, 0, 0, 1386, 1387, + 5, 108, 0, 0, 1387, 1388, 5, 107, 0, 0, 1388, 1389, 5, 79, 0, 0, 1389, + 1390, 5, 112, 0, 0, 1390, 200, 1, 0, 0, 0, 1391, 1392, 5, 101, 0, 0, 1392, + 1393, 5, 120, 0, 0, 1393, 1394, 5, 101, 0, 0, 1394, 1395, 5, 99, 0, 0, + 1395, 1396, 5, 117, 0, 0, 1396, 1397, 5, 116, 0, 0, 1397, 1398, 5, 101, + 0, 0, 1398, 202, 1, 0, 0, 0, 1399, 1400, 5, 103, 0, 0, 1400, 1401, 5, 101, + 0, 0, 1401, 1402, 5, 116, 0, 0, 1402, 1403, 5, 79, 0, 0, 1403, 1404, 5, + 112, 0, 0, 1404, 1405, 5, 101, 0, 0, 1405, 1406, 5, 114, 0, 0, 1406, 1407, + 5, 97, 0, 0, 1407, 1408, 5, 116, 0, 0, 1408, 1409, 5, 105, 0, 0, 1409, + 1410, 5, 111, 0, 0, 1410, 1411, 5, 110, 0, 0, 1411, 1412, 5, 115, 0, 0, + 1412, 204, 1, 0, 0, 0, 1413, 1414, 5, 116, 0, 0, 1414, 1415, 5, 111, 0, + 0, 1415, 1416, 5, 83, 0, 0, 1416, 1417, 5, 116, 0, 0, 1417, 1418, 5, 114, + 0, 0, 1418, 1419, 5, 105, 0, 0, 1419, 1420, 5, 110, 0, 0, 1420, 1421, 5, + 103, 0, 0, 1421, 206, 1, 0, 0, 0, 1422, 1423, 5, 105, 0, 0, 1423, 1424, + 5, 110, 0, 0, 1424, 1425, 5, 115, 0, 0, 1425, 1426, 5, 101, 0, 0, 1426, + 1427, 5, 114, 0, 0, 1427, 1428, 5, 116, 0, 0, 1428, 208, 1, 0, 0, 0, 1429, + 1430, 5, 114, 0, 0, 1430, 1431, 5, 101, 0, 0, 1431, 1432, 5, 109, 0, 0, + 1432, 1433, 5, 111, 0, 0, 1433, 1434, 5, 118, 0, 0, 1434, 1435, 5, 101, + 0, 0, 1435, 210, 1, 0, 0, 0, 1436, 1437, 5, 98, 0, 0, 1437, 1438, 5, 97, + 0, 0, 1438, 1439, 5, 116, 0, 0, 1439, 1440, 5, 99, 0, 0, 1440, 1441, 5, + 104, 0, 0, 1441, 1442, 5, 83, 0, 0, 1442, 1443, 5, 105, 0, 0, 1443, 1444, + 5, 122, 0, 0, 1444, 1445, 5, 101, 0, 0, 1445, 212, 1, 0, 0, 0, 1446, 1447, + 5, 99, 0, 0, 1447, 1448, 5, 108, 0, 0, 1448, 1449, 5, 111, 0, 0, 1449, + 1450, 5, 115, 0, 0, 1450, 1451, 5, 101, 0, 0, 1451, 214, 1, 0, 0, 0, 1452, + 1453, 5, 99, 0, 0, 1453, 1454, 5, 111, 0, 0, 1454, 1455, 5, 108, 0, 0, + 1455, 1456, 5, 108, 0, 0, 1456, 1457, 5, 97, 0, 0, 1457, 1458, 5, 116, + 0, 0, 1458, 1459, 5, 105, 0, 0, 1459, 1460, 5, 111, 0, 0, 1460, 1461, 5, + 110, 0, 0, 1461, 216, 1, 0, 0, 0, 1462, 1463, 5, 99, 0, 0, 1463, 1464, + 5, 111, 0, 0, 1464, 1465, 5, 109, 0, 0, 1465, 1466, 5, 109, 0, 0, 1466, + 1467, 5, 101, 0, 0, 1467, 1468, 5, 110, 0, 0, 1468, 1469, 5, 116, 0, 0, + 1469, 218, 1, 0, 0, 0, 1470, 1471, 5, 101, 0, 0, 1471, 1472, 5, 120, 0, + 0, 1472, 1473, 5, 112, 0, 0, 1473, 1474, 5, 108, 0, 0, 1474, 1475, 5, 97, + 0, 0, 1475, 1476, 5, 105, 0, 0, 1476, 1477, 5, 110, 0, 0, 1477, 220, 1, + 0, 0, 0, 1478, 1479, 5, 102, 0, 0, 1479, 1480, 5, 111, 0, 0, 1480, 1481, + 5, 114, 0, 0, 1481, 1482, 5, 69, 0, 0, 1482, 1483, 5, 97, 0, 0, 1483, 1484, + 5, 99, 0, 0, 1484, 1485, 5, 104, 0, 0, 1485, 222, 1, 0, 0, 0, 1486, 1487, + 5, 104, 0, 0, 1487, 1488, 5, 97, 0, 0, 1488, 1489, 5, 115, 0, 0, 1489, + 1490, 5, 78, 0, 0, 1490, 1491, 5, 101, 0, 0, 1491, 1492, 5, 120, 0, 0, + 1492, 1493, 5, 116, 0, 0, 1493, 224, 1, 0, 0, 0, 1494, 1495, 5, 104, 0, + 0, 1495, 1496, 5, 105, 0, 0, 1496, 1497, 5, 110, 0, 0, 1497, 1498, 5, 116, + 0, 0, 1498, 226, 1, 0, 0, 0, 1499, 1500, 5, 105, 0, 0, 1500, 1501, 5, 115, + 0, 0, 1501, 1502, 5, 67, 0, 0, 1502, 1503, 5, 108, 0, 0, 1503, 1504, 5, + 111, 0, 0, 1504, 1505, 5, 115, 0, 0, 1505, 1506, 5, 101, 0, 0, 1506, 1507, + 5, 100, 0, 0, 1507, 228, 1, 0, 0, 0, 1508, 1509, 5, 105, 0, 0, 1509, 1510, + 5, 115, 0, 0, 1510, 1511, 5, 69, 0, 0, 1511, 1512, 5, 120, 0, 0, 1512, + 1513, 5, 104, 0, 0, 1513, 1514, 5, 97, 0, 0, 1514, 1515, 5, 117, 0, 0, + 1515, 1516, 5, 115, 0, 0, 1516, 1517, 5, 116, 0, 0, 1517, 1518, 5, 101, + 0, 0, 1518, 1519, 5, 100, 0, 0, 1519, 230, 1, 0, 0, 0, 1520, 1521, 5, 105, + 0, 0, 1521, 1522, 5, 116, 0, 0, 1522, 1523, 5, 99, 0, 0, 1523, 1524, 5, + 111, 0, 0, 1524, 1525, 5, 117, 0, 0, 1525, 1526, 5, 110, 0, 0, 1526, 1527, + 5, 116, 0, 0, 1527, 232, 1, 0, 0, 0, 1528, 1529, 5, 109, 0, 0, 1529, 1530, + 5, 97, 0, 0, 1530, 1531, 5, 112, 0, 0, 1531, 234, 1, 0, 0, 0, 1532, 1533, + 5, 109, 0, 0, 1533, 1534, 5, 97, 0, 0, 1534, 1535, 5, 120, 0, 0, 1535, + 236, 1, 0, 0, 0, 1536, 1537, 5, 109, 0, 0, 1537, 1538, 5, 97, 0, 0, 1538, + 1539, 5, 120, 0, 0, 1539, 1540, 5, 65, 0, 0, 1540, 1541, 5, 119, 0, 0, + 1541, 1542, 5, 97, 0, 0, 1542, 1543, 5, 105, 0, 0, 1543, 1544, 5, 116, + 0, 0, 1544, 1545, 5, 84, 0, 0, 1545, 1546, 5, 105, 0, 0, 1546, 1547, 5, + 109, 0, 0, 1547, 1548, 5, 101, 0, 0, 1548, 1549, 5, 77, 0, 0, 1549, 1550, + 5, 83, 0, 0, 1550, 238, 1, 0, 0, 0, 1551, 1552, 5, 109, 0, 0, 1552, 1553, + 5, 97, 0, 0, 1553, 1554, 5, 120, 0, 0, 1554, 1555, 5, 84, 0, 0, 1555, 1556, + 5, 105, 0, 0, 1556, 1557, 5, 109, 0, 0, 1557, 1558, 5, 101, 0, 0, 1558, + 1559, 5, 77, 0, 0, 1559, 1560, 5, 83, 0, 0, 1560, 240, 1, 0, 0, 0, 1561, + 1562, 5, 109, 0, 0, 1562, 1563, 5, 105, 0, 0, 1563, 1564, 5, 110, 0, 0, + 1564, 242, 1, 0, 0, 0, 1565, 1566, 5, 110, 0, 0, 1566, 1567, 5, 101, 0, + 0, 1567, 1568, 5, 120, 0, 0, 1568, 1569, 5, 116, 0, 0, 1569, 244, 1, 0, + 0, 0, 1570, 1571, 5, 110, 0, 0, 1571, 1572, 5, 111, 0, 0, 1572, 1573, 5, + 67, 0, 0, 1573, 1574, 5, 117, 0, 0, 1574, 1575, 5, 114, 0, 0, 1575, 1576, + 5, 115, 0, 0, 1576, 1577, 5, 111, 0, 0, 1577, 1578, 5, 114, 0, 0, 1578, + 1579, 5, 84, 0, 0, 1579, 1580, 5, 105, 0, 0, 1580, 1581, 5, 109, 0, 0, + 1581, 1582, 5, 101, 0, 0, 1582, 1583, 5, 111, 0, 0, 1583, 1584, 5, 117, + 0, 0, 1584, 1585, 5, 116, 0, 0, 1585, 246, 1, 0, 0, 0, 1586, 1587, 5, 111, + 0, 0, 1587, 1588, 5, 98, 0, 0, 1588, 1589, 5, 106, 0, 0, 1589, 1590, 5, + 115, 0, 0, 1590, 1591, 5, 76, 0, 0, 1591, 1592, 5, 101, 0, 0, 1592, 1593, + 5, 102, 0, 0, 1593, 1594, 5, 116, 0, 0, 1594, 1595, 5, 73, 0, 0, 1595, + 1596, 5, 110, 0, 0, 1596, 1597, 5, 66, 0, 0, 1597, 1598, 5, 97, 0, 0, 1598, + 1599, 5, 116, 0, 0, 1599, 1600, 5, 99, 0, 0, 1600, 1601, 5, 104, 0, 0, + 1601, 248, 1, 0, 0, 0, 1602, 1603, 5, 112, 0, 0, 1603, 1604, 5, 114, 0, + 0, 1604, 1605, 5, 101, 0, 0, 1605, 1606, 5, 116, 0, 0, 1606, 1607, 5, 116, + 0, 0, 1607, 1608, 5, 121, 0, 0, 1608, 250, 1, 0, 0, 0, 1609, 1610, 5, 114, + 0, 0, 1610, 1611, 5, 101, 0, 0, 1611, 1612, 5, 97, 0, 0, 1612, 1613, 5, + 100, 0, 0, 1613, 1614, 5, 67, 0, 0, 1614, 1615, 5, 111, 0, 0, 1615, 1616, + 5, 110, 0, 0, 1616, 1617, 5, 99, 0, 0, 1617, 1618, 5, 101, 0, 0, 1618, + 1619, 5, 114, 0, 0, 1619, 1620, 5, 110, 0, 0, 1620, 252, 1, 0, 0, 0, 1621, + 1622, 5, 114, 0, 0, 1622, 1623, 5, 101, 0, 0, 1623, 1624, 5, 97, 0, 0, + 1624, 1625, 5, 100, 0, 0, 1625, 1626, 5, 80, 0, 0, 1626, 1627, 5, 114, + 0, 0, 1627, 1628, 5, 101, 0, 0, 1628, 1629, 5, 102, 0, 0, 1629, 254, 1, + 0, 0, 0, 1630, 1631, 5, 114, 0, 0, 1631, 1632, 5, 101, 0, 0, 1632, 1633, + 5, 116, 0, 0, 1633, 1634, 5, 117, 0, 0, 1634, 1635, 5, 114, 0, 0, 1635, + 1636, 5, 110, 0, 0, 1636, 1637, 5, 75, 0, 0, 1637, 1638, 5, 101, 0, 0, + 1638, 1639, 5, 121, 0, 0, 1639, 256, 1, 0, 0, 0, 1640, 1641, 5, 115, 0, + 0, 1641, 1642, 5, 104, 0, 0, 1642, 1643, 5, 111, 0, 0, 1643, 1644, 5, 119, + 0, 0, 1644, 1645, 5, 82, 0, 0, 1645, 1646, 5, 101, 0, 0, 1646, 1647, 5, + 99, 0, 0, 1647, 1648, 5, 111, 0, 0, 1648, 1649, 5, 114, 0, 0, 1649, 1650, + 5, 100, 0, 0, 1650, 1651, 5, 73, 0, 0, 1651, 1652, 5, 100, 0, 0, 1652, + 258, 1, 0, 0, 0, 1653, 1654, 5, 115, 0, 0, 1654, 1655, 5, 105, 0, 0, 1655, + 1656, 5, 122, 0, 0, 1656, 1657, 5, 101, 0, 0, 1657, 260, 1, 0, 0, 0, 1658, + 1659, 5, 116, 0, 0, 1659, 1660, 5, 97, 0, 0, 1660, 1661, 5, 105, 0, 0, + 1661, 1662, 5, 108, 0, 0, 1662, 1663, 5, 97, 0, 0, 1663, 1664, 5, 98, 0, + 0, 1664, 1665, 5, 108, 0, 0, 1665, 1666, 5, 101, 0, 0, 1666, 262, 1, 0, + 0, 0, 1667, 1668, 5, 116, 0, 0, 1668, 1669, 5, 111, 0, 0, 1669, 1670, 5, + 65, 0, 0, 1670, 1671, 5, 114, 0, 0, 1671, 1672, 5, 114, 0, 0, 1672, 1673, + 5, 97, 0, 0, 1673, 1674, 5, 121, 0, 0, 1674, 264, 1, 0, 0, 0, 1675, 1676, + 5, 116, 0, 0, 1676, 1677, 5, 114, 0, 0, 1677, 1678, 5, 121, 0, 0, 1678, + 1679, 5, 78, 0, 0, 1679, 1680, 5, 101, 0, 0, 1680, 1681, 5, 120, 0, 0, + 1681, 1682, 5, 116, 0, 0, 1682, 266, 1, 0, 0, 0, 1683, 1684, 5, 97, 0, + 0, 1684, 1685, 5, 108, 0, 0, 1685, 1686, 5, 108, 0, 0, 1686, 1687, 5, 111, + 0, 0, 1687, 1688, 5, 119, 0, 0, 1688, 1689, 5, 68, 0, 0, 1689, 1690, 5, + 105, 0, 0, 1690, 1691, 5, 115, 0, 0, 1691, 1692, 5, 107, 0, 0, 1692, 1693, + 5, 85, 0, 0, 1693, 1694, 5, 115, 0, 0, 1694, 1695, 5, 101, 0, 0, 1695, + 268, 1, 0, 0, 0, 1696, 1697, 5, 97, 0, 0, 1697, 1698, 5, 100, 0, 0, 1698, + 1699, 5, 100, 0, 0, 1699, 1700, 5, 79, 0, 0, 1700, 1701, 5, 112, 0, 0, + 1701, 1702, 5, 116, 0, 0, 1702, 1703, 5, 105, 0, 0, 1703, 1704, 5, 111, + 0, 0, 1704, 1705, 5, 110, 0, 0, 1705, 270, 1, 0, 0, 0, 1706, 1707, 5, 40, + 0, 0, 1707, 272, 1, 0, 0, 0, 1708, 1709, 5, 41, 0, 0, 1709, 274, 1, 0, + 0, 0, 1710, 1711, 5, 123, 0, 0, 1711, 276, 1, 0, 0, 0, 1712, 1713, 5, 125, + 0, 0, 1713, 278, 1, 0, 0, 0, 1714, 1715, 5, 91, 0, 0, 1715, 280, 1, 0, + 0, 0, 1716, 1717, 5, 93, 0, 0, 1717, 282, 1, 0, 0, 0, 1718, 1719, 5, 58, + 0, 0, 1719, 284, 1, 0, 0, 0, 1720, 1721, 5, 44, 0, 0, 1721, 286, 1, 0, + 0, 0, 1722, 1723, 5, 46, 0, 0, 1723, 288, 1, 0, 0, 0, 1724, 1725, 5, 59, + 0, 0, 1725, 290, 1, 0, 0, 0, 1726, 1727, 5, 36, 0, 0, 1727, 292, 1, 0, + 0, 0, 1728, 1729, 5, 47, 0, 0, 1729, 1730, 5, 47, 0, 0, 1730, 1734, 1, + 0, 0, 0, 1731, 1733, 8, 0, 0, 0, 1732, 1731, 1, 0, 0, 0, 1733, 1736, 1, + 0, 0, 0, 1734, 1732, 1, 0, 0, 0, 1734, 1735, 1, 0, 0, 0, 1735, 1737, 1, + 0, 0, 0, 1736, 1734, 1, 0, 0, 0, 1737, 1738, 6, 146, 0, 0, 1738, 294, 1, + 0, 0, 0, 1739, 1740, 5, 47, 0, 0, 1740, 1741, 5, 42, 0, 0, 1741, 1745, + 1, 0, 0, 0, 1742, 1744, 9, 0, 0, 0, 1743, 1742, 1, 0, 0, 0, 1744, 1747, + 1, 0, 0, 0, 1745, 1746, 1, 0, 0, 0, 1745, 1743, 1, 0, 0, 0, 1746, 1748, + 1, 0, 0, 0, 1747, 1745, 1, 0, 0, 0, 1748, 1749, 5, 42, 0, 0, 1749, 1750, + 5, 47, 0, 0, 1750, 1751, 1, 0, 0, 0, 1751, 1752, 6, 147, 0, 0, 1752, 296, + 1, 0, 0, 0, 1753, 1754, 5, 47, 0, 0, 1754, 1755, 3, 299, 149, 0, 1755, + 1757, 5, 47, 0, 0, 1756, 1758, 3, 303, 151, 0, 1757, 1756, 1, 0, 0, 0, + 1757, 1758, 1, 0, 0, 0, 1758, 298, 1, 0, 0, 0, 1759, 1761, 3, 301, 150, + 0, 1760, 1759, 1, 0, 0, 0, 1761, 1762, 1, 0, 0, 0, 1762, 1760, 1, 0, 0, + 0, 1762, 1763, 1, 0, 0, 0, 1763, 300, 1, 0, 0, 0, 1764, 1768, 8, 1, 0, + 0, 1765, 1766, 5, 92, 0, 0, 1766, 1768, 9, 0, 0, 0, 1767, 1764, 1, 0, 0, + 0, 1767, 1765, 1, 0, 0, 0, 1768, 302, 1, 0, 0, 0, 1769, 1771, 7, 2, 0, + 0, 1770, 1769, 1, 0, 0, 0, 1771, 1772, 1, 0, 0, 0, 1772, 1770, 1, 0, 0, + 0, 1772, 1773, 1, 0, 0, 0, 1773, 304, 1, 0, 0, 0, 1774, 1776, 5, 45, 0, + 0, 1775, 1774, 1, 0, 0, 0, 1775, 1776, 1, 0, 0, 0, 1776, 1777, 1, 0, 0, + 0, 1777, 1784, 3, 307, 153, 0, 1778, 1780, 5, 46, 0, 0, 1779, 1781, 7, + 3, 0, 0, 1780, 1779, 1, 0, 0, 0, 1781, 1782, 1, 0, 0, 0, 1782, 1780, 1, + 0, 0, 0, 1782, 1783, 1, 0, 0, 0, 1783, 1785, 1, 0, 0, 0, 1784, 1778, 1, + 0, 0, 0, 1784, 1785, 1, 0, 0, 0, 1785, 1787, 1, 0, 0, 0, 1786, 1788, 3, + 309, 154, 0, 1787, 1786, 1, 0, 0, 0, 1787, 1788, 1, 0, 0, 0, 1788, 1802, + 1, 0, 0, 0, 1789, 1791, 5, 45, 0, 0, 1790, 1789, 1, 0, 0, 0, 1790, 1791, + 1, 0, 0, 0, 1791, 1792, 1, 0, 0, 0, 1792, 1794, 5, 46, 0, 0, 1793, 1795, + 7, 3, 0, 0, 1794, 1793, 1, 0, 0, 0, 1795, 1796, 1, 0, 0, 0, 1796, 1794, + 1, 0, 0, 0, 1796, 1797, 1, 0, 0, 0, 1797, 1799, 1, 0, 0, 0, 1798, 1800, + 3, 309, 154, 0, 1799, 1798, 1, 0, 0, 0, 1799, 1800, 1, 0, 0, 0, 1800, 1802, + 1, 0, 0, 0, 1801, 1775, 1, 0, 0, 0, 1801, 1790, 1, 0, 0, 0, 1802, 306, + 1, 0, 0, 0, 1803, 1812, 5, 48, 0, 0, 1804, 1808, 7, 4, 0, 0, 1805, 1807, + 7, 3, 0, 0, 1806, 1805, 1, 0, 0, 0, 1807, 1810, 1, 0, 0, 0, 1808, 1806, + 1, 0, 0, 0, 1808, 1809, 1, 0, 0, 0, 1809, 1812, 1, 0, 0, 0, 1810, 1808, + 1, 0, 0, 0, 1811, 1803, 1, 0, 0, 0, 1811, 1804, 1, 0, 0, 0, 1812, 308, + 1, 0, 0, 0, 1813, 1815, 7, 5, 0, 0, 1814, 1816, 7, 6, 0, 0, 1815, 1814, + 1, 0, 0, 0, 1815, 1816, 1, 0, 0, 0, 1816, 1818, 1, 0, 0, 0, 1817, 1819, + 7, 3, 0, 0, 1818, 1817, 1, 0, 0, 0, 1819, 1820, 1, 0, 0, 0, 1820, 1818, + 1, 0, 0, 0, 1820, 1821, 1, 0, 0, 0, 1821, 310, 1, 0, 0, 0, 1822, 1827, + 5, 34, 0, 0, 1823, 1826, 3, 315, 157, 0, 1824, 1826, 8, 7, 0, 0, 1825, + 1823, 1, 0, 0, 0, 1825, 1824, 1, 0, 0, 0, 1826, 1829, 1, 0, 0, 0, 1827, + 1825, 1, 0, 0, 0, 1827, 1828, 1, 0, 0, 0, 1828, 1830, 1, 0, 0, 0, 1829, + 1827, 1, 0, 0, 0, 1830, 1831, 5, 34, 0, 0, 1831, 312, 1, 0, 0, 0, 1832, + 1837, 5, 39, 0, 0, 1833, 1836, 3, 315, 157, 0, 1834, 1836, 8, 8, 0, 0, + 1835, 1833, 1, 0, 0, 0, 1835, 1834, 1, 0, 0, 0, 1836, 1839, 1, 0, 0, 0, + 1837, 1835, 1, 0, 0, 0, 1837, 1838, 1, 0, 0, 0, 1838, 1840, 1, 0, 0, 0, + 1839, 1837, 1, 0, 0, 0, 1840, 1841, 5, 39, 0, 0, 1841, 314, 1, 0, 0, 0, + 1842, 1846, 5, 92, 0, 0, 1843, 1847, 7, 9, 0, 0, 1844, 1847, 3, 317, 158, + 0, 1845, 1847, 5, 39, 0, 0, 1846, 1843, 1, 0, 0, 0, 1846, 1844, 1, 0, 0, + 0, 1846, 1845, 1, 0, 0, 0, 1847, 316, 1, 0, 0, 0, 1848, 1849, 5, 117, 0, + 0, 1849, 1850, 3, 319, 159, 0, 1850, 1851, 3, 319, 159, 0, 1851, 1852, + 3, 319, 159, 0, 1852, 1853, 3, 319, 159, 0, 1853, 318, 1, 0, 0, 0, 1854, + 1855, 7, 10, 0, 0, 1855, 320, 1, 0, 0, 0, 1856, 1860, 7, 11, 0, 0, 1857, + 1859, 7, 12, 0, 0, 1858, 1857, 1, 0, 0, 0, 1859, 1862, 1, 0, 0, 0, 1860, + 1858, 1, 0, 0, 0, 1860, 1861, 1, 0, 0, 0, 1861, 322, 1, 0, 0, 0, 1862, + 1860, 1, 0, 0, 0, 1863, 1865, 7, 13, 0, 0, 1864, 1863, 1, 0, 0, 0, 1865, + 1866, 1, 0, 0, 0, 1866, 1864, 1, 0, 0, 0, 1866, 1867, 1, 0, 0, 0, 1867, + 1868, 1, 0, 0, 0, 1868, 1869, 6, 161, 0, 0, 1869, 324, 1, 0, 0, 0, 26, + 0, 1734, 1745, 1757, 1762, 1767, 1772, 1775, 1782, 1784, 1787, 1790, 1796, + 1799, 1801, 1808, 1811, 1815, 1820, 1825, 1827, 1835, 1837, 1846, 1860, + 1866, 1, 0, 1, 0, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -401,61 +1021,158 @@ func NewMongoShellLexer(input antlr.CharStream) *MongoShellLexer { // MongoShellLexer tokens. const ( - MongoShellLexerSHOW = 1 - MongoShellLexerDBS = 2 - MongoShellLexerDATABASES = 3 - MongoShellLexerCOLLECTIONS = 4 - MongoShellLexerDB = 5 - MongoShellLexerNEW = 6 - MongoShellLexerTRUE = 7 - MongoShellLexerFALSE = 8 - MongoShellLexerNULL = 9 - MongoShellLexerGET_COLLECTION = 10 - MongoShellLexerGET_COLLECTION_NAMES = 11 - MongoShellLexerGET_COLLECTION_INFOS = 12 - MongoShellLexerOBJECT_ID = 13 - MongoShellLexerISO_DATE = 14 - MongoShellLexerDATE = 15 - MongoShellLexerUUID = 16 - MongoShellLexerLONG = 17 - MongoShellLexerNUMBER_LONG = 18 - MongoShellLexerINT32 = 19 - MongoShellLexerNUMBER_INT = 20 - MongoShellLexerDOUBLE = 21 - MongoShellLexerDECIMAL128 = 22 - MongoShellLexerNUMBER_DECIMAL = 23 - MongoShellLexerTIMESTAMP = 24 - MongoShellLexerREG_EXP = 25 - MongoShellLexerFIND = 26 - MongoShellLexerFIND_ONE = 27 - MongoShellLexerCOUNT_DOCUMENTS = 28 - MongoShellLexerESTIMATED_DOCUMENT_COUNT = 29 - MongoShellLexerDISTINCT = 30 - MongoShellLexerAGGREGATE = 31 - MongoShellLexerGET_INDEXES = 32 - MongoShellLexerSORT = 33 - MongoShellLexerLIMIT = 34 - MongoShellLexerSKIP_ = 35 - MongoShellLexerPROJECTION = 36 - MongoShellLexerPROJECT = 37 - MongoShellLexerCOUNT = 38 - MongoShellLexerLPAREN = 39 - MongoShellLexerRPAREN = 40 - MongoShellLexerLBRACE = 41 - MongoShellLexerRBRACE = 42 - MongoShellLexerLBRACKET = 43 - MongoShellLexerRBRACKET = 44 - MongoShellLexerCOLON = 45 - MongoShellLexerCOMMA = 46 - MongoShellLexerDOT = 47 - MongoShellLexerSEMI = 48 - MongoShellLexerDOLLAR = 49 - MongoShellLexerLINE_COMMENT = 50 - MongoShellLexerBLOCK_COMMENT = 51 - MongoShellLexerREGEX_LITERAL = 52 - MongoShellLexerNUMBER = 53 - MongoShellLexerDOUBLE_QUOTED_STRING = 54 - MongoShellLexerSINGLE_QUOTED_STRING = 55 - MongoShellLexerIDENTIFIER = 56 - MongoShellLexerWS = 57 + MongoShellLexerSHOW = 1 + MongoShellLexerDBS = 2 + MongoShellLexerDATABASES = 3 + MongoShellLexerCOLLECTIONS = 4 + MongoShellLexerDB = 5 + MongoShellLexerNEW = 6 + MongoShellLexerTRUE = 7 + MongoShellLexerFALSE = 8 + MongoShellLexerNULL = 9 + MongoShellLexerGET_COLLECTION = 10 + MongoShellLexerGET_COLLECTION_NAMES = 11 + MongoShellLexerGET_COLLECTION_INFOS = 12 + MongoShellLexerOBJECT_ID = 13 + MongoShellLexerISO_DATE = 14 + MongoShellLexerDATE = 15 + MongoShellLexerUUID = 16 + MongoShellLexerLONG = 17 + MongoShellLexerNUMBER_LONG = 18 + MongoShellLexerINT32 = 19 + MongoShellLexerNUMBER_INT = 20 + MongoShellLexerDOUBLE = 21 + MongoShellLexerDECIMAL128 = 22 + MongoShellLexerNUMBER_DECIMAL = 23 + MongoShellLexerTIMESTAMP = 24 + MongoShellLexerREG_EXP = 25 + MongoShellLexerBIN_DATA = 26 + MongoShellLexerBINARY = 27 + MongoShellLexerBSON_REG_EXP = 28 + MongoShellLexerHEX_DATA = 29 + MongoShellLexerFIND = 30 + MongoShellLexerFIND_ONE = 31 + MongoShellLexerCOUNT_DOCUMENTS = 32 + MongoShellLexerESTIMATED_DOCUMENT_COUNT = 33 + MongoShellLexerDISTINCT = 34 + MongoShellLexerAGGREGATE = 35 + MongoShellLexerGET_INDEXES = 36 + MongoShellLexerINSERT_ONE = 37 + MongoShellLexerINSERT_MANY = 38 + MongoShellLexerUPDATE_ONE = 39 + MongoShellLexerUPDATE_MANY = 40 + MongoShellLexerDELETE_ONE = 41 + MongoShellLexerDELETE_MANY = 42 + MongoShellLexerREPLACE_ONE = 43 + MongoShellLexerFIND_ONE_AND_UPDATE = 44 + MongoShellLexerFIND_ONE_AND_REPLACE = 45 + MongoShellLexerFIND_ONE_AND_DELETE = 46 + MongoShellLexerCREATE_INDEX = 47 + MongoShellLexerCREATE_INDEXES = 48 + MongoShellLexerDROP_INDEX = 49 + MongoShellLexerDROP_INDEXES = 50 + MongoShellLexerDROP = 51 + MongoShellLexerRENAME_COLLECTION = 52 + MongoShellLexerSTATS = 53 + MongoShellLexerSTORAGE_SIZE = 54 + MongoShellLexerTOTAL_INDEX_SIZE = 55 + MongoShellLexerTOTAL_SIZE = 56 + MongoShellLexerDATA_SIZE = 57 + MongoShellLexerIS_CAPPED = 58 + MongoShellLexerVALIDATE = 59 + MongoShellLexerLATENCY_STATS = 60 + MongoShellLexerCREATE_COLLECTION = 61 + MongoShellLexerDROP_DATABASE = 62 + MongoShellLexerHOST_INFO = 63 + MongoShellLexerLIST_COMMANDS = 64 + MongoShellLexerSERVER_BUILD_INFO = 65 + MongoShellLexerSERVER_STATUS = 66 + MongoShellLexerVERSION = 67 + MongoShellLexerRUN_COMMAND = 68 + MongoShellLexerADMIN_COMMAND = 69 + MongoShellLexerGET_NAME = 70 + MongoShellLexerGET_MONGO = 71 + MongoShellLexerGET_SIBLING_DB = 72 + MongoShellLexerMONGO = 73 + MongoShellLexerCONNECT = 74 + MongoShellLexerRS = 75 + MongoShellLexerSH = 76 + MongoShellLexerSP = 77 + MongoShellLexerGET_DB = 78 + MongoShellLexerGET_READ_CONCERN = 79 + MongoShellLexerGET_READ_PREF = 80 + MongoShellLexerGET_READ_PREF_MODE = 81 + MongoShellLexerGET_READ_PREF_TAG_SET = 82 + MongoShellLexerGET_WRITE_CONCERN = 83 + MongoShellLexerSET_READ_PREF = 84 + MongoShellLexerSET_READ_CONCERN = 85 + MongoShellLexerSET_WRITE_CONCERN = 86 + MongoShellLexerSTART_SESSION = 87 + MongoShellLexerWATCH = 88 + MongoShellLexerGET_DB_NAMES = 89 + MongoShellLexerGET_KEY_VAULT = 90 + MongoShellLexerGET_CLIENT_ENCRYPTION = 91 + MongoShellLexerGET_PLAN_CACHE = 92 + MongoShellLexerSORT = 93 + MongoShellLexerLIMIT = 94 + MongoShellLexerSKIP_ = 95 + MongoShellLexerPROJECTION = 96 + MongoShellLexerPROJECT = 97 + MongoShellLexerCOUNT = 98 + MongoShellLexerINITIALIZE_ORDERED_BULK_OP = 99 + MongoShellLexerINITIALIZE_UNORDERED_BULK_OP = 100 + MongoShellLexerEXECUTE = 101 + MongoShellLexerGET_OPERATIONS = 102 + MongoShellLexerTO_STRING = 103 + MongoShellLexerINSERT = 104 + MongoShellLexerREMOVE = 105 + MongoShellLexerBATCH_SIZE = 106 + MongoShellLexerCLOSE = 107 + MongoShellLexerCOLLATION = 108 + MongoShellLexerCOMMENT = 109 + MongoShellLexerEXPLAIN = 110 + MongoShellLexerFOR_EACH = 111 + MongoShellLexerHAS_NEXT = 112 + MongoShellLexerHINT = 113 + MongoShellLexerIS_CLOSED = 114 + MongoShellLexerIS_EXHAUSTED = 115 + MongoShellLexerIT_COUNT = 116 + MongoShellLexerMAP = 117 + MongoShellLexerMAX = 118 + MongoShellLexerMAX_AWAIT_TIME_MS = 119 + MongoShellLexerMAX_TIME_MS = 120 + MongoShellLexerMIN = 121 + MongoShellLexerNEXT = 122 + MongoShellLexerNO_CURSOR_TIMEOUT = 123 + MongoShellLexerOBJS_LEFT_IN_BATCH = 124 + MongoShellLexerPRETTY = 125 + MongoShellLexerREAD_CONCERN = 126 + MongoShellLexerREAD_PREF = 127 + MongoShellLexerRETURN_KEY = 128 + MongoShellLexerSHOW_RECORD_ID = 129 + MongoShellLexerSIZE = 130 + MongoShellLexerTAILABLE = 131 + MongoShellLexerTO_ARRAY = 132 + MongoShellLexerTRY_NEXT = 133 + MongoShellLexerALLOW_DISK_USE = 134 + MongoShellLexerADD_OPTION = 135 + MongoShellLexerLPAREN = 136 + MongoShellLexerRPAREN = 137 + MongoShellLexerLBRACE = 138 + MongoShellLexerRBRACE = 139 + MongoShellLexerLBRACKET = 140 + MongoShellLexerRBRACKET = 141 + MongoShellLexerCOLON = 142 + MongoShellLexerCOMMA = 143 + MongoShellLexerDOT = 144 + MongoShellLexerSEMI = 145 + MongoShellLexerDOLLAR = 146 + MongoShellLexerLINE_COMMENT = 147 + MongoShellLexerBLOCK_COMMENT = 148 + MongoShellLexerREGEX_LITERAL = 149 + MongoShellLexerNUMBER = 150 + MongoShellLexerDOUBLE_QUOTED_STRING = 151 + MongoShellLexerSINGLE_QUOTED_STRING = 152 + MongoShellLexerIDENTIFIER = 153 + MongoShellLexerWS = 154 ) diff --git a/mongodb/mongoshell_parser.go b/mongodb/mongoshell_parser.go index 67f5c08..8b010d2 100644 --- a/mongodb/mongoshell_parser.go +++ b/mongodb/mongoshell_parser.go @@ -36,246 +36,801 @@ func mongoshellparserParserInit() { "'true'", "'false'", "'null'", "'getCollection'", "'getCollectionNames'", "'getCollectionInfos'", "'ObjectId'", "'ISODate'", "'Date'", "'UUID'", "'Long'", "'NumberLong'", "'Int32'", "'NumberInt'", "'Double'", "'Decimal128'", - "'NumberDecimal'", "'Timestamp'", "'RegExp'", "'find'", "'findOne'", - "'countDocuments'", "'estimatedDocumentCount'", "'distinct'", "'aggregate'", - "'getIndexes'", "'sort'", "'limit'", "'skip'", "'projection'", "'project'", - "'count'", "'('", "')'", "'{'", "'}'", "'['", "']'", "':'", "','", "'.'", - "';'", "'$'", + "'NumberDecimal'", "'Timestamp'", "'RegExp'", "'BinData'", "'Binary'", + "'BSONRegExp'", "'HexData'", "'find'", "'findOne'", "'countDocuments'", + "'estimatedDocumentCount'", "'distinct'", "'aggregate'", "'getIndexes'", + "'insertOne'", "'insertMany'", "'updateOne'", "'updateMany'", "'deleteOne'", + "'deleteMany'", "'replaceOne'", "'findOneAndUpdate'", "'findOneAndReplace'", + "'findOneAndDelete'", "'createIndex'", "'createIndexes'", "'dropIndex'", + "'dropIndexes'", "'drop'", "'renameCollection'", "'stats'", "'storageSize'", + "'totalIndexSize'", "'totalSize'", "'dataSize'", "'isCapped'", "'validate'", + "'latencyStats'", "'createCollection'", "'dropDatabase'", "'hostInfo'", + "'listCommands'", "'serverBuildInfo'", "'serverStatus'", "'version'", + "'runCommand'", "'adminCommand'", "'getName'", "'getMongo'", "'getSiblingDB'", + "'Mongo'", "'connect'", "'rs'", "'sh'", "'sp'", "'getDB'", "'getReadConcern'", + "'getReadPref'", "'getReadPrefMode'", "'getReadPrefTagSet'", "'getWriteConcern'", + "'setReadPref'", "'setReadConcern'", "'setWriteConcern'", "'startSession'", + "'watch'", "'getDBNames'", "'getKeyVault'", "'getClientEncryption'", + "'getPlanCache'", "'sort'", "'limit'", "'skip'", "'projection'", "'project'", + "'count'", "'initializeOrderedBulkOp'", "'initializeUnorderedBulkOp'", + "'execute'", "'getOperations'", "'toString'", "'insert'", "'remove'", + "'batchSize'", "'close'", "'collation'", "'comment'", "'explain'", "'forEach'", + "'hasNext'", "'hint'", "'isClosed'", "'isExhausted'", "'itcount'", "'map'", + "'max'", "'maxAwaitTimeMS'", "'maxTimeMS'", "'min'", "'next'", "'noCursorTimeout'", + "'objsLeftInBatch'", "'pretty'", "'readConcern'", "'readPref'", "'returnKey'", + "'showRecordId'", "'size'", "'tailable'", "'toArray'", "'tryNext'", + "'allowDiskUse'", "'addOption'", "'('", "')'", "'{'", "'}'", "'['", + "']'", "':'", "','", "'.'", "';'", "'$'", } staticData.SymbolicNames = []string{ "", "SHOW", "DBS", "DATABASES", "COLLECTIONS", "DB", "NEW", "TRUE", "FALSE", "NULL", "GET_COLLECTION", "GET_COLLECTION_NAMES", "GET_COLLECTION_INFOS", "OBJECT_ID", "ISO_DATE", "DATE", "UUID", "LONG", "NUMBER_LONG", "INT32", "NUMBER_INT", "DOUBLE", "DECIMAL128", "NUMBER_DECIMAL", "TIMESTAMP", - "REG_EXP", "FIND", "FIND_ONE", "COUNT_DOCUMENTS", "ESTIMATED_DOCUMENT_COUNT", - "DISTINCT", "AGGREGATE", "GET_INDEXES", "SORT", "LIMIT", "SKIP_", "PROJECTION", - "PROJECT", "COUNT", "LPAREN", "RPAREN", "LBRACE", "RBRACE", "LBRACKET", - "RBRACKET", "COLON", "COMMA", "DOT", "SEMI", "DOLLAR", "LINE_COMMENT", - "BLOCK_COMMENT", "REGEX_LITERAL", "NUMBER", "DOUBLE_QUOTED_STRING", - "SINGLE_QUOTED_STRING", "IDENTIFIER", "WS", + "REG_EXP", "BIN_DATA", "BINARY", "BSON_REG_EXP", "HEX_DATA", "FIND", + "FIND_ONE", "COUNT_DOCUMENTS", "ESTIMATED_DOCUMENT_COUNT", "DISTINCT", + "AGGREGATE", "GET_INDEXES", "INSERT_ONE", "INSERT_MANY", "UPDATE_ONE", + "UPDATE_MANY", "DELETE_ONE", "DELETE_MANY", "REPLACE_ONE", "FIND_ONE_AND_UPDATE", + "FIND_ONE_AND_REPLACE", "FIND_ONE_AND_DELETE", "CREATE_INDEX", "CREATE_INDEXES", + "DROP_INDEX", "DROP_INDEXES", "DROP", "RENAME_COLLECTION", "STATS", + "STORAGE_SIZE", "TOTAL_INDEX_SIZE", "TOTAL_SIZE", "DATA_SIZE", "IS_CAPPED", + "VALIDATE", "LATENCY_STATS", "CREATE_COLLECTION", "DROP_DATABASE", "HOST_INFO", + "LIST_COMMANDS", "SERVER_BUILD_INFO", "SERVER_STATUS", "VERSION", "RUN_COMMAND", + "ADMIN_COMMAND", "GET_NAME", "GET_MONGO", "GET_SIBLING_DB", "MONGO", + "CONNECT", "RS", "SH", "SP", "GET_DB", "GET_READ_CONCERN", "GET_READ_PREF", + "GET_READ_PREF_MODE", "GET_READ_PREF_TAG_SET", "GET_WRITE_CONCERN", + "SET_READ_PREF", "SET_READ_CONCERN", "SET_WRITE_CONCERN", "START_SESSION", + "WATCH", "GET_DB_NAMES", "GET_KEY_VAULT", "GET_CLIENT_ENCRYPTION", "GET_PLAN_CACHE", + "SORT", "LIMIT", "SKIP_", "PROJECTION", "PROJECT", "COUNT", "INITIALIZE_ORDERED_BULK_OP", + "INITIALIZE_UNORDERED_BULK_OP", "EXECUTE", "GET_OPERATIONS", "TO_STRING", + "INSERT", "REMOVE", "BATCH_SIZE", "CLOSE", "COLLATION", "COMMENT", "EXPLAIN", + "FOR_EACH", "HAS_NEXT", "HINT", "IS_CLOSED", "IS_EXHAUSTED", "IT_COUNT", + "MAP", "MAX", "MAX_AWAIT_TIME_MS", "MAX_TIME_MS", "MIN", "NEXT", "NO_CURSOR_TIMEOUT", + "OBJS_LEFT_IN_BATCH", "PRETTY", "READ_CONCERN", "READ_PREF", "RETURN_KEY", + "SHOW_RECORD_ID", "SIZE", "TAILABLE", "TO_ARRAY", "TRY_NEXT", "ALLOW_DISK_USE", + "ADD_OPTION", "LPAREN", "RPAREN", "LBRACE", "RBRACE", "LBRACKET", "RBRACKET", + "COLON", "COMMA", "DOT", "SEMI", "DOLLAR", "LINE_COMMENT", "BLOCK_COMMENT", + "REGEX_LITERAL", "NUMBER", "DOUBLE_QUOTED_STRING", "SINGLE_QUOTED_STRING", + "IDENTIFIER", "WS", } staticData.RuleNames = []string{ - "program", "statement", "shellCommand", "dbStatement", "collectionAccess", - "methodChain", "methodCall", "findMethod", "findOneMethod", "countDocumentsMethod", - "estimatedDocumentCountMethod", "distinctMethod", "aggregateMethod", - "getIndexesMethod", "sortMethod", "limitMethod", "skipMethod", "countMethod", - "projectionMethod", "genericMethod", "arguments", "argument", "document", - "pair", "key", "value", "newKeywordError", "array", "helperFunction", - "objectIdHelper", "isoDateHelper", "dateHelper", "uuidHelper", "longHelper", - "int32Helper", "doubleHelper", "decimal128Helper", "timestampHelper", - "regExpConstructor", "literal", "stringLiteral", "identifier", + "program", "statement", "shellCommand", "dbStatement", "genericDbMethod", + "bulkStatement", "bulkInitMethod", "bulkMethodChain", "bulkMethod", + "connectionStatement", "connectionMethodChain", "rsStatement", "shStatement", + "encryptionStatement", "planCacheStatement", "spStatement", "nativeFunctionCall", + "connectionMethod", "collectionAccess", "methodChain", "methodCall", + "findMethod", "findOneMethod", "countDocumentsMethod", "estimatedDocumentCountMethod", + "distinctMethod", "aggregateMethod", "getIndexesMethod", "insertOneMethod", + "insertManyMethod", "updateOneMethod", "updateManyMethod", "deleteOneMethod", + "deleteManyMethod", "replaceOneMethod", "findOneAndUpdateMethod", "findOneAndReplaceMethod", + "findOneAndDeleteMethod", "createIndexMethod", "createIndexesMethod", + "dropIndexMethod", "dropIndexesMethod", "dropMethod", "renameCollectionMethod", + "statsMethod", "storageSizeMethod", "totalIndexSizeMethod", "totalSizeMethod", + "dataSizeMethod", "isCappedMethod", "validateMethod", "latencyStatsMethod", + "sortMethod", "limitMethod", "skipMethod", "countMethod", "projectionMethod", + "batchSizeMethod", "closeMethod", "collationMethod", "commentMethod", + "explainMethod", "forEachMethod", "hasNextMethod", "hintMethod", "isClosedMethod", + "isExhaustedMethod", "itcountMethod", "mapMethod", "maxMethod", "maxAwaitTimeMSMethod", + "maxTimeMSMethod", "minMethod", "nextMethod", "noCursorTimeoutMethod", + "objsLeftInBatchMethod", "prettyMethod", "readConcernMethod", "readPrefMethod", + "returnKeyMethod", "showRecordIdMethod", "sizeMethod", "tailableMethod", + "toArrayMethod", "tryNextMethod", "allowDiskUseMethod", "addOptionMethod", + "genericMethod", "arguments", "argument", "document", "pair", "key", + "value", "newKeywordError", "array", "helperFunction", "objectIdHelper", + "isoDateHelper", "dateHelper", "uuidHelper", "longHelper", "int32Helper", + "doubleHelper", "decimal128Helper", "timestampHelper", "regExpConstructor", + "binDataHelper", "binaryHelper", "bsonRegExpHelper", "hexDataHelper", + "literal", "stringLiteral", "identifier", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 57, 451, 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, 1, - 0, 5, 0, 86, 8, 0, 10, 0, 12, 0, 89, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, - 95, 8, 1, 1, 1, 1, 1, 3, 1, 99, 8, 1, 3, 1, 101, 8, 1, 1, 2, 1, 2, 1, 2, - 1, 2, 3, 2, 107, 8, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 115, 8, - 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 122, 8, 3, 1, 3, 1, 3, 3, 3, 126, - 8, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 132, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, - 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 146, 8, 4, 1, 5, - 1, 5, 1, 5, 1, 5, 5, 5, 152, 8, 5, 10, 5, 12, 5, 155, 9, 5, 1, 6, 1, 6, - 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, - 170, 8, 6, 1, 7, 1, 7, 1, 7, 3, 7, 175, 8, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, - 8, 3, 8, 182, 8, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 3, 9, 189, 8, 9, 1, 9, - 1, 9, 1, 10, 1, 10, 1, 10, 3, 10, 196, 8, 10, 1, 10, 1, 10, 1, 11, 1, 11, - 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, - 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, - 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, - 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 3, 19, 241, 8, 19, - 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 5, 20, 248, 8, 20, 10, 20, 12, 20, 251, - 9, 20, 1, 20, 3, 20, 254, 8, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, - 22, 5, 22, 262, 8, 22, 10, 22, 12, 22, 265, 9, 22, 1, 22, 3, 22, 268, 8, - 22, 3, 22, 270, 8, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, - 1, 24, 3, 24, 280, 8, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, - 25, 3, 25, 289, 8, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 3, 26, 296, 8, - 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 5, 27, 304, 8, 27, 10, 27, - 12, 27, 307, 9, 27, 1, 27, 3, 27, 310, 8, 27, 3, 27, 312, 8, 27, 1, 27, - 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 3, - 28, 325, 8, 28, 1, 29, 1, 29, 1, 29, 3, 29, 330, 8, 29, 1, 29, 1, 29, 1, - 30, 1, 30, 1, 30, 3, 30, 337, 8, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, - 1, 31, 3, 31, 345, 8, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, - 32, 1, 33, 1, 33, 1, 33, 1, 33, 3, 33, 358, 8, 33, 1, 33, 1, 33, 1, 34, - 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, - 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, - 1, 37, 1, 37, 1, 37, 1, 37, 3, 37, 388, 8, 37, 1, 38, 1, 38, 1, 38, 1, - 38, 1, 38, 3, 38, 395, 8, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, - 1, 39, 3, 39, 404, 8, 39, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, - 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, - 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, - 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, - 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 3, 41, 449, 8, 41, 1, 41, 0, 0, 42, - 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, 66, 68, 70, 72, - 74, 76, 78, 80, 82, 0, 7, 1, 0, 2, 3, 1, 0, 36, 37, 1, 0, 13, 25, 1, 0, - 17, 18, 1, 0, 19, 20, 1, 0, 22, 23, 1, 0, 54, 55, 512, 0, 87, 1, 0, 0, - 0, 2, 100, 1, 0, 0, 0, 4, 106, 1, 0, 0, 0, 6, 131, 1, 0, 0, 0, 8, 145, - 1, 0, 0, 0, 10, 147, 1, 0, 0, 0, 12, 169, 1, 0, 0, 0, 14, 171, 1, 0, 0, - 0, 16, 178, 1, 0, 0, 0, 18, 185, 1, 0, 0, 0, 20, 192, 1, 0, 0, 0, 22, 199, - 1, 0, 0, 0, 24, 204, 1, 0, 0, 0, 26, 209, 1, 0, 0, 0, 28, 213, 1, 0, 0, - 0, 30, 218, 1, 0, 0, 0, 32, 223, 1, 0, 0, 0, 34, 228, 1, 0, 0, 0, 36, 232, - 1, 0, 0, 0, 38, 237, 1, 0, 0, 0, 40, 244, 1, 0, 0, 0, 42, 255, 1, 0, 0, - 0, 44, 257, 1, 0, 0, 0, 46, 273, 1, 0, 0, 0, 48, 279, 1, 0, 0, 0, 50, 288, - 1, 0, 0, 0, 52, 290, 1, 0, 0, 0, 54, 299, 1, 0, 0, 0, 56, 324, 1, 0, 0, - 0, 58, 326, 1, 0, 0, 0, 60, 333, 1, 0, 0, 0, 62, 340, 1, 0, 0, 0, 64, 348, - 1, 0, 0, 0, 66, 353, 1, 0, 0, 0, 68, 361, 1, 0, 0, 0, 70, 366, 1, 0, 0, - 0, 72, 371, 1, 0, 0, 0, 74, 387, 1, 0, 0, 0, 76, 389, 1, 0, 0, 0, 78, 403, - 1, 0, 0, 0, 80, 405, 1, 0, 0, 0, 82, 448, 1, 0, 0, 0, 84, 86, 3, 2, 1, - 0, 85, 84, 1, 0, 0, 0, 86, 89, 1, 0, 0, 0, 87, 85, 1, 0, 0, 0, 87, 88, - 1, 0, 0, 0, 88, 90, 1, 0, 0, 0, 89, 87, 1, 0, 0, 0, 90, 91, 5, 0, 0, 1, - 91, 1, 1, 0, 0, 0, 92, 94, 3, 4, 2, 0, 93, 95, 5, 48, 0, 0, 94, 93, 1, - 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 101, 1, 0, 0, 0, 96, 98, 3, 6, 3, 0, 97, - 99, 5, 48, 0, 0, 98, 97, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 99, 101, 1, 0, - 0, 0, 100, 92, 1, 0, 0, 0, 100, 96, 1, 0, 0, 0, 101, 3, 1, 0, 0, 0, 102, - 103, 5, 1, 0, 0, 103, 107, 7, 0, 0, 0, 104, 105, 5, 1, 0, 0, 105, 107, - 5, 4, 0, 0, 106, 102, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 107, 5, 1, 0, 0, - 0, 108, 109, 5, 5, 0, 0, 109, 110, 5, 47, 0, 0, 110, 111, 5, 11, 0, 0, - 111, 112, 5, 39, 0, 0, 112, 114, 5, 40, 0, 0, 113, 115, 3, 10, 5, 0, 114, - 113, 1, 0, 0, 0, 114, 115, 1, 0, 0, 0, 115, 132, 1, 0, 0, 0, 116, 117, - 5, 5, 0, 0, 117, 118, 5, 47, 0, 0, 118, 119, 5, 12, 0, 0, 119, 121, 5, - 39, 0, 0, 120, 122, 3, 40, 20, 0, 121, 120, 1, 0, 0, 0, 121, 122, 1, 0, - 0, 0, 122, 123, 1, 0, 0, 0, 123, 125, 5, 40, 0, 0, 124, 126, 3, 10, 5, - 0, 125, 124, 1, 0, 0, 0, 125, 126, 1, 0, 0, 0, 126, 132, 1, 0, 0, 0, 127, - 128, 5, 5, 0, 0, 128, 129, 3, 8, 4, 0, 129, 130, 3, 10, 5, 0, 130, 132, - 1, 0, 0, 0, 131, 108, 1, 0, 0, 0, 131, 116, 1, 0, 0, 0, 131, 127, 1, 0, - 0, 0, 132, 7, 1, 0, 0, 0, 133, 134, 5, 47, 0, 0, 134, 146, 3, 82, 41, 0, - 135, 136, 5, 43, 0, 0, 136, 137, 3, 80, 40, 0, 137, 138, 5, 44, 0, 0, 138, - 146, 1, 0, 0, 0, 139, 140, 5, 47, 0, 0, 140, 141, 5, 10, 0, 0, 141, 142, - 5, 39, 0, 0, 142, 143, 3, 80, 40, 0, 143, 144, 5, 40, 0, 0, 144, 146, 1, - 0, 0, 0, 145, 133, 1, 0, 0, 0, 145, 135, 1, 0, 0, 0, 145, 139, 1, 0, 0, - 0, 146, 9, 1, 0, 0, 0, 147, 148, 5, 47, 0, 0, 148, 153, 3, 12, 6, 0, 149, - 150, 5, 47, 0, 0, 150, 152, 3, 12, 6, 0, 151, 149, 1, 0, 0, 0, 152, 155, - 1, 0, 0, 0, 153, 151, 1, 0, 0, 0, 153, 154, 1, 0, 0, 0, 154, 11, 1, 0, - 0, 0, 155, 153, 1, 0, 0, 0, 156, 170, 3, 14, 7, 0, 157, 170, 3, 16, 8, - 0, 158, 170, 3, 18, 9, 0, 159, 170, 3, 20, 10, 0, 160, 170, 3, 22, 11, - 0, 161, 170, 3, 24, 12, 0, 162, 170, 3, 26, 13, 0, 163, 170, 3, 28, 14, - 0, 164, 170, 3, 30, 15, 0, 165, 170, 3, 32, 16, 0, 166, 170, 3, 34, 17, - 0, 167, 170, 3, 36, 18, 0, 168, 170, 3, 38, 19, 0, 169, 156, 1, 0, 0, 0, - 169, 157, 1, 0, 0, 0, 169, 158, 1, 0, 0, 0, 169, 159, 1, 0, 0, 0, 169, - 160, 1, 0, 0, 0, 169, 161, 1, 0, 0, 0, 169, 162, 1, 0, 0, 0, 169, 163, - 1, 0, 0, 0, 169, 164, 1, 0, 0, 0, 169, 165, 1, 0, 0, 0, 169, 166, 1, 0, - 0, 0, 169, 167, 1, 0, 0, 0, 169, 168, 1, 0, 0, 0, 170, 13, 1, 0, 0, 0, - 171, 172, 5, 26, 0, 0, 172, 174, 5, 39, 0, 0, 173, 175, 3, 42, 21, 0, 174, - 173, 1, 0, 0, 0, 174, 175, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 177, - 5, 40, 0, 0, 177, 15, 1, 0, 0, 0, 178, 179, 5, 27, 0, 0, 179, 181, 5, 39, - 0, 0, 180, 182, 3, 42, 21, 0, 181, 180, 1, 0, 0, 0, 181, 182, 1, 0, 0, - 0, 182, 183, 1, 0, 0, 0, 183, 184, 5, 40, 0, 0, 184, 17, 1, 0, 0, 0, 185, - 186, 5, 28, 0, 0, 186, 188, 5, 39, 0, 0, 187, 189, 3, 40, 20, 0, 188, 187, - 1, 0, 0, 0, 188, 189, 1, 0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 191, 5, 40, - 0, 0, 191, 19, 1, 0, 0, 0, 192, 193, 5, 29, 0, 0, 193, 195, 5, 39, 0, 0, - 194, 196, 3, 42, 21, 0, 195, 194, 1, 0, 0, 0, 195, 196, 1, 0, 0, 0, 196, - 197, 1, 0, 0, 0, 197, 198, 5, 40, 0, 0, 198, 21, 1, 0, 0, 0, 199, 200, - 5, 30, 0, 0, 200, 201, 5, 39, 0, 0, 201, 202, 3, 40, 20, 0, 202, 203, 5, - 40, 0, 0, 203, 23, 1, 0, 0, 0, 204, 205, 5, 31, 0, 0, 205, 206, 5, 39, - 0, 0, 206, 207, 3, 40, 20, 0, 207, 208, 5, 40, 0, 0, 208, 25, 1, 0, 0, - 0, 209, 210, 5, 32, 0, 0, 210, 211, 5, 39, 0, 0, 211, 212, 5, 40, 0, 0, - 212, 27, 1, 0, 0, 0, 213, 214, 5, 33, 0, 0, 214, 215, 5, 39, 0, 0, 215, - 216, 3, 44, 22, 0, 216, 217, 5, 40, 0, 0, 217, 29, 1, 0, 0, 0, 218, 219, - 5, 34, 0, 0, 219, 220, 5, 39, 0, 0, 220, 221, 5, 53, 0, 0, 221, 222, 5, - 40, 0, 0, 222, 31, 1, 0, 0, 0, 223, 224, 5, 35, 0, 0, 224, 225, 5, 39, - 0, 0, 225, 226, 5, 53, 0, 0, 226, 227, 5, 40, 0, 0, 227, 33, 1, 0, 0, 0, - 228, 229, 5, 38, 0, 0, 229, 230, 5, 39, 0, 0, 230, 231, 5, 40, 0, 0, 231, - 35, 1, 0, 0, 0, 232, 233, 7, 1, 0, 0, 233, 234, 5, 39, 0, 0, 234, 235, - 3, 44, 22, 0, 235, 236, 5, 40, 0, 0, 236, 37, 1, 0, 0, 0, 237, 238, 3, - 82, 41, 0, 238, 240, 5, 39, 0, 0, 239, 241, 3, 40, 20, 0, 240, 239, 1, - 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 243, 5, 40, 0, - 0, 243, 39, 1, 0, 0, 0, 244, 249, 3, 42, 21, 0, 245, 246, 5, 46, 0, 0, - 246, 248, 3, 42, 21, 0, 247, 245, 1, 0, 0, 0, 248, 251, 1, 0, 0, 0, 249, - 247, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 253, 1, 0, 0, 0, 251, 249, - 1, 0, 0, 0, 252, 254, 5, 46, 0, 0, 253, 252, 1, 0, 0, 0, 253, 254, 1, 0, - 0, 0, 254, 41, 1, 0, 0, 0, 255, 256, 3, 50, 25, 0, 256, 43, 1, 0, 0, 0, - 257, 269, 5, 41, 0, 0, 258, 263, 3, 46, 23, 0, 259, 260, 5, 46, 0, 0, 260, - 262, 3, 46, 23, 0, 261, 259, 1, 0, 0, 0, 262, 265, 1, 0, 0, 0, 263, 261, - 1, 0, 0, 0, 263, 264, 1, 0, 0, 0, 264, 267, 1, 0, 0, 0, 265, 263, 1, 0, - 0, 0, 266, 268, 5, 46, 0, 0, 267, 266, 1, 0, 0, 0, 267, 268, 1, 0, 0, 0, - 268, 270, 1, 0, 0, 0, 269, 258, 1, 0, 0, 0, 269, 270, 1, 0, 0, 0, 270, - 271, 1, 0, 0, 0, 271, 272, 5, 42, 0, 0, 272, 45, 1, 0, 0, 0, 273, 274, - 3, 48, 24, 0, 274, 275, 5, 45, 0, 0, 275, 276, 3, 50, 25, 0, 276, 47, 1, - 0, 0, 0, 277, 280, 3, 82, 41, 0, 278, 280, 3, 80, 40, 0, 279, 277, 1, 0, - 0, 0, 279, 278, 1, 0, 0, 0, 280, 49, 1, 0, 0, 0, 281, 289, 3, 44, 22, 0, - 282, 289, 3, 54, 27, 0, 283, 289, 3, 56, 28, 0, 284, 289, 5, 52, 0, 0, - 285, 289, 3, 76, 38, 0, 286, 289, 3, 78, 39, 0, 287, 289, 3, 52, 26, 0, - 288, 281, 1, 0, 0, 0, 288, 282, 1, 0, 0, 0, 288, 283, 1, 0, 0, 0, 288, - 284, 1, 0, 0, 0, 288, 285, 1, 0, 0, 0, 288, 286, 1, 0, 0, 0, 288, 287, - 1, 0, 0, 0, 289, 51, 1, 0, 0, 0, 290, 291, 5, 6, 0, 0, 291, 292, 7, 2, - 0, 0, 292, 293, 6, 26, -1, 0, 293, 295, 5, 39, 0, 0, 294, 296, 3, 40, 20, - 0, 295, 294, 1, 0, 0, 0, 295, 296, 1, 0, 0, 0, 296, 297, 1, 0, 0, 0, 297, - 298, 5, 40, 0, 0, 298, 53, 1, 0, 0, 0, 299, 311, 5, 43, 0, 0, 300, 305, - 3, 50, 25, 0, 301, 302, 5, 46, 0, 0, 302, 304, 3, 50, 25, 0, 303, 301, - 1, 0, 0, 0, 304, 307, 1, 0, 0, 0, 305, 303, 1, 0, 0, 0, 305, 306, 1, 0, - 0, 0, 306, 309, 1, 0, 0, 0, 307, 305, 1, 0, 0, 0, 308, 310, 5, 46, 0, 0, - 309, 308, 1, 0, 0, 0, 309, 310, 1, 0, 0, 0, 310, 312, 1, 0, 0, 0, 311, - 300, 1, 0, 0, 0, 311, 312, 1, 0, 0, 0, 312, 313, 1, 0, 0, 0, 313, 314, - 5, 44, 0, 0, 314, 55, 1, 0, 0, 0, 315, 325, 3, 58, 29, 0, 316, 325, 3, - 60, 30, 0, 317, 325, 3, 62, 31, 0, 318, 325, 3, 64, 32, 0, 319, 325, 3, - 66, 33, 0, 320, 325, 3, 68, 34, 0, 321, 325, 3, 70, 35, 0, 322, 325, 3, - 72, 36, 0, 323, 325, 3, 74, 37, 0, 324, 315, 1, 0, 0, 0, 324, 316, 1, 0, - 0, 0, 324, 317, 1, 0, 0, 0, 324, 318, 1, 0, 0, 0, 324, 319, 1, 0, 0, 0, - 324, 320, 1, 0, 0, 0, 324, 321, 1, 0, 0, 0, 324, 322, 1, 0, 0, 0, 324, - 323, 1, 0, 0, 0, 325, 57, 1, 0, 0, 0, 326, 327, 5, 13, 0, 0, 327, 329, - 5, 39, 0, 0, 328, 330, 3, 80, 40, 0, 329, 328, 1, 0, 0, 0, 329, 330, 1, - 0, 0, 0, 330, 331, 1, 0, 0, 0, 331, 332, 5, 40, 0, 0, 332, 59, 1, 0, 0, - 0, 333, 334, 5, 14, 0, 0, 334, 336, 5, 39, 0, 0, 335, 337, 3, 80, 40, 0, - 336, 335, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 337, 338, 1, 0, 0, 0, 338, - 339, 5, 40, 0, 0, 339, 61, 1, 0, 0, 0, 340, 341, 5, 15, 0, 0, 341, 344, - 5, 39, 0, 0, 342, 345, 3, 80, 40, 0, 343, 345, 5, 53, 0, 0, 344, 342, 1, - 0, 0, 0, 344, 343, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 346, 1, 0, 0, - 0, 346, 347, 5, 40, 0, 0, 347, 63, 1, 0, 0, 0, 348, 349, 5, 16, 0, 0, 349, - 350, 5, 39, 0, 0, 350, 351, 3, 80, 40, 0, 351, 352, 5, 40, 0, 0, 352, 65, - 1, 0, 0, 0, 353, 354, 7, 3, 0, 0, 354, 357, 5, 39, 0, 0, 355, 358, 5, 53, - 0, 0, 356, 358, 3, 80, 40, 0, 357, 355, 1, 0, 0, 0, 357, 356, 1, 0, 0, - 0, 358, 359, 1, 0, 0, 0, 359, 360, 5, 40, 0, 0, 360, 67, 1, 0, 0, 0, 361, - 362, 7, 4, 0, 0, 362, 363, 5, 39, 0, 0, 363, 364, 5, 53, 0, 0, 364, 365, - 5, 40, 0, 0, 365, 69, 1, 0, 0, 0, 366, 367, 5, 21, 0, 0, 367, 368, 5, 39, - 0, 0, 368, 369, 5, 53, 0, 0, 369, 370, 5, 40, 0, 0, 370, 71, 1, 0, 0, 0, - 371, 372, 7, 5, 0, 0, 372, 373, 5, 39, 0, 0, 373, 374, 3, 80, 40, 0, 374, - 375, 5, 40, 0, 0, 375, 73, 1, 0, 0, 0, 376, 377, 5, 24, 0, 0, 377, 378, - 5, 39, 0, 0, 378, 379, 3, 44, 22, 0, 379, 380, 5, 40, 0, 0, 380, 388, 1, - 0, 0, 0, 381, 382, 5, 24, 0, 0, 382, 383, 5, 39, 0, 0, 383, 384, 5, 53, - 0, 0, 384, 385, 5, 46, 0, 0, 385, 386, 5, 53, 0, 0, 386, 388, 5, 40, 0, - 0, 387, 376, 1, 0, 0, 0, 387, 381, 1, 0, 0, 0, 388, 75, 1, 0, 0, 0, 389, - 390, 5, 25, 0, 0, 390, 391, 5, 39, 0, 0, 391, 394, 3, 80, 40, 0, 392, 393, - 5, 46, 0, 0, 393, 395, 3, 80, 40, 0, 394, 392, 1, 0, 0, 0, 394, 395, 1, - 0, 0, 0, 395, 396, 1, 0, 0, 0, 396, 397, 5, 40, 0, 0, 397, 77, 1, 0, 0, - 0, 398, 404, 3, 80, 40, 0, 399, 404, 5, 53, 0, 0, 400, 404, 5, 7, 0, 0, - 401, 404, 5, 8, 0, 0, 402, 404, 5, 9, 0, 0, 403, 398, 1, 0, 0, 0, 403, - 399, 1, 0, 0, 0, 403, 400, 1, 0, 0, 0, 403, 401, 1, 0, 0, 0, 403, 402, - 1, 0, 0, 0, 404, 79, 1, 0, 0, 0, 405, 406, 7, 6, 0, 0, 406, 81, 1, 0, 0, - 0, 407, 449, 5, 56, 0, 0, 408, 409, 5, 49, 0, 0, 409, 449, 5, 56, 0, 0, - 410, 449, 5, 1, 0, 0, 411, 449, 5, 2, 0, 0, 412, 449, 5, 3, 0, 0, 413, - 449, 5, 4, 0, 0, 414, 449, 5, 5, 0, 0, 415, 449, 5, 6, 0, 0, 416, 449, - 5, 7, 0, 0, 417, 449, 5, 8, 0, 0, 418, 449, 5, 9, 0, 0, 419, 449, 5, 26, - 0, 0, 420, 449, 5, 27, 0, 0, 421, 449, 5, 28, 0, 0, 422, 449, 5, 29, 0, - 0, 423, 449, 5, 30, 0, 0, 424, 449, 5, 31, 0, 0, 425, 449, 5, 32, 0, 0, - 426, 449, 5, 33, 0, 0, 427, 449, 5, 34, 0, 0, 428, 449, 5, 35, 0, 0, 429, - 449, 5, 38, 0, 0, 430, 449, 5, 36, 0, 0, 431, 449, 5, 37, 0, 0, 432, 449, - 5, 10, 0, 0, 433, 449, 5, 11, 0, 0, 434, 449, 5, 12, 0, 0, 435, 449, 5, - 13, 0, 0, 436, 449, 5, 14, 0, 0, 437, 449, 5, 15, 0, 0, 438, 449, 5, 16, - 0, 0, 439, 449, 5, 17, 0, 0, 440, 449, 5, 18, 0, 0, 441, 449, 5, 19, 0, - 0, 442, 449, 5, 20, 0, 0, 443, 449, 5, 21, 0, 0, 444, 449, 5, 22, 0, 0, - 445, 449, 5, 23, 0, 0, 446, 449, 5, 24, 0, 0, 447, 449, 5, 25, 0, 0, 448, - 407, 1, 0, 0, 0, 448, 408, 1, 0, 0, 0, 448, 410, 1, 0, 0, 0, 448, 411, - 1, 0, 0, 0, 448, 412, 1, 0, 0, 0, 448, 413, 1, 0, 0, 0, 448, 414, 1, 0, - 0, 0, 448, 415, 1, 0, 0, 0, 448, 416, 1, 0, 0, 0, 448, 417, 1, 0, 0, 0, - 448, 418, 1, 0, 0, 0, 448, 419, 1, 0, 0, 0, 448, 420, 1, 0, 0, 0, 448, - 421, 1, 0, 0, 0, 448, 422, 1, 0, 0, 0, 448, 423, 1, 0, 0, 0, 448, 424, - 1, 0, 0, 0, 448, 425, 1, 0, 0, 0, 448, 426, 1, 0, 0, 0, 448, 427, 1, 0, - 0, 0, 448, 428, 1, 0, 0, 0, 448, 429, 1, 0, 0, 0, 448, 430, 1, 0, 0, 0, - 448, 431, 1, 0, 0, 0, 448, 432, 1, 0, 0, 0, 448, 433, 1, 0, 0, 0, 448, - 434, 1, 0, 0, 0, 448, 435, 1, 0, 0, 0, 448, 436, 1, 0, 0, 0, 448, 437, - 1, 0, 0, 0, 448, 438, 1, 0, 0, 0, 448, 439, 1, 0, 0, 0, 448, 440, 1, 0, - 0, 0, 448, 441, 1, 0, 0, 0, 448, 442, 1, 0, 0, 0, 448, 443, 1, 0, 0, 0, - 448, 444, 1, 0, 0, 0, 448, 445, 1, 0, 0, 0, 448, 446, 1, 0, 0, 0, 448, - 447, 1, 0, 0, 0, 449, 83, 1, 0, 0, 0, 37, 87, 94, 98, 100, 106, 114, 121, - 125, 131, 145, 153, 169, 174, 181, 188, 195, 240, 249, 253, 263, 267, 269, - 279, 288, 295, 305, 309, 311, 324, 329, 336, 344, 357, 387, 394, 403, 448, + 4, 1, 154, 1439, 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, 2, 111, 7, 111, 2, 112, 7, 112, 2, + 113, 7, 113, 1, 0, 5, 0, 230, 8, 0, 10, 0, 12, 0, 233, 9, 0, 1, 0, 1, 0, + 1, 1, 1, 1, 3, 1, 239, 8, 1, 1, 1, 1, 1, 3, 1, 243, 8, 1, 1, 1, 1, 1, 3, + 1, 247, 8, 1, 1, 1, 1, 1, 3, 1, 251, 8, 1, 1, 1, 1, 1, 3, 1, 255, 8, 1, + 1, 1, 1, 1, 3, 1, 259, 8, 1, 1, 1, 1, 1, 3, 1, 263, 8, 1, 1, 1, 1, 1, 3, + 1, 267, 8, 1, 1, 1, 1, 1, 3, 1, 271, 8, 1, 1, 1, 1, 1, 3, 1, 275, 8, 1, + 3, 1, 277, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 283, 8, 2, 1, 3, 1, 3, 1, + 3, 1, 3, 1, 3, 1, 3, 3, 3, 291, 8, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, + 3, 298, 8, 3, 1, 3, 1, 3, 3, 3, 302, 8, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, + 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, + 3, 3, 321, 8, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 329, 8, 3, 1, + 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, + 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, + 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, + 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, + 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 390, + 8, 3, 1, 4, 1, 4, 1, 4, 3, 4, 395, 8, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, + 1, 5, 1, 5, 3, 5, 404, 8, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, + 412, 8, 6, 1, 7, 1, 7, 4, 7, 416, 8, 7, 11, 7, 12, 7, 417, 1, 8, 1, 8, + 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, + 1, 8, 1, 8, 3, 8, 436, 8, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, + 1, 8, 1, 8, 1, 8, 3, 8, 448, 8, 8, 1, 8, 1, 8, 3, 8, 452, 8, 8, 1, 9, 1, + 9, 1, 9, 3, 9, 457, 8, 9, 1, 9, 1, 9, 3, 9, 461, 8, 9, 1, 9, 1, 9, 1, 9, + 3, 9, 466, 8, 9, 1, 9, 1, 9, 3, 9, 470, 8, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, + 9, 1, 9, 3, 9, 478, 8, 9, 1, 10, 1, 10, 4, 10, 482, 8, 10, 11, 10, 12, + 10, 483, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 491, 8, 11, 1, 11, 1, + 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 500, 8, 12, 1, 12, 1, 12, + 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, + 13, 1, 13, 1, 13, 3, 13, 517, 8, 13, 1, 13, 1, 13, 5, 13, 521, 8, 13, 10, + 13, 12, 13, 524, 9, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, + 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 539, 8, 13, 1, 13, 1, + 13, 5, 13, 543, 8, 13, 10, 13, 12, 13, 546, 9, 13, 3, 13, 548, 8, 13, 1, + 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, + 560, 8, 14, 1, 14, 1, 14, 5, 14, 564, 8, 14, 10, 14, 12, 14, 567, 9, 14, + 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 574, 8, 15, 1, 15, 1, 15, 1, + 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 585, 8, 15, 1, 15, + 1, 15, 3, 15, 589, 8, 15, 1, 16, 1, 16, 1, 16, 3, 16, 594, 8, 16, 1, 16, + 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, + 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, + 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, + 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 636, 8, 17, + 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 642, 8, 17, 1, 17, 1, 17, 1, 17, 1, + 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, + 1, 17, 3, 17, 659, 8, 17, 1, 17, 1, 17, 3, 17, 663, 8, 17, 1, 18, 1, 18, + 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 3, + 18, 677, 8, 18, 1, 19, 1, 19, 1, 19, 1, 19, 5, 19, 683, 8, 19, 10, 19, + 12, 19, 686, 9, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, + 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, + 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, + 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, + 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, + 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, + 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 3, 20, 755, 8, 20, 1, + 21, 1, 21, 1, 21, 3, 21, 760, 8, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, + 3, 22, 767, 8, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 3, 23, 774, 8, 23, + 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 3, 24, 781, 8, 24, 1, 24, 1, 24, 1, + 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, + 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, + 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, + 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, + 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, + 1, 35, 1, 36, 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, 39, 1, 39, 1, 39, 1, 39, 1, 39, + 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 3, 41, 867, 8, + 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 3, 42, 874, 8, 42, 1, 42, 1, 42, + 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 3, 44, 886, 8, + 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, + 1, 47, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, + 49, 1, 49, 1, 50, 1, 50, 1, 50, 3, 50, 913, 8, 50, 1, 50, 1, 50, 1, 51, + 1, 51, 1, 51, 3, 51, 920, 8, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, + 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 54, 1, 54, 1, 54, 1, 54, + 1, 54, 1, 55, 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 1, 56, 1, 56, 1, 56, 1, + 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 58, 1, 58, 1, 58, 1, 58, 1, 59, 1, 59, + 1, 59, 1, 59, 1, 59, 1, 60, 1, 60, 1, 60, 1, 60, 1, 60, 1, 61, 1, 61, 1, + 61, 3, 61, 970, 8, 61, 1, 61, 1, 61, 1, 62, 1, 62, 1, 62, 1, 62, 1, 62, + 1, 63, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 1, 64, 1, 64, 1, 64, 1, 65, 1, + 65, 1, 65, 1, 65, 1, 66, 1, 66, 1, 66, 1, 66, 1, 67, 1, 67, 1, 67, 1, 67, + 1, 68, 1, 68, 1, 68, 1, 68, 1, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, + 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 71, 1, 71, 1, 71, 1, 71, 1, 71, 1, 72, + 1, 72, 1, 72, 1, 72, 1, 72, 1, 73, 1, 73, 1, 73, 1, 73, 1, 74, 1, 74, 1, + 74, 1, 74, 1, 75, 1, 75, 1, 75, 1, 75, 1, 76, 1, 76, 1, 76, 1, 76, 1, 77, + 1, 77, 1, 77, 1, 77, 1, 77, 1, 78, 1, 78, 1, 78, 1, 78, 1, 78, 1, 79, 1, + 79, 1, 79, 1, 79, 1, 79, 1, 80, 1, 80, 1, 80, 1, 80, 1, 80, 1, 81, 1, 81, + 1, 81, 1, 81, 1, 82, 1, 82, 1, 82, 3, 82, 1068, 8, 82, 1, 82, 1, 82, 1, + 83, 1, 83, 1, 83, 1, 83, 1, 84, 1, 84, 1, 84, 1, 84, 1, 85, 1, 85, 1, 85, + 3, 85, 1083, 8, 85, 1, 85, 1, 85, 1, 86, 1, 86, 1, 86, 1, 86, 1, 86, 1, + 87, 1, 87, 1, 87, 3, 87, 1095, 8, 87, 1, 87, 1, 87, 1, 88, 1, 88, 1, 88, + 5, 88, 1102, 8, 88, 10, 88, 12, 88, 1105, 9, 88, 1, 88, 3, 88, 1108, 8, + 88, 1, 89, 1, 89, 1, 90, 1, 90, 1, 90, 1, 90, 5, 90, 1116, 8, 90, 10, 90, + 12, 90, 1119, 9, 90, 1, 90, 3, 90, 1122, 8, 90, 3, 90, 1124, 8, 90, 1, + 90, 1, 90, 1, 91, 1, 91, 1, 91, 1, 91, 1, 92, 1, 92, 3, 92, 1134, 8, 92, + 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 1, 93, 3, 93, 1143, 8, 93, 1, + 94, 1, 94, 1, 94, 1, 94, 1, 94, 3, 94, 1150, 8, 94, 1, 94, 1, 94, 1, 95, + 1, 95, 1, 95, 1, 95, 5, 95, 1158, 8, 95, 10, 95, 12, 95, 1161, 9, 95, 1, + 95, 3, 95, 1164, 8, 95, 3, 95, 1166, 8, 95, 1, 95, 1, 95, 1, 96, 1, 96, + 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, + 96, 3, 96, 1183, 8, 96, 1, 97, 1, 97, 1, 97, 3, 97, 1188, 8, 97, 1, 97, + 1, 97, 1, 98, 1, 98, 1, 98, 3, 98, 1195, 8, 98, 1, 98, 1, 98, 1, 99, 1, + 99, 1, 99, 1, 99, 3, 99, 1203, 8, 99, 1, 99, 1, 99, 1, 100, 1, 100, 1, + 100, 1, 100, 1, 100, 1, 101, 1, 101, 1, 101, 1, 101, 3, 101, 1216, 8, 101, + 1, 101, 1, 101, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 103, 1, 103, + 1, 103, 1, 103, 1, 103, 1, 104, 1, 104, 1, 104, 1, 104, 1, 104, 1, 105, + 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, 1, 105, + 1, 105, 3, 105, 1246, 8, 105, 1, 106, 1, 106, 1, 106, 1, 106, 1, 106, 3, + 106, 1253, 8, 106, 1, 106, 1, 106, 1, 107, 1, 107, 1, 107, 1, 107, 1, 107, + 1, 107, 1, 107, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, + 1, 108, 1, 108, 1, 108, 1, 108, 1, 108, 3, 108, 1276, 8, 108, 1, 109, 1, + 109, 1, 109, 1, 109, 1, 109, 1, 110, 1, 110, 1, 110, 1, 110, 1, 110, 1, + 110, 1, 110, 1, 111, 1, 111, 1, 111, 1, 111, 1, 111, 3, 111, 1295, 8, 111, + 1, 112, 1, 112, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, + 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, + 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, + 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, + 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, + 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, + 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, + 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, + 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, + 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, + 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, + 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, + 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, + 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, + 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, + 1, 113, 1, 113, 1, 113, 1, 113, 1, 113, 3, 113, 1437, 8, 113, 1, 113, 0, + 0, 114, 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, 66, 68, + 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, + 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, + 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, + 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, + 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, + 226, 0, 8, 1, 0, 2, 3, 1, 0, 96, 97, 1, 0, 7, 8, 1, 0, 13, 29, 1, 0, 17, + 18, 1, 0, 19, 20, 1, 0, 22, 23, 1, 0, 151, 152, 1673, 0, 231, 1, 0, 0, + 0, 2, 276, 1, 0, 0, 0, 4, 282, 1, 0, 0, 0, 6, 389, 1, 0, 0, 0, 8, 391, + 1, 0, 0, 0, 10, 398, 1, 0, 0, 0, 12, 411, 1, 0, 0, 0, 14, 415, 1, 0, 0, + 0, 16, 451, 1, 0, 0, 0, 18, 477, 1, 0, 0, 0, 20, 481, 1, 0, 0, 0, 22, 485, + 1, 0, 0, 0, 24, 494, 1, 0, 0, 0, 26, 547, 1, 0, 0, 0, 28, 549, 1, 0, 0, + 0, 30, 588, 1, 0, 0, 0, 32, 590, 1, 0, 0, 0, 34, 662, 1, 0, 0, 0, 36, 676, + 1, 0, 0, 0, 38, 678, 1, 0, 0, 0, 40, 754, 1, 0, 0, 0, 42, 756, 1, 0, 0, + 0, 44, 763, 1, 0, 0, 0, 46, 770, 1, 0, 0, 0, 48, 777, 1, 0, 0, 0, 50, 784, + 1, 0, 0, 0, 52, 789, 1, 0, 0, 0, 54, 794, 1, 0, 0, 0, 56, 798, 1, 0, 0, + 0, 58, 803, 1, 0, 0, 0, 60, 808, 1, 0, 0, 0, 62, 813, 1, 0, 0, 0, 64, 818, + 1, 0, 0, 0, 66, 823, 1, 0, 0, 0, 68, 828, 1, 0, 0, 0, 70, 833, 1, 0, 0, + 0, 72, 838, 1, 0, 0, 0, 74, 843, 1, 0, 0, 0, 76, 848, 1, 0, 0, 0, 78, 853, + 1, 0, 0, 0, 80, 858, 1, 0, 0, 0, 82, 863, 1, 0, 0, 0, 84, 870, 1, 0, 0, + 0, 86, 877, 1, 0, 0, 0, 88, 882, 1, 0, 0, 0, 90, 889, 1, 0, 0, 0, 92, 893, + 1, 0, 0, 0, 94, 897, 1, 0, 0, 0, 96, 901, 1, 0, 0, 0, 98, 905, 1, 0, 0, + 0, 100, 909, 1, 0, 0, 0, 102, 916, 1, 0, 0, 0, 104, 923, 1, 0, 0, 0, 106, + 928, 1, 0, 0, 0, 108, 933, 1, 0, 0, 0, 110, 938, 1, 0, 0, 0, 112, 942, + 1, 0, 0, 0, 114, 947, 1, 0, 0, 0, 116, 952, 1, 0, 0, 0, 118, 956, 1, 0, + 0, 0, 120, 961, 1, 0, 0, 0, 122, 966, 1, 0, 0, 0, 124, 973, 1, 0, 0, 0, + 126, 978, 1, 0, 0, 0, 128, 982, 1, 0, 0, 0, 130, 987, 1, 0, 0, 0, 132, + 991, 1, 0, 0, 0, 134, 995, 1, 0, 0, 0, 136, 999, 1, 0, 0, 0, 138, 1004, + 1, 0, 0, 0, 140, 1009, 1, 0, 0, 0, 142, 1014, 1, 0, 0, 0, 144, 1019, 1, + 0, 0, 0, 146, 1024, 1, 0, 0, 0, 148, 1028, 1, 0, 0, 0, 150, 1032, 1, 0, + 0, 0, 152, 1036, 1, 0, 0, 0, 154, 1040, 1, 0, 0, 0, 156, 1045, 1, 0, 0, + 0, 158, 1050, 1, 0, 0, 0, 160, 1055, 1, 0, 0, 0, 162, 1060, 1, 0, 0, 0, + 164, 1064, 1, 0, 0, 0, 166, 1071, 1, 0, 0, 0, 168, 1075, 1, 0, 0, 0, 170, + 1079, 1, 0, 0, 0, 172, 1086, 1, 0, 0, 0, 174, 1091, 1, 0, 0, 0, 176, 1098, + 1, 0, 0, 0, 178, 1109, 1, 0, 0, 0, 180, 1111, 1, 0, 0, 0, 182, 1127, 1, + 0, 0, 0, 184, 1133, 1, 0, 0, 0, 186, 1142, 1, 0, 0, 0, 188, 1144, 1, 0, + 0, 0, 190, 1153, 1, 0, 0, 0, 192, 1182, 1, 0, 0, 0, 194, 1184, 1, 0, 0, + 0, 196, 1191, 1, 0, 0, 0, 198, 1198, 1, 0, 0, 0, 200, 1206, 1, 0, 0, 0, + 202, 1211, 1, 0, 0, 0, 204, 1219, 1, 0, 0, 0, 206, 1224, 1, 0, 0, 0, 208, + 1229, 1, 0, 0, 0, 210, 1245, 1, 0, 0, 0, 212, 1247, 1, 0, 0, 0, 214, 1256, + 1, 0, 0, 0, 216, 1275, 1, 0, 0, 0, 218, 1277, 1, 0, 0, 0, 220, 1282, 1, + 0, 0, 0, 222, 1294, 1, 0, 0, 0, 224, 1296, 1, 0, 0, 0, 226, 1436, 1, 0, + 0, 0, 228, 230, 3, 2, 1, 0, 229, 228, 1, 0, 0, 0, 230, 233, 1, 0, 0, 0, + 231, 229, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, 234, 1, 0, 0, 0, 233, + 231, 1, 0, 0, 0, 234, 235, 5, 0, 0, 1, 235, 1, 1, 0, 0, 0, 236, 238, 3, + 4, 2, 0, 237, 239, 5, 145, 0, 0, 238, 237, 1, 0, 0, 0, 238, 239, 1, 0, + 0, 0, 239, 277, 1, 0, 0, 0, 240, 242, 3, 6, 3, 0, 241, 243, 5, 145, 0, + 0, 242, 241, 1, 0, 0, 0, 242, 243, 1, 0, 0, 0, 243, 277, 1, 0, 0, 0, 244, + 246, 3, 10, 5, 0, 245, 247, 5, 145, 0, 0, 246, 245, 1, 0, 0, 0, 246, 247, + 1, 0, 0, 0, 247, 277, 1, 0, 0, 0, 248, 250, 3, 18, 9, 0, 249, 251, 5, 145, + 0, 0, 250, 249, 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 277, 1, 0, 0, 0, + 252, 254, 3, 22, 11, 0, 253, 255, 5, 145, 0, 0, 254, 253, 1, 0, 0, 0, 254, + 255, 1, 0, 0, 0, 255, 277, 1, 0, 0, 0, 256, 258, 3, 24, 12, 0, 257, 259, + 5, 145, 0, 0, 258, 257, 1, 0, 0, 0, 258, 259, 1, 0, 0, 0, 259, 277, 1, + 0, 0, 0, 260, 262, 3, 26, 13, 0, 261, 263, 5, 145, 0, 0, 262, 261, 1, 0, + 0, 0, 262, 263, 1, 0, 0, 0, 263, 277, 1, 0, 0, 0, 264, 266, 3, 28, 14, + 0, 265, 267, 5, 145, 0, 0, 266, 265, 1, 0, 0, 0, 266, 267, 1, 0, 0, 0, + 267, 277, 1, 0, 0, 0, 268, 270, 3, 30, 15, 0, 269, 271, 5, 145, 0, 0, 270, + 269, 1, 0, 0, 0, 270, 271, 1, 0, 0, 0, 271, 277, 1, 0, 0, 0, 272, 274, + 3, 32, 16, 0, 273, 275, 5, 145, 0, 0, 274, 273, 1, 0, 0, 0, 274, 275, 1, + 0, 0, 0, 275, 277, 1, 0, 0, 0, 276, 236, 1, 0, 0, 0, 276, 240, 1, 0, 0, + 0, 276, 244, 1, 0, 0, 0, 276, 248, 1, 0, 0, 0, 276, 252, 1, 0, 0, 0, 276, + 256, 1, 0, 0, 0, 276, 260, 1, 0, 0, 0, 276, 264, 1, 0, 0, 0, 276, 268, + 1, 0, 0, 0, 276, 272, 1, 0, 0, 0, 277, 3, 1, 0, 0, 0, 278, 279, 5, 1, 0, + 0, 279, 283, 7, 0, 0, 0, 280, 281, 5, 1, 0, 0, 281, 283, 5, 4, 0, 0, 282, + 278, 1, 0, 0, 0, 282, 280, 1, 0, 0, 0, 283, 5, 1, 0, 0, 0, 284, 285, 5, + 5, 0, 0, 285, 286, 5, 144, 0, 0, 286, 287, 5, 11, 0, 0, 287, 288, 5, 136, + 0, 0, 288, 290, 5, 137, 0, 0, 289, 291, 3, 38, 19, 0, 290, 289, 1, 0, 0, + 0, 290, 291, 1, 0, 0, 0, 291, 390, 1, 0, 0, 0, 292, 293, 5, 5, 0, 0, 293, + 294, 5, 144, 0, 0, 294, 295, 5, 12, 0, 0, 295, 297, 5, 136, 0, 0, 296, + 298, 3, 176, 88, 0, 297, 296, 1, 0, 0, 0, 297, 298, 1, 0, 0, 0, 298, 299, + 1, 0, 0, 0, 299, 301, 5, 137, 0, 0, 300, 302, 3, 38, 19, 0, 301, 300, 1, + 0, 0, 0, 301, 302, 1, 0, 0, 0, 302, 390, 1, 0, 0, 0, 303, 304, 5, 5, 0, + 0, 304, 305, 5, 144, 0, 0, 305, 306, 5, 61, 0, 0, 306, 307, 5, 136, 0, + 0, 307, 308, 3, 176, 88, 0, 308, 309, 5, 137, 0, 0, 309, 390, 1, 0, 0, + 0, 310, 311, 5, 5, 0, 0, 311, 312, 5, 144, 0, 0, 312, 313, 5, 62, 0, 0, + 313, 314, 5, 136, 0, 0, 314, 390, 5, 137, 0, 0, 315, 316, 5, 5, 0, 0, 316, + 317, 5, 144, 0, 0, 317, 318, 5, 53, 0, 0, 318, 320, 5, 136, 0, 0, 319, + 321, 3, 178, 89, 0, 320, 319, 1, 0, 0, 0, 320, 321, 1, 0, 0, 0, 321, 322, + 1, 0, 0, 0, 322, 390, 5, 137, 0, 0, 323, 324, 5, 5, 0, 0, 324, 325, 5, + 144, 0, 0, 325, 326, 5, 66, 0, 0, 326, 328, 5, 136, 0, 0, 327, 329, 3, + 178, 89, 0, 328, 327, 1, 0, 0, 0, 328, 329, 1, 0, 0, 0, 329, 330, 1, 0, + 0, 0, 330, 390, 5, 137, 0, 0, 331, 332, 5, 5, 0, 0, 332, 333, 5, 144, 0, + 0, 333, 334, 5, 65, 0, 0, 334, 335, 5, 136, 0, 0, 335, 390, 5, 137, 0, + 0, 336, 337, 5, 5, 0, 0, 337, 338, 5, 144, 0, 0, 338, 339, 5, 67, 0, 0, + 339, 340, 5, 136, 0, 0, 340, 390, 5, 137, 0, 0, 341, 342, 5, 5, 0, 0, 342, + 343, 5, 144, 0, 0, 343, 344, 5, 63, 0, 0, 344, 345, 5, 136, 0, 0, 345, + 390, 5, 137, 0, 0, 346, 347, 5, 5, 0, 0, 347, 348, 5, 144, 0, 0, 348, 349, + 5, 64, 0, 0, 349, 350, 5, 136, 0, 0, 350, 390, 5, 137, 0, 0, 351, 352, + 5, 5, 0, 0, 352, 353, 5, 144, 0, 0, 353, 354, 5, 68, 0, 0, 354, 355, 5, + 136, 0, 0, 355, 356, 3, 176, 88, 0, 356, 357, 5, 137, 0, 0, 357, 390, 1, + 0, 0, 0, 358, 359, 5, 5, 0, 0, 359, 360, 5, 144, 0, 0, 360, 361, 5, 69, + 0, 0, 361, 362, 5, 136, 0, 0, 362, 363, 3, 176, 88, 0, 363, 364, 5, 137, + 0, 0, 364, 390, 1, 0, 0, 0, 365, 366, 5, 5, 0, 0, 366, 367, 5, 144, 0, + 0, 367, 368, 5, 70, 0, 0, 368, 369, 5, 136, 0, 0, 369, 390, 5, 137, 0, + 0, 370, 371, 5, 5, 0, 0, 371, 372, 5, 144, 0, 0, 372, 373, 5, 71, 0, 0, + 373, 374, 5, 136, 0, 0, 374, 390, 5, 137, 0, 0, 375, 376, 5, 5, 0, 0, 376, + 377, 5, 144, 0, 0, 377, 378, 5, 72, 0, 0, 378, 379, 5, 136, 0, 0, 379, + 380, 3, 178, 89, 0, 380, 381, 5, 137, 0, 0, 381, 390, 1, 0, 0, 0, 382, + 383, 5, 5, 0, 0, 383, 384, 5, 144, 0, 0, 384, 390, 3, 8, 4, 0, 385, 386, + 5, 5, 0, 0, 386, 387, 3, 36, 18, 0, 387, 388, 3, 38, 19, 0, 388, 390, 1, + 0, 0, 0, 389, 284, 1, 0, 0, 0, 389, 292, 1, 0, 0, 0, 389, 303, 1, 0, 0, + 0, 389, 310, 1, 0, 0, 0, 389, 315, 1, 0, 0, 0, 389, 323, 1, 0, 0, 0, 389, + 331, 1, 0, 0, 0, 389, 336, 1, 0, 0, 0, 389, 341, 1, 0, 0, 0, 389, 346, + 1, 0, 0, 0, 389, 351, 1, 0, 0, 0, 389, 358, 1, 0, 0, 0, 389, 365, 1, 0, + 0, 0, 389, 370, 1, 0, 0, 0, 389, 375, 1, 0, 0, 0, 389, 382, 1, 0, 0, 0, + 389, 385, 1, 0, 0, 0, 390, 7, 1, 0, 0, 0, 391, 392, 3, 226, 113, 0, 392, + 394, 5, 136, 0, 0, 393, 395, 3, 176, 88, 0, 394, 393, 1, 0, 0, 0, 394, + 395, 1, 0, 0, 0, 395, 396, 1, 0, 0, 0, 396, 397, 5, 137, 0, 0, 397, 9, + 1, 0, 0, 0, 398, 399, 5, 5, 0, 0, 399, 400, 3, 36, 18, 0, 400, 401, 5, + 144, 0, 0, 401, 403, 3, 12, 6, 0, 402, 404, 3, 14, 7, 0, 403, 402, 1, 0, + 0, 0, 403, 404, 1, 0, 0, 0, 404, 11, 1, 0, 0, 0, 405, 406, 5, 99, 0, 0, + 406, 407, 5, 136, 0, 0, 407, 412, 5, 137, 0, 0, 408, 409, 5, 100, 0, 0, + 409, 410, 5, 136, 0, 0, 410, 412, 5, 137, 0, 0, 411, 405, 1, 0, 0, 0, 411, + 408, 1, 0, 0, 0, 412, 13, 1, 0, 0, 0, 413, 414, 5, 144, 0, 0, 414, 416, + 3, 16, 8, 0, 415, 413, 1, 0, 0, 0, 416, 417, 1, 0, 0, 0, 417, 415, 1, 0, + 0, 0, 417, 418, 1, 0, 0, 0, 418, 15, 1, 0, 0, 0, 419, 420, 5, 30, 0, 0, + 420, 421, 5, 136, 0, 0, 421, 422, 3, 178, 89, 0, 422, 423, 5, 137, 0, 0, + 423, 452, 1, 0, 0, 0, 424, 425, 5, 104, 0, 0, 425, 426, 5, 136, 0, 0, 426, + 427, 3, 178, 89, 0, 427, 428, 5, 137, 0, 0, 428, 452, 1, 0, 0, 0, 429, + 430, 5, 105, 0, 0, 430, 431, 5, 136, 0, 0, 431, 452, 5, 137, 0, 0, 432, + 433, 5, 101, 0, 0, 433, 435, 5, 136, 0, 0, 434, 436, 3, 178, 89, 0, 435, + 434, 1, 0, 0, 0, 435, 436, 1, 0, 0, 0, 436, 437, 1, 0, 0, 0, 437, 452, + 5, 137, 0, 0, 438, 439, 5, 102, 0, 0, 439, 440, 5, 136, 0, 0, 440, 452, + 5, 137, 0, 0, 441, 442, 5, 103, 0, 0, 442, 443, 5, 136, 0, 0, 443, 452, + 5, 137, 0, 0, 444, 445, 3, 226, 113, 0, 445, 447, 5, 136, 0, 0, 446, 448, + 3, 176, 88, 0, 447, 446, 1, 0, 0, 0, 447, 448, 1, 0, 0, 0, 448, 449, 1, + 0, 0, 0, 449, 450, 5, 137, 0, 0, 450, 452, 1, 0, 0, 0, 451, 419, 1, 0, + 0, 0, 451, 424, 1, 0, 0, 0, 451, 429, 1, 0, 0, 0, 451, 432, 1, 0, 0, 0, + 451, 438, 1, 0, 0, 0, 451, 441, 1, 0, 0, 0, 451, 444, 1, 0, 0, 0, 452, + 17, 1, 0, 0, 0, 453, 454, 5, 73, 0, 0, 454, 456, 5, 136, 0, 0, 455, 457, + 3, 176, 88, 0, 456, 455, 1, 0, 0, 0, 456, 457, 1, 0, 0, 0, 457, 458, 1, + 0, 0, 0, 458, 460, 5, 137, 0, 0, 459, 461, 3, 20, 10, 0, 460, 459, 1, 0, + 0, 0, 460, 461, 1, 0, 0, 0, 461, 478, 1, 0, 0, 0, 462, 463, 5, 74, 0, 0, + 463, 465, 5, 136, 0, 0, 464, 466, 3, 176, 88, 0, 465, 464, 1, 0, 0, 0, + 465, 466, 1, 0, 0, 0, 466, 467, 1, 0, 0, 0, 467, 469, 5, 137, 0, 0, 468, + 470, 3, 20, 10, 0, 469, 468, 1, 0, 0, 0, 469, 470, 1, 0, 0, 0, 470, 478, + 1, 0, 0, 0, 471, 472, 5, 5, 0, 0, 472, 473, 5, 144, 0, 0, 473, 474, 5, + 71, 0, 0, 474, 475, 5, 136, 0, 0, 475, 476, 5, 137, 0, 0, 476, 478, 3, + 20, 10, 0, 477, 453, 1, 0, 0, 0, 477, 462, 1, 0, 0, 0, 477, 471, 1, 0, + 0, 0, 478, 19, 1, 0, 0, 0, 479, 480, 5, 144, 0, 0, 480, 482, 3, 34, 17, + 0, 481, 479, 1, 0, 0, 0, 482, 483, 1, 0, 0, 0, 483, 481, 1, 0, 0, 0, 483, + 484, 1, 0, 0, 0, 484, 21, 1, 0, 0, 0, 485, 486, 5, 75, 0, 0, 486, 487, + 5, 144, 0, 0, 487, 488, 3, 226, 113, 0, 488, 490, 5, 136, 0, 0, 489, 491, + 3, 176, 88, 0, 490, 489, 1, 0, 0, 0, 490, 491, 1, 0, 0, 0, 491, 492, 1, + 0, 0, 0, 492, 493, 5, 137, 0, 0, 493, 23, 1, 0, 0, 0, 494, 495, 5, 76, + 0, 0, 495, 496, 5, 144, 0, 0, 496, 497, 3, 226, 113, 0, 497, 499, 5, 136, + 0, 0, 498, 500, 3, 176, 88, 0, 499, 498, 1, 0, 0, 0, 499, 500, 1, 0, 0, + 0, 500, 501, 1, 0, 0, 0, 501, 502, 5, 137, 0, 0, 502, 25, 1, 0, 0, 0, 503, + 504, 5, 5, 0, 0, 504, 505, 5, 144, 0, 0, 505, 506, 5, 71, 0, 0, 506, 507, + 5, 136, 0, 0, 507, 508, 5, 137, 0, 0, 508, 509, 5, 144, 0, 0, 509, 510, + 5, 90, 0, 0, 510, 511, 5, 136, 0, 0, 511, 522, 5, 137, 0, 0, 512, 513, + 5, 144, 0, 0, 513, 514, 3, 226, 113, 0, 514, 516, 5, 136, 0, 0, 515, 517, + 3, 176, 88, 0, 516, 515, 1, 0, 0, 0, 516, 517, 1, 0, 0, 0, 517, 518, 1, + 0, 0, 0, 518, 519, 5, 137, 0, 0, 519, 521, 1, 0, 0, 0, 520, 512, 1, 0, + 0, 0, 521, 524, 1, 0, 0, 0, 522, 520, 1, 0, 0, 0, 522, 523, 1, 0, 0, 0, + 523, 548, 1, 0, 0, 0, 524, 522, 1, 0, 0, 0, 525, 526, 5, 5, 0, 0, 526, + 527, 5, 144, 0, 0, 527, 528, 5, 71, 0, 0, 528, 529, 5, 136, 0, 0, 529, + 530, 5, 137, 0, 0, 530, 531, 5, 144, 0, 0, 531, 532, 5, 91, 0, 0, 532, + 533, 5, 136, 0, 0, 533, 544, 5, 137, 0, 0, 534, 535, 5, 144, 0, 0, 535, + 536, 3, 226, 113, 0, 536, 538, 5, 136, 0, 0, 537, 539, 3, 176, 88, 0, 538, + 537, 1, 0, 0, 0, 538, 539, 1, 0, 0, 0, 539, 540, 1, 0, 0, 0, 540, 541, + 5, 137, 0, 0, 541, 543, 1, 0, 0, 0, 542, 534, 1, 0, 0, 0, 543, 546, 1, + 0, 0, 0, 544, 542, 1, 0, 0, 0, 544, 545, 1, 0, 0, 0, 545, 548, 1, 0, 0, + 0, 546, 544, 1, 0, 0, 0, 547, 503, 1, 0, 0, 0, 547, 525, 1, 0, 0, 0, 548, + 27, 1, 0, 0, 0, 549, 550, 5, 5, 0, 0, 550, 551, 3, 36, 18, 0, 551, 552, + 5, 144, 0, 0, 552, 553, 5, 92, 0, 0, 553, 554, 5, 136, 0, 0, 554, 565, + 5, 137, 0, 0, 555, 556, 5, 144, 0, 0, 556, 557, 3, 226, 113, 0, 557, 559, + 5, 136, 0, 0, 558, 560, 3, 176, 88, 0, 559, 558, 1, 0, 0, 0, 559, 560, + 1, 0, 0, 0, 560, 561, 1, 0, 0, 0, 561, 562, 5, 137, 0, 0, 562, 564, 1, + 0, 0, 0, 563, 555, 1, 0, 0, 0, 564, 567, 1, 0, 0, 0, 565, 563, 1, 0, 0, + 0, 565, 566, 1, 0, 0, 0, 566, 29, 1, 0, 0, 0, 567, 565, 1, 0, 0, 0, 568, + 569, 5, 77, 0, 0, 569, 570, 5, 144, 0, 0, 570, 571, 3, 226, 113, 0, 571, + 573, 5, 136, 0, 0, 572, 574, 3, 176, 88, 0, 573, 572, 1, 0, 0, 0, 573, + 574, 1, 0, 0, 0, 574, 575, 1, 0, 0, 0, 575, 576, 5, 137, 0, 0, 576, 589, + 1, 0, 0, 0, 577, 578, 5, 77, 0, 0, 578, 579, 5, 144, 0, 0, 579, 580, 3, + 226, 113, 0, 580, 581, 5, 144, 0, 0, 581, 582, 3, 226, 113, 0, 582, 584, + 5, 136, 0, 0, 583, 585, 3, 176, 88, 0, 584, 583, 1, 0, 0, 0, 584, 585, + 1, 0, 0, 0, 585, 586, 1, 0, 0, 0, 586, 587, 5, 137, 0, 0, 587, 589, 1, + 0, 0, 0, 588, 568, 1, 0, 0, 0, 588, 577, 1, 0, 0, 0, 589, 31, 1, 0, 0, + 0, 590, 591, 3, 226, 113, 0, 591, 593, 5, 136, 0, 0, 592, 594, 3, 176, + 88, 0, 593, 592, 1, 0, 0, 0, 593, 594, 1, 0, 0, 0, 594, 595, 1, 0, 0, 0, + 595, 596, 5, 137, 0, 0, 596, 33, 1, 0, 0, 0, 597, 598, 5, 78, 0, 0, 598, + 599, 5, 136, 0, 0, 599, 600, 3, 178, 89, 0, 600, 601, 5, 137, 0, 0, 601, + 663, 1, 0, 0, 0, 602, 603, 5, 79, 0, 0, 603, 604, 5, 136, 0, 0, 604, 663, + 5, 137, 0, 0, 605, 606, 5, 80, 0, 0, 606, 607, 5, 136, 0, 0, 607, 663, + 5, 137, 0, 0, 608, 609, 5, 81, 0, 0, 609, 610, 5, 136, 0, 0, 610, 663, + 5, 137, 0, 0, 611, 612, 5, 82, 0, 0, 612, 613, 5, 136, 0, 0, 613, 663, + 5, 137, 0, 0, 614, 615, 5, 83, 0, 0, 615, 616, 5, 136, 0, 0, 616, 663, + 5, 137, 0, 0, 617, 618, 5, 84, 0, 0, 618, 619, 5, 136, 0, 0, 619, 620, + 3, 176, 88, 0, 620, 621, 5, 137, 0, 0, 621, 663, 1, 0, 0, 0, 622, 623, + 5, 85, 0, 0, 623, 624, 5, 136, 0, 0, 624, 625, 3, 178, 89, 0, 625, 626, + 5, 137, 0, 0, 626, 663, 1, 0, 0, 0, 627, 628, 5, 86, 0, 0, 628, 629, 5, + 136, 0, 0, 629, 630, 3, 178, 89, 0, 630, 631, 5, 137, 0, 0, 631, 663, 1, + 0, 0, 0, 632, 633, 5, 87, 0, 0, 633, 635, 5, 136, 0, 0, 634, 636, 3, 178, + 89, 0, 635, 634, 1, 0, 0, 0, 635, 636, 1, 0, 0, 0, 636, 637, 1, 0, 0, 0, + 637, 663, 5, 137, 0, 0, 638, 639, 5, 88, 0, 0, 639, 641, 5, 136, 0, 0, + 640, 642, 3, 176, 88, 0, 641, 640, 1, 0, 0, 0, 641, 642, 1, 0, 0, 0, 642, + 643, 1, 0, 0, 0, 643, 663, 5, 137, 0, 0, 644, 645, 5, 107, 0, 0, 645, 646, + 5, 136, 0, 0, 646, 663, 5, 137, 0, 0, 647, 648, 5, 69, 0, 0, 648, 649, + 5, 136, 0, 0, 649, 650, 3, 176, 88, 0, 650, 651, 5, 137, 0, 0, 651, 663, + 1, 0, 0, 0, 652, 653, 5, 89, 0, 0, 653, 654, 5, 136, 0, 0, 654, 663, 5, + 137, 0, 0, 655, 656, 3, 226, 113, 0, 656, 658, 5, 136, 0, 0, 657, 659, + 3, 176, 88, 0, 658, 657, 1, 0, 0, 0, 658, 659, 1, 0, 0, 0, 659, 660, 1, + 0, 0, 0, 660, 661, 5, 137, 0, 0, 661, 663, 1, 0, 0, 0, 662, 597, 1, 0, + 0, 0, 662, 602, 1, 0, 0, 0, 662, 605, 1, 0, 0, 0, 662, 608, 1, 0, 0, 0, + 662, 611, 1, 0, 0, 0, 662, 614, 1, 0, 0, 0, 662, 617, 1, 0, 0, 0, 662, + 622, 1, 0, 0, 0, 662, 627, 1, 0, 0, 0, 662, 632, 1, 0, 0, 0, 662, 638, + 1, 0, 0, 0, 662, 644, 1, 0, 0, 0, 662, 647, 1, 0, 0, 0, 662, 652, 1, 0, + 0, 0, 662, 655, 1, 0, 0, 0, 663, 35, 1, 0, 0, 0, 664, 665, 5, 144, 0, 0, + 665, 677, 3, 226, 113, 0, 666, 667, 5, 140, 0, 0, 667, 668, 3, 224, 112, + 0, 668, 669, 5, 141, 0, 0, 669, 677, 1, 0, 0, 0, 670, 671, 5, 144, 0, 0, + 671, 672, 5, 10, 0, 0, 672, 673, 5, 136, 0, 0, 673, 674, 3, 224, 112, 0, + 674, 675, 5, 137, 0, 0, 675, 677, 1, 0, 0, 0, 676, 664, 1, 0, 0, 0, 676, + 666, 1, 0, 0, 0, 676, 670, 1, 0, 0, 0, 677, 37, 1, 0, 0, 0, 678, 679, 5, + 144, 0, 0, 679, 684, 3, 40, 20, 0, 680, 681, 5, 144, 0, 0, 681, 683, 3, + 40, 20, 0, 682, 680, 1, 0, 0, 0, 683, 686, 1, 0, 0, 0, 684, 682, 1, 0, + 0, 0, 684, 685, 1, 0, 0, 0, 685, 39, 1, 0, 0, 0, 686, 684, 1, 0, 0, 0, + 687, 755, 3, 42, 21, 0, 688, 755, 3, 44, 22, 0, 689, 755, 3, 46, 23, 0, + 690, 755, 3, 48, 24, 0, 691, 755, 3, 50, 25, 0, 692, 755, 3, 52, 26, 0, + 693, 755, 3, 54, 27, 0, 694, 755, 3, 56, 28, 0, 695, 755, 3, 58, 29, 0, + 696, 755, 3, 60, 30, 0, 697, 755, 3, 62, 31, 0, 698, 755, 3, 64, 32, 0, + 699, 755, 3, 66, 33, 0, 700, 755, 3, 68, 34, 0, 701, 755, 3, 70, 35, 0, + 702, 755, 3, 72, 36, 0, 703, 755, 3, 74, 37, 0, 704, 755, 3, 76, 38, 0, + 705, 755, 3, 78, 39, 0, 706, 755, 3, 80, 40, 0, 707, 755, 3, 82, 41, 0, + 708, 755, 3, 84, 42, 0, 709, 755, 3, 86, 43, 0, 710, 755, 3, 88, 44, 0, + 711, 755, 3, 90, 45, 0, 712, 755, 3, 92, 46, 0, 713, 755, 3, 94, 47, 0, + 714, 755, 3, 96, 48, 0, 715, 755, 3, 98, 49, 0, 716, 755, 3, 100, 50, 0, + 717, 755, 3, 102, 51, 0, 718, 755, 3, 104, 52, 0, 719, 755, 3, 106, 53, + 0, 720, 755, 3, 108, 54, 0, 721, 755, 3, 110, 55, 0, 722, 755, 3, 112, + 56, 0, 723, 755, 3, 114, 57, 0, 724, 755, 3, 116, 58, 0, 725, 755, 3, 118, + 59, 0, 726, 755, 3, 120, 60, 0, 727, 755, 3, 122, 61, 0, 728, 755, 3, 124, + 62, 0, 729, 755, 3, 126, 63, 0, 730, 755, 3, 128, 64, 0, 731, 755, 3, 130, + 65, 0, 732, 755, 3, 132, 66, 0, 733, 755, 3, 134, 67, 0, 734, 755, 3, 136, + 68, 0, 735, 755, 3, 138, 69, 0, 736, 755, 3, 140, 70, 0, 737, 755, 3, 142, + 71, 0, 738, 755, 3, 144, 72, 0, 739, 755, 3, 146, 73, 0, 740, 755, 3, 148, + 74, 0, 741, 755, 3, 150, 75, 0, 742, 755, 3, 152, 76, 0, 743, 755, 3, 154, + 77, 0, 744, 755, 3, 156, 78, 0, 745, 755, 3, 158, 79, 0, 746, 755, 3, 160, + 80, 0, 747, 755, 3, 162, 81, 0, 748, 755, 3, 164, 82, 0, 749, 755, 3, 166, + 83, 0, 750, 755, 3, 168, 84, 0, 751, 755, 3, 170, 85, 0, 752, 755, 3, 172, + 86, 0, 753, 755, 3, 174, 87, 0, 754, 687, 1, 0, 0, 0, 754, 688, 1, 0, 0, + 0, 754, 689, 1, 0, 0, 0, 754, 690, 1, 0, 0, 0, 754, 691, 1, 0, 0, 0, 754, + 692, 1, 0, 0, 0, 754, 693, 1, 0, 0, 0, 754, 694, 1, 0, 0, 0, 754, 695, + 1, 0, 0, 0, 754, 696, 1, 0, 0, 0, 754, 697, 1, 0, 0, 0, 754, 698, 1, 0, + 0, 0, 754, 699, 1, 0, 0, 0, 754, 700, 1, 0, 0, 0, 754, 701, 1, 0, 0, 0, + 754, 702, 1, 0, 0, 0, 754, 703, 1, 0, 0, 0, 754, 704, 1, 0, 0, 0, 754, + 705, 1, 0, 0, 0, 754, 706, 1, 0, 0, 0, 754, 707, 1, 0, 0, 0, 754, 708, + 1, 0, 0, 0, 754, 709, 1, 0, 0, 0, 754, 710, 1, 0, 0, 0, 754, 711, 1, 0, + 0, 0, 754, 712, 1, 0, 0, 0, 754, 713, 1, 0, 0, 0, 754, 714, 1, 0, 0, 0, + 754, 715, 1, 0, 0, 0, 754, 716, 1, 0, 0, 0, 754, 717, 1, 0, 0, 0, 754, + 718, 1, 0, 0, 0, 754, 719, 1, 0, 0, 0, 754, 720, 1, 0, 0, 0, 754, 721, + 1, 0, 0, 0, 754, 722, 1, 0, 0, 0, 754, 723, 1, 0, 0, 0, 754, 724, 1, 0, + 0, 0, 754, 725, 1, 0, 0, 0, 754, 726, 1, 0, 0, 0, 754, 727, 1, 0, 0, 0, + 754, 728, 1, 0, 0, 0, 754, 729, 1, 0, 0, 0, 754, 730, 1, 0, 0, 0, 754, + 731, 1, 0, 0, 0, 754, 732, 1, 0, 0, 0, 754, 733, 1, 0, 0, 0, 754, 734, + 1, 0, 0, 0, 754, 735, 1, 0, 0, 0, 754, 736, 1, 0, 0, 0, 754, 737, 1, 0, + 0, 0, 754, 738, 1, 0, 0, 0, 754, 739, 1, 0, 0, 0, 754, 740, 1, 0, 0, 0, + 754, 741, 1, 0, 0, 0, 754, 742, 1, 0, 0, 0, 754, 743, 1, 0, 0, 0, 754, + 744, 1, 0, 0, 0, 754, 745, 1, 0, 0, 0, 754, 746, 1, 0, 0, 0, 754, 747, + 1, 0, 0, 0, 754, 748, 1, 0, 0, 0, 754, 749, 1, 0, 0, 0, 754, 750, 1, 0, + 0, 0, 754, 751, 1, 0, 0, 0, 754, 752, 1, 0, 0, 0, 754, 753, 1, 0, 0, 0, + 755, 41, 1, 0, 0, 0, 756, 757, 5, 30, 0, 0, 757, 759, 5, 136, 0, 0, 758, + 760, 3, 178, 89, 0, 759, 758, 1, 0, 0, 0, 759, 760, 1, 0, 0, 0, 760, 761, + 1, 0, 0, 0, 761, 762, 5, 137, 0, 0, 762, 43, 1, 0, 0, 0, 763, 764, 5, 31, + 0, 0, 764, 766, 5, 136, 0, 0, 765, 767, 3, 178, 89, 0, 766, 765, 1, 0, + 0, 0, 766, 767, 1, 0, 0, 0, 767, 768, 1, 0, 0, 0, 768, 769, 5, 137, 0, + 0, 769, 45, 1, 0, 0, 0, 770, 771, 5, 32, 0, 0, 771, 773, 5, 136, 0, 0, + 772, 774, 3, 176, 88, 0, 773, 772, 1, 0, 0, 0, 773, 774, 1, 0, 0, 0, 774, + 775, 1, 0, 0, 0, 775, 776, 5, 137, 0, 0, 776, 47, 1, 0, 0, 0, 777, 778, + 5, 33, 0, 0, 778, 780, 5, 136, 0, 0, 779, 781, 3, 178, 89, 0, 780, 779, + 1, 0, 0, 0, 780, 781, 1, 0, 0, 0, 781, 782, 1, 0, 0, 0, 782, 783, 5, 137, + 0, 0, 783, 49, 1, 0, 0, 0, 784, 785, 5, 34, 0, 0, 785, 786, 5, 136, 0, + 0, 786, 787, 3, 176, 88, 0, 787, 788, 5, 137, 0, 0, 788, 51, 1, 0, 0, 0, + 789, 790, 5, 35, 0, 0, 790, 791, 5, 136, 0, 0, 791, 792, 3, 176, 88, 0, + 792, 793, 5, 137, 0, 0, 793, 53, 1, 0, 0, 0, 794, 795, 5, 36, 0, 0, 795, + 796, 5, 136, 0, 0, 796, 797, 5, 137, 0, 0, 797, 55, 1, 0, 0, 0, 798, 799, + 5, 37, 0, 0, 799, 800, 5, 136, 0, 0, 800, 801, 3, 176, 88, 0, 801, 802, + 5, 137, 0, 0, 802, 57, 1, 0, 0, 0, 803, 804, 5, 38, 0, 0, 804, 805, 5, + 136, 0, 0, 805, 806, 3, 176, 88, 0, 806, 807, 5, 137, 0, 0, 807, 59, 1, + 0, 0, 0, 808, 809, 5, 39, 0, 0, 809, 810, 5, 136, 0, 0, 810, 811, 3, 176, + 88, 0, 811, 812, 5, 137, 0, 0, 812, 61, 1, 0, 0, 0, 813, 814, 5, 40, 0, + 0, 814, 815, 5, 136, 0, 0, 815, 816, 3, 176, 88, 0, 816, 817, 5, 137, 0, + 0, 817, 63, 1, 0, 0, 0, 818, 819, 5, 41, 0, 0, 819, 820, 5, 136, 0, 0, + 820, 821, 3, 176, 88, 0, 821, 822, 5, 137, 0, 0, 822, 65, 1, 0, 0, 0, 823, + 824, 5, 42, 0, 0, 824, 825, 5, 136, 0, 0, 825, 826, 3, 176, 88, 0, 826, + 827, 5, 137, 0, 0, 827, 67, 1, 0, 0, 0, 828, 829, 5, 43, 0, 0, 829, 830, + 5, 136, 0, 0, 830, 831, 3, 176, 88, 0, 831, 832, 5, 137, 0, 0, 832, 69, + 1, 0, 0, 0, 833, 834, 5, 44, 0, 0, 834, 835, 5, 136, 0, 0, 835, 836, 3, + 176, 88, 0, 836, 837, 5, 137, 0, 0, 837, 71, 1, 0, 0, 0, 838, 839, 5, 45, + 0, 0, 839, 840, 5, 136, 0, 0, 840, 841, 3, 176, 88, 0, 841, 842, 5, 137, + 0, 0, 842, 73, 1, 0, 0, 0, 843, 844, 5, 46, 0, 0, 844, 845, 5, 136, 0, + 0, 845, 846, 3, 176, 88, 0, 846, 847, 5, 137, 0, 0, 847, 75, 1, 0, 0, 0, + 848, 849, 5, 47, 0, 0, 849, 850, 5, 136, 0, 0, 850, 851, 3, 176, 88, 0, + 851, 852, 5, 137, 0, 0, 852, 77, 1, 0, 0, 0, 853, 854, 5, 48, 0, 0, 854, + 855, 5, 136, 0, 0, 855, 856, 3, 176, 88, 0, 856, 857, 5, 137, 0, 0, 857, + 79, 1, 0, 0, 0, 858, 859, 5, 49, 0, 0, 859, 860, 5, 136, 0, 0, 860, 861, + 3, 178, 89, 0, 861, 862, 5, 137, 0, 0, 862, 81, 1, 0, 0, 0, 863, 864, 5, + 50, 0, 0, 864, 866, 5, 136, 0, 0, 865, 867, 3, 178, 89, 0, 866, 865, 1, + 0, 0, 0, 866, 867, 1, 0, 0, 0, 867, 868, 1, 0, 0, 0, 868, 869, 5, 137, + 0, 0, 869, 83, 1, 0, 0, 0, 870, 871, 5, 51, 0, 0, 871, 873, 5, 136, 0, + 0, 872, 874, 3, 178, 89, 0, 873, 872, 1, 0, 0, 0, 873, 874, 1, 0, 0, 0, + 874, 875, 1, 0, 0, 0, 875, 876, 5, 137, 0, 0, 876, 85, 1, 0, 0, 0, 877, + 878, 5, 52, 0, 0, 878, 879, 5, 136, 0, 0, 879, 880, 3, 176, 88, 0, 880, + 881, 5, 137, 0, 0, 881, 87, 1, 0, 0, 0, 882, 883, 5, 53, 0, 0, 883, 885, + 5, 136, 0, 0, 884, 886, 3, 178, 89, 0, 885, 884, 1, 0, 0, 0, 885, 886, + 1, 0, 0, 0, 886, 887, 1, 0, 0, 0, 887, 888, 5, 137, 0, 0, 888, 89, 1, 0, + 0, 0, 889, 890, 5, 54, 0, 0, 890, 891, 5, 136, 0, 0, 891, 892, 5, 137, + 0, 0, 892, 91, 1, 0, 0, 0, 893, 894, 5, 55, 0, 0, 894, 895, 5, 136, 0, + 0, 895, 896, 5, 137, 0, 0, 896, 93, 1, 0, 0, 0, 897, 898, 5, 56, 0, 0, + 898, 899, 5, 136, 0, 0, 899, 900, 5, 137, 0, 0, 900, 95, 1, 0, 0, 0, 901, + 902, 5, 57, 0, 0, 902, 903, 5, 136, 0, 0, 903, 904, 5, 137, 0, 0, 904, + 97, 1, 0, 0, 0, 905, 906, 5, 58, 0, 0, 906, 907, 5, 136, 0, 0, 907, 908, + 5, 137, 0, 0, 908, 99, 1, 0, 0, 0, 909, 910, 5, 59, 0, 0, 910, 912, 5, + 136, 0, 0, 911, 913, 3, 178, 89, 0, 912, 911, 1, 0, 0, 0, 912, 913, 1, + 0, 0, 0, 913, 914, 1, 0, 0, 0, 914, 915, 5, 137, 0, 0, 915, 101, 1, 0, + 0, 0, 916, 917, 5, 60, 0, 0, 917, 919, 5, 136, 0, 0, 918, 920, 3, 178, + 89, 0, 919, 918, 1, 0, 0, 0, 919, 920, 1, 0, 0, 0, 920, 921, 1, 0, 0, 0, + 921, 922, 5, 137, 0, 0, 922, 103, 1, 0, 0, 0, 923, 924, 5, 93, 0, 0, 924, + 925, 5, 136, 0, 0, 925, 926, 3, 180, 90, 0, 926, 927, 5, 137, 0, 0, 927, + 105, 1, 0, 0, 0, 928, 929, 5, 94, 0, 0, 929, 930, 5, 136, 0, 0, 930, 931, + 5, 150, 0, 0, 931, 932, 5, 137, 0, 0, 932, 107, 1, 0, 0, 0, 933, 934, 5, + 95, 0, 0, 934, 935, 5, 136, 0, 0, 935, 936, 5, 150, 0, 0, 936, 937, 5, + 137, 0, 0, 937, 109, 1, 0, 0, 0, 938, 939, 5, 98, 0, 0, 939, 940, 5, 136, + 0, 0, 940, 941, 5, 137, 0, 0, 941, 111, 1, 0, 0, 0, 942, 943, 7, 1, 0, + 0, 943, 944, 5, 136, 0, 0, 944, 945, 3, 180, 90, 0, 945, 946, 5, 137, 0, + 0, 946, 113, 1, 0, 0, 0, 947, 948, 5, 106, 0, 0, 948, 949, 5, 136, 0, 0, + 949, 950, 5, 150, 0, 0, 950, 951, 5, 137, 0, 0, 951, 115, 1, 0, 0, 0, 952, + 953, 5, 107, 0, 0, 953, 954, 5, 136, 0, 0, 954, 955, 5, 137, 0, 0, 955, + 117, 1, 0, 0, 0, 956, 957, 5, 108, 0, 0, 957, 958, 5, 136, 0, 0, 958, 959, + 3, 180, 90, 0, 959, 960, 5, 137, 0, 0, 960, 119, 1, 0, 0, 0, 961, 962, + 5, 109, 0, 0, 962, 963, 5, 136, 0, 0, 963, 964, 3, 224, 112, 0, 964, 965, + 5, 137, 0, 0, 965, 121, 1, 0, 0, 0, 966, 967, 5, 110, 0, 0, 967, 969, 5, + 136, 0, 0, 968, 970, 3, 224, 112, 0, 969, 968, 1, 0, 0, 0, 969, 970, 1, + 0, 0, 0, 970, 971, 1, 0, 0, 0, 971, 972, 5, 137, 0, 0, 972, 123, 1, 0, + 0, 0, 973, 974, 5, 111, 0, 0, 974, 975, 5, 136, 0, 0, 975, 976, 3, 178, + 89, 0, 976, 977, 5, 137, 0, 0, 977, 125, 1, 0, 0, 0, 978, 979, 5, 112, + 0, 0, 979, 980, 5, 136, 0, 0, 980, 981, 5, 137, 0, 0, 981, 127, 1, 0, 0, + 0, 982, 983, 5, 113, 0, 0, 983, 984, 5, 136, 0, 0, 984, 985, 3, 178, 89, + 0, 985, 986, 5, 137, 0, 0, 986, 129, 1, 0, 0, 0, 987, 988, 5, 114, 0, 0, + 988, 989, 5, 136, 0, 0, 989, 990, 5, 137, 0, 0, 990, 131, 1, 0, 0, 0, 991, + 992, 5, 115, 0, 0, 992, 993, 5, 136, 0, 0, 993, 994, 5, 137, 0, 0, 994, + 133, 1, 0, 0, 0, 995, 996, 5, 116, 0, 0, 996, 997, 5, 136, 0, 0, 997, 998, + 5, 137, 0, 0, 998, 135, 1, 0, 0, 0, 999, 1000, 5, 117, 0, 0, 1000, 1001, + 5, 136, 0, 0, 1001, 1002, 3, 178, 89, 0, 1002, 1003, 5, 137, 0, 0, 1003, + 137, 1, 0, 0, 0, 1004, 1005, 5, 118, 0, 0, 1005, 1006, 5, 136, 0, 0, 1006, + 1007, 3, 180, 90, 0, 1007, 1008, 5, 137, 0, 0, 1008, 139, 1, 0, 0, 0, 1009, + 1010, 5, 119, 0, 0, 1010, 1011, 5, 136, 0, 0, 1011, 1012, 5, 150, 0, 0, + 1012, 1013, 5, 137, 0, 0, 1013, 141, 1, 0, 0, 0, 1014, 1015, 5, 120, 0, + 0, 1015, 1016, 5, 136, 0, 0, 1016, 1017, 5, 150, 0, 0, 1017, 1018, 5, 137, + 0, 0, 1018, 143, 1, 0, 0, 0, 1019, 1020, 5, 121, 0, 0, 1020, 1021, 5, 136, + 0, 0, 1021, 1022, 3, 180, 90, 0, 1022, 1023, 5, 137, 0, 0, 1023, 145, 1, + 0, 0, 0, 1024, 1025, 5, 122, 0, 0, 1025, 1026, 5, 136, 0, 0, 1026, 1027, + 5, 137, 0, 0, 1027, 147, 1, 0, 0, 0, 1028, 1029, 5, 123, 0, 0, 1029, 1030, + 5, 136, 0, 0, 1030, 1031, 5, 137, 0, 0, 1031, 149, 1, 0, 0, 0, 1032, 1033, + 5, 124, 0, 0, 1033, 1034, 5, 136, 0, 0, 1034, 1035, 5, 137, 0, 0, 1035, + 151, 1, 0, 0, 0, 1036, 1037, 5, 125, 0, 0, 1037, 1038, 5, 136, 0, 0, 1038, + 1039, 5, 137, 0, 0, 1039, 153, 1, 0, 0, 0, 1040, 1041, 5, 126, 0, 0, 1041, + 1042, 5, 136, 0, 0, 1042, 1043, 3, 180, 90, 0, 1043, 1044, 5, 137, 0, 0, + 1044, 155, 1, 0, 0, 0, 1045, 1046, 5, 127, 0, 0, 1046, 1047, 5, 136, 0, + 0, 1047, 1048, 3, 176, 88, 0, 1048, 1049, 5, 137, 0, 0, 1049, 157, 1, 0, + 0, 0, 1050, 1051, 5, 128, 0, 0, 1051, 1052, 5, 136, 0, 0, 1052, 1053, 7, + 2, 0, 0, 1053, 1054, 5, 137, 0, 0, 1054, 159, 1, 0, 0, 0, 1055, 1056, 5, + 129, 0, 0, 1056, 1057, 5, 136, 0, 0, 1057, 1058, 7, 2, 0, 0, 1058, 1059, + 5, 137, 0, 0, 1059, 161, 1, 0, 0, 0, 1060, 1061, 5, 130, 0, 0, 1061, 1062, + 5, 136, 0, 0, 1062, 1063, 5, 137, 0, 0, 1063, 163, 1, 0, 0, 0, 1064, 1065, + 5, 131, 0, 0, 1065, 1067, 5, 136, 0, 0, 1066, 1068, 7, 2, 0, 0, 1067, 1066, + 1, 0, 0, 0, 1067, 1068, 1, 0, 0, 0, 1068, 1069, 1, 0, 0, 0, 1069, 1070, + 5, 137, 0, 0, 1070, 165, 1, 0, 0, 0, 1071, 1072, 5, 132, 0, 0, 1072, 1073, + 5, 136, 0, 0, 1073, 1074, 5, 137, 0, 0, 1074, 167, 1, 0, 0, 0, 1075, 1076, + 5, 133, 0, 0, 1076, 1077, 5, 136, 0, 0, 1077, 1078, 5, 137, 0, 0, 1078, + 169, 1, 0, 0, 0, 1079, 1080, 5, 134, 0, 0, 1080, 1082, 5, 136, 0, 0, 1081, + 1083, 7, 2, 0, 0, 1082, 1081, 1, 0, 0, 0, 1082, 1083, 1, 0, 0, 0, 1083, + 1084, 1, 0, 0, 0, 1084, 1085, 5, 137, 0, 0, 1085, 171, 1, 0, 0, 0, 1086, + 1087, 5, 135, 0, 0, 1087, 1088, 5, 136, 0, 0, 1088, 1089, 5, 150, 0, 0, + 1089, 1090, 5, 137, 0, 0, 1090, 173, 1, 0, 0, 0, 1091, 1092, 3, 226, 113, + 0, 1092, 1094, 5, 136, 0, 0, 1093, 1095, 3, 176, 88, 0, 1094, 1093, 1, + 0, 0, 0, 1094, 1095, 1, 0, 0, 0, 1095, 1096, 1, 0, 0, 0, 1096, 1097, 5, + 137, 0, 0, 1097, 175, 1, 0, 0, 0, 1098, 1103, 3, 178, 89, 0, 1099, 1100, + 5, 143, 0, 0, 1100, 1102, 3, 178, 89, 0, 1101, 1099, 1, 0, 0, 0, 1102, + 1105, 1, 0, 0, 0, 1103, 1101, 1, 0, 0, 0, 1103, 1104, 1, 0, 0, 0, 1104, + 1107, 1, 0, 0, 0, 1105, 1103, 1, 0, 0, 0, 1106, 1108, 5, 143, 0, 0, 1107, + 1106, 1, 0, 0, 0, 1107, 1108, 1, 0, 0, 0, 1108, 177, 1, 0, 0, 0, 1109, + 1110, 3, 186, 93, 0, 1110, 179, 1, 0, 0, 0, 1111, 1123, 5, 138, 0, 0, 1112, + 1117, 3, 182, 91, 0, 1113, 1114, 5, 143, 0, 0, 1114, 1116, 3, 182, 91, + 0, 1115, 1113, 1, 0, 0, 0, 1116, 1119, 1, 0, 0, 0, 1117, 1115, 1, 0, 0, + 0, 1117, 1118, 1, 0, 0, 0, 1118, 1121, 1, 0, 0, 0, 1119, 1117, 1, 0, 0, + 0, 1120, 1122, 5, 143, 0, 0, 1121, 1120, 1, 0, 0, 0, 1121, 1122, 1, 0, + 0, 0, 1122, 1124, 1, 0, 0, 0, 1123, 1112, 1, 0, 0, 0, 1123, 1124, 1, 0, + 0, 0, 1124, 1125, 1, 0, 0, 0, 1125, 1126, 5, 139, 0, 0, 1126, 181, 1, 0, + 0, 0, 1127, 1128, 3, 184, 92, 0, 1128, 1129, 5, 142, 0, 0, 1129, 1130, + 3, 186, 93, 0, 1130, 183, 1, 0, 0, 0, 1131, 1134, 3, 226, 113, 0, 1132, + 1134, 3, 224, 112, 0, 1133, 1131, 1, 0, 0, 0, 1133, 1132, 1, 0, 0, 0, 1134, + 185, 1, 0, 0, 0, 1135, 1143, 3, 180, 90, 0, 1136, 1143, 3, 190, 95, 0, + 1137, 1143, 3, 192, 96, 0, 1138, 1143, 5, 149, 0, 0, 1139, 1143, 3, 212, + 106, 0, 1140, 1143, 3, 222, 111, 0, 1141, 1143, 3, 188, 94, 0, 1142, 1135, + 1, 0, 0, 0, 1142, 1136, 1, 0, 0, 0, 1142, 1137, 1, 0, 0, 0, 1142, 1138, + 1, 0, 0, 0, 1142, 1139, 1, 0, 0, 0, 1142, 1140, 1, 0, 0, 0, 1142, 1141, + 1, 0, 0, 0, 1143, 187, 1, 0, 0, 0, 1144, 1145, 5, 6, 0, 0, 1145, 1146, + 7, 3, 0, 0, 1146, 1147, 6, 94, -1, 0, 1147, 1149, 5, 136, 0, 0, 1148, 1150, + 3, 176, 88, 0, 1149, 1148, 1, 0, 0, 0, 1149, 1150, 1, 0, 0, 0, 1150, 1151, + 1, 0, 0, 0, 1151, 1152, 5, 137, 0, 0, 1152, 189, 1, 0, 0, 0, 1153, 1165, + 5, 140, 0, 0, 1154, 1159, 3, 186, 93, 0, 1155, 1156, 5, 143, 0, 0, 1156, + 1158, 3, 186, 93, 0, 1157, 1155, 1, 0, 0, 0, 1158, 1161, 1, 0, 0, 0, 1159, + 1157, 1, 0, 0, 0, 1159, 1160, 1, 0, 0, 0, 1160, 1163, 1, 0, 0, 0, 1161, + 1159, 1, 0, 0, 0, 1162, 1164, 5, 143, 0, 0, 1163, 1162, 1, 0, 0, 0, 1163, + 1164, 1, 0, 0, 0, 1164, 1166, 1, 0, 0, 0, 1165, 1154, 1, 0, 0, 0, 1165, + 1166, 1, 0, 0, 0, 1166, 1167, 1, 0, 0, 0, 1167, 1168, 5, 141, 0, 0, 1168, + 191, 1, 0, 0, 0, 1169, 1183, 3, 194, 97, 0, 1170, 1183, 3, 196, 98, 0, + 1171, 1183, 3, 198, 99, 0, 1172, 1183, 3, 200, 100, 0, 1173, 1183, 3, 202, + 101, 0, 1174, 1183, 3, 204, 102, 0, 1175, 1183, 3, 206, 103, 0, 1176, 1183, + 3, 208, 104, 0, 1177, 1183, 3, 210, 105, 0, 1178, 1183, 3, 214, 107, 0, + 1179, 1183, 3, 216, 108, 0, 1180, 1183, 3, 218, 109, 0, 1181, 1183, 3, + 220, 110, 0, 1182, 1169, 1, 0, 0, 0, 1182, 1170, 1, 0, 0, 0, 1182, 1171, + 1, 0, 0, 0, 1182, 1172, 1, 0, 0, 0, 1182, 1173, 1, 0, 0, 0, 1182, 1174, + 1, 0, 0, 0, 1182, 1175, 1, 0, 0, 0, 1182, 1176, 1, 0, 0, 0, 1182, 1177, + 1, 0, 0, 0, 1182, 1178, 1, 0, 0, 0, 1182, 1179, 1, 0, 0, 0, 1182, 1180, + 1, 0, 0, 0, 1182, 1181, 1, 0, 0, 0, 1183, 193, 1, 0, 0, 0, 1184, 1185, + 5, 13, 0, 0, 1185, 1187, 5, 136, 0, 0, 1186, 1188, 3, 224, 112, 0, 1187, + 1186, 1, 0, 0, 0, 1187, 1188, 1, 0, 0, 0, 1188, 1189, 1, 0, 0, 0, 1189, + 1190, 5, 137, 0, 0, 1190, 195, 1, 0, 0, 0, 1191, 1192, 5, 14, 0, 0, 1192, + 1194, 5, 136, 0, 0, 1193, 1195, 3, 224, 112, 0, 1194, 1193, 1, 0, 0, 0, + 1194, 1195, 1, 0, 0, 0, 1195, 1196, 1, 0, 0, 0, 1196, 1197, 5, 137, 0, + 0, 1197, 197, 1, 0, 0, 0, 1198, 1199, 5, 15, 0, 0, 1199, 1202, 5, 136, + 0, 0, 1200, 1203, 3, 224, 112, 0, 1201, 1203, 5, 150, 0, 0, 1202, 1200, + 1, 0, 0, 0, 1202, 1201, 1, 0, 0, 0, 1202, 1203, 1, 0, 0, 0, 1203, 1204, + 1, 0, 0, 0, 1204, 1205, 5, 137, 0, 0, 1205, 199, 1, 0, 0, 0, 1206, 1207, + 5, 16, 0, 0, 1207, 1208, 5, 136, 0, 0, 1208, 1209, 3, 224, 112, 0, 1209, + 1210, 5, 137, 0, 0, 1210, 201, 1, 0, 0, 0, 1211, 1212, 7, 4, 0, 0, 1212, + 1215, 5, 136, 0, 0, 1213, 1216, 5, 150, 0, 0, 1214, 1216, 3, 224, 112, + 0, 1215, 1213, 1, 0, 0, 0, 1215, 1214, 1, 0, 0, 0, 1216, 1217, 1, 0, 0, + 0, 1217, 1218, 5, 137, 0, 0, 1218, 203, 1, 0, 0, 0, 1219, 1220, 7, 5, 0, + 0, 1220, 1221, 5, 136, 0, 0, 1221, 1222, 5, 150, 0, 0, 1222, 1223, 5, 137, + 0, 0, 1223, 205, 1, 0, 0, 0, 1224, 1225, 5, 21, 0, 0, 1225, 1226, 5, 136, + 0, 0, 1226, 1227, 5, 150, 0, 0, 1227, 1228, 5, 137, 0, 0, 1228, 207, 1, + 0, 0, 0, 1229, 1230, 7, 6, 0, 0, 1230, 1231, 5, 136, 0, 0, 1231, 1232, + 3, 224, 112, 0, 1232, 1233, 5, 137, 0, 0, 1233, 209, 1, 0, 0, 0, 1234, + 1235, 5, 24, 0, 0, 1235, 1236, 5, 136, 0, 0, 1236, 1237, 3, 180, 90, 0, + 1237, 1238, 5, 137, 0, 0, 1238, 1246, 1, 0, 0, 0, 1239, 1240, 5, 24, 0, + 0, 1240, 1241, 5, 136, 0, 0, 1241, 1242, 5, 150, 0, 0, 1242, 1243, 5, 143, + 0, 0, 1243, 1244, 5, 150, 0, 0, 1244, 1246, 5, 137, 0, 0, 1245, 1234, 1, + 0, 0, 0, 1245, 1239, 1, 0, 0, 0, 1246, 211, 1, 0, 0, 0, 1247, 1248, 5, + 25, 0, 0, 1248, 1249, 5, 136, 0, 0, 1249, 1252, 3, 224, 112, 0, 1250, 1251, + 5, 143, 0, 0, 1251, 1253, 3, 224, 112, 0, 1252, 1250, 1, 0, 0, 0, 1252, + 1253, 1, 0, 0, 0, 1253, 1254, 1, 0, 0, 0, 1254, 1255, 5, 137, 0, 0, 1255, + 213, 1, 0, 0, 0, 1256, 1257, 5, 26, 0, 0, 1257, 1258, 5, 136, 0, 0, 1258, + 1259, 5, 150, 0, 0, 1259, 1260, 5, 143, 0, 0, 1260, 1261, 3, 224, 112, + 0, 1261, 1262, 5, 137, 0, 0, 1262, 215, 1, 0, 0, 0, 1263, 1264, 5, 27, + 0, 0, 1264, 1265, 5, 136, 0, 0, 1265, 1266, 3, 176, 88, 0, 1266, 1267, + 5, 137, 0, 0, 1267, 1276, 1, 0, 0, 0, 1268, 1269, 5, 27, 0, 0, 1269, 1270, + 5, 144, 0, 0, 1270, 1271, 3, 226, 113, 0, 1271, 1272, 5, 136, 0, 0, 1272, + 1273, 3, 176, 88, 0, 1273, 1274, 5, 137, 0, 0, 1274, 1276, 1, 0, 0, 0, + 1275, 1263, 1, 0, 0, 0, 1275, 1268, 1, 0, 0, 0, 1276, 217, 1, 0, 0, 0, + 1277, 1278, 5, 28, 0, 0, 1278, 1279, 5, 136, 0, 0, 1279, 1280, 3, 176, + 88, 0, 1280, 1281, 5, 137, 0, 0, 1281, 219, 1, 0, 0, 0, 1282, 1283, 5, + 29, 0, 0, 1283, 1284, 5, 136, 0, 0, 1284, 1285, 5, 150, 0, 0, 1285, 1286, + 5, 143, 0, 0, 1286, 1287, 3, 224, 112, 0, 1287, 1288, 5, 137, 0, 0, 1288, + 221, 1, 0, 0, 0, 1289, 1295, 3, 224, 112, 0, 1290, 1295, 5, 150, 0, 0, + 1291, 1295, 5, 7, 0, 0, 1292, 1295, 5, 8, 0, 0, 1293, 1295, 5, 9, 0, 0, + 1294, 1289, 1, 0, 0, 0, 1294, 1290, 1, 0, 0, 0, 1294, 1291, 1, 0, 0, 0, + 1294, 1292, 1, 0, 0, 0, 1294, 1293, 1, 0, 0, 0, 1295, 223, 1, 0, 0, 0, + 1296, 1297, 7, 7, 0, 0, 1297, 225, 1, 0, 0, 0, 1298, 1437, 5, 153, 0, 0, + 1299, 1300, 5, 146, 0, 0, 1300, 1437, 5, 153, 0, 0, 1301, 1437, 5, 1, 0, + 0, 1302, 1437, 5, 2, 0, 0, 1303, 1437, 5, 3, 0, 0, 1304, 1437, 5, 4, 0, + 0, 1305, 1437, 5, 5, 0, 0, 1306, 1437, 5, 6, 0, 0, 1307, 1437, 5, 7, 0, + 0, 1308, 1437, 5, 8, 0, 0, 1309, 1437, 5, 9, 0, 0, 1310, 1437, 5, 30, 0, + 0, 1311, 1437, 5, 31, 0, 0, 1312, 1437, 5, 32, 0, 0, 1313, 1437, 5, 33, + 0, 0, 1314, 1437, 5, 34, 0, 0, 1315, 1437, 5, 35, 0, 0, 1316, 1437, 5, + 36, 0, 0, 1317, 1437, 5, 37, 0, 0, 1318, 1437, 5, 38, 0, 0, 1319, 1437, + 5, 39, 0, 0, 1320, 1437, 5, 40, 0, 0, 1321, 1437, 5, 41, 0, 0, 1322, 1437, + 5, 42, 0, 0, 1323, 1437, 5, 43, 0, 0, 1324, 1437, 5, 44, 0, 0, 1325, 1437, + 5, 45, 0, 0, 1326, 1437, 5, 46, 0, 0, 1327, 1437, 5, 47, 0, 0, 1328, 1437, + 5, 48, 0, 0, 1329, 1437, 5, 49, 0, 0, 1330, 1437, 5, 50, 0, 0, 1331, 1437, + 5, 51, 0, 0, 1332, 1437, 5, 52, 0, 0, 1333, 1437, 5, 53, 0, 0, 1334, 1437, + 5, 54, 0, 0, 1335, 1437, 5, 55, 0, 0, 1336, 1437, 5, 56, 0, 0, 1337, 1437, + 5, 57, 0, 0, 1338, 1437, 5, 58, 0, 0, 1339, 1437, 5, 59, 0, 0, 1340, 1437, + 5, 60, 0, 0, 1341, 1437, 5, 93, 0, 0, 1342, 1437, 5, 94, 0, 0, 1343, 1437, + 5, 95, 0, 0, 1344, 1437, 5, 98, 0, 0, 1345, 1437, 5, 96, 0, 0, 1346, 1437, + 5, 97, 0, 0, 1347, 1437, 5, 10, 0, 0, 1348, 1437, 5, 11, 0, 0, 1349, 1437, + 5, 12, 0, 0, 1350, 1437, 5, 61, 0, 0, 1351, 1437, 5, 62, 0, 0, 1352, 1437, + 5, 63, 0, 0, 1353, 1437, 5, 64, 0, 0, 1354, 1437, 5, 65, 0, 0, 1355, 1437, + 5, 66, 0, 0, 1356, 1437, 5, 67, 0, 0, 1357, 1437, 5, 68, 0, 0, 1358, 1437, + 5, 69, 0, 0, 1359, 1437, 5, 70, 0, 0, 1360, 1437, 5, 71, 0, 0, 1361, 1437, + 5, 72, 0, 0, 1362, 1437, 5, 13, 0, 0, 1363, 1437, 5, 14, 0, 0, 1364, 1437, + 5, 15, 0, 0, 1365, 1437, 5, 16, 0, 0, 1366, 1437, 5, 17, 0, 0, 1367, 1437, + 5, 18, 0, 0, 1368, 1437, 5, 19, 0, 0, 1369, 1437, 5, 20, 0, 0, 1370, 1437, + 5, 21, 0, 0, 1371, 1437, 5, 22, 0, 0, 1372, 1437, 5, 23, 0, 0, 1373, 1437, + 5, 24, 0, 0, 1374, 1437, 5, 25, 0, 0, 1375, 1437, 5, 26, 0, 0, 1376, 1437, + 5, 27, 0, 0, 1377, 1437, 5, 28, 0, 0, 1378, 1437, 5, 29, 0, 0, 1379, 1437, + 5, 106, 0, 0, 1380, 1437, 5, 107, 0, 0, 1381, 1437, 5, 108, 0, 0, 1382, + 1437, 5, 109, 0, 0, 1383, 1437, 5, 110, 0, 0, 1384, 1437, 5, 111, 0, 0, + 1385, 1437, 5, 112, 0, 0, 1386, 1437, 5, 113, 0, 0, 1387, 1437, 5, 114, + 0, 0, 1388, 1437, 5, 115, 0, 0, 1389, 1437, 5, 116, 0, 0, 1390, 1437, 5, + 117, 0, 0, 1391, 1437, 5, 118, 0, 0, 1392, 1437, 5, 119, 0, 0, 1393, 1437, + 5, 120, 0, 0, 1394, 1437, 5, 121, 0, 0, 1395, 1437, 5, 122, 0, 0, 1396, + 1437, 5, 123, 0, 0, 1397, 1437, 5, 124, 0, 0, 1398, 1437, 5, 125, 0, 0, + 1399, 1437, 5, 126, 0, 0, 1400, 1437, 5, 127, 0, 0, 1401, 1437, 5, 128, + 0, 0, 1402, 1437, 5, 129, 0, 0, 1403, 1437, 5, 130, 0, 0, 1404, 1437, 5, + 131, 0, 0, 1405, 1437, 5, 132, 0, 0, 1406, 1437, 5, 133, 0, 0, 1407, 1437, + 5, 134, 0, 0, 1408, 1437, 5, 135, 0, 0, 1409, 1437, 5, 99, 0, 0, 1410, + 1437, 5, 100, 0, 0, 1411, 1437, 5, 101, 0, 0, 1412, 1437, 5, 102, 0, 0, + 1413, 1437, 5, 103, 0, 0, 1414, 1437, 5, 104, 0, 0, 1415, 1437, 5, 105, + 0, 0, 1416, 1437, 5, 73, 0, 0, 1417, 1437, 5, 74, 0, 0, 1418, 1437, 5, + 78, 0, 0, 1419, 1437, 5, 79, 0, 0, 1420, 1437, 5, 80, 0, 0, 1421, 1437, + 5, 81, 0, 0, 1422, 1437, 5, 82, 0, 0, 1423, 1437, 5, 83, 0, 0, 1424, 1437, + 5, 84, 0, 0, 1425, 1437, 5, 85, 0, 0, 1426, 1437, 5, 86, 0, 0, 1427, 1437, + 5, 87, 0, 0, 1428, 1437, 5, 88, 0, 0, 1429, 1437, 5, 89, 0, 0, 1430, 1437, + 5, 75, 0, 0, 1431, 1437, 5, 76, 0, 0, 1432, 1437, 5, 77, 0, 0, 1433, 1437, + 5, 90, 0, 0, 1434, 1437, 5, 91, 0, 0, 1435, 1437, 5, 92, 0, 0, 1436, 1298, + 1, 0, 0, 0, 1436, 1299, 1, 0, 0, 0, 1436, 1301, 1, 0, 0, 0, 1436, 1302, + 1, 0, 0, 0, 1436, 1303, 1, 0, 0, 0, 1436, 1304, 1, 0, 0, 0, 1436, 1305, + 1, 0, 0, 0, 1436, 1306, 1, 0, 0, 0, 1436, 1307, 1, 0, 0, 0, 1436, 1308, + 1, 0, 0, 0, 1436, 1309, 1, 0, 0, 0, 1436, 1310, 1, 0, 0, 0, 1436, 1311, + 1, 0, 0, 0, 1436, 1312, 1, 0, 0, 0, 1436, 1313, 1, 0, 0, 0, 1436, 1314, + 1, 0, 0, 0, 1436, 1315, 1, 0, 0, 0, 1436, 1316, 1, 0, 0, 0, 1436, 1317, + 1, 0, 0, 0, 1436, 1318, 1, 0, 0, 0, 1436, 1319, 1, 0, 0, 0, 1436, 1320, + 1, 0, 0, 0, 1436, 1321, 1, 0, 0, 0, 1436, 1322, 1, 0, 0, 0, 1436, 1323, + 1, 0, 0, 0, 1436, 1324, 1, 0, 0, 0, 1436, 1325, 1, 0, 0, 0, 1436, 1326, + 1, 0, 0, 0, 1436, 1327, 1, 0, 0, 0, 1436, 1328, 1, 0, 0, 0, 1436, 1329, + 1, 0, 0, 0, 1436, 1330, 1, 0, 0, 0, 1436, 1331, 1, 0, 0, 0, 1436, 1332, + 1, 0, 0, 0, 1436, 1333, 1, 0, 0, 0, 1436, 1334, 1, 0, 0, 0, 1436, 1335, + 1, 0, 0, 0, 1436, 1336, 1, 0, 0, 0, 1436, 1337, 1, 0, 0, 0, 1436, 1338, + 1, 0, 0, 0, 1436, 1339, 1, 0, 0, 0, 1436, 1340, 1, 0, 0, 0, 1436, 1341, + 1, 0, 0, 0, 1436, 1342, 1, 0, 0, 0, 1436, 1343, 1, 0, 0, 0, 1436, 1344, + 1, 0, 0, 0, 1436, 1345, 1, 0, 0, 0, 1436, 1346, 1, 0, 0, 0, 1436, 1347, + 1, 0, 0, 0, 1436, 1348, 1, 0, 0, 0, 1436, 1349, 1, 0, 0, 0, 1436, 1350, + 1, 0, 0, 0, 1436, 1351, 1, 0, 0, 0, 1436, 1352, 1, 0, 0, 0, 1436, 1353, + 1, 0, 0, 0, 1436, 1354, 1, 0, 0, 0, 1436, 1355, 1, 0, 0, 0, 1436, 1356, + 1, 0, 0, 0, 1436, 1357, 1, 0, 0, 0, 1436, 1358, 1, 0, 0, 0, 1436, 1359, + 1, 0, 0, 0, 1436, 1360, 1, 0, 0, 0, 1436, 1361, 1, 0, 0, 0, 1436, 1362, + 1, 0, 0, 0, 1436, 1363, 1, 0, 0, 0, 1436, 1364, 1, 0, 0, 0, 1436, 1365, + 1, 0, 0, 0, 1436, 1366, 1, 0, 0, 0, 1436, 1367, 1, 0, 0, 0, 1436, 1368, + 1, 0, 0, 0, 1436, 1369, 1, 0, 0, 0, 1436, 1370, 1, 0, 0, 0, 1436, 1371, + 1, 0, 0, 0, 1436, 1372, 1, 0, 0, 0, 1436, 1373, 1, 0, 0, 0, 1436, 1374, + 1, 0, 0, 0, 1436, 1375, 1, 0, 0, 0, 1436, 1376, 1, 0, 0, 0, 1436, 1377, + 1, 0, 0, 0, 1436, 1378, 1, 0, 0, 0, 1436, 1379, 1, 0, 0, 0, 1436, 1380, + 1, 0, 0, 0, 1436, 1381, 1, 0, 0, 0, 1436, 1382, 1, 0, 0, 0, 1436, 1383, + 1, 0, 0, 0, 1436, 1384, 1, 0, 0, 0, 1436, 1385, 1, 0, 0, 0, 1436, 1386, + 1, 0, 0, 0, 1436, 1387, 1, 0, 0, 0, 1436, 1388, 1, 0, 0, 0, 1436, 1389, + 1, 0, 0, 0, 1436, 1390, 1, 0, 0, 0, 1436, 1391, 1, 0, 0, 0, 1436, 1392, + 1, 0, 0, 0, 1436, 1393, 1, 0, 0, 0, 1436, 1394, 1, 0, 0, 0, 1436, 1395, + 1, 0, 0, 0, 1436, 1396, 1, 0, 0, 0, 1436, 1397, 1, 0, 0, 0, 1436, 1398, + 1, 0, 0, 0, 1436, 1399, 1, 0, 0, 0, 1436, 1400, 1, 0, 0, 0, 1436, 1401, + 1, 0, 0, 0, 1436, 1402, 1, 0, 0, 0, 1436, 1403, 1, 0, 0, 0, 1436, 1404, + 1, 0, 0, 0, 1436, 1405, 1, 0, 0, 0, 1436, 1406, 1, 0, 0, 0, 1436, 1407, + 1, 0, 0, 0, 1436, 1408, 1, 0, 0, 0, 1436, 1409, 1, 0, 0, 0, 1436, 1410, + 1, 0, 0, 0, 1436, 1411, 1, 0, 0, 0, 1436, 1412, 1, 0, 0, 0, 1436, 1413, + 1, 0, 0, 0, 1436, 1414, 1, 0, 0, 0, 1436, 1415, 1, 0, 0, 0, 1436, 1416, + 1, 0, 0, 0, 1436, 1417, 1, 0, 0, 0, 1436, 1418, 1, 0, 0, 0, 1436, 1419, + 1, 0, 0, 0, 1436, 1420, 1, 0, 0, 0, 1436, 1421, 1, 0, 0, 0, 1436, 1422, + 1, 0, 0, 0, 1436, 1423, 1, 0, 0, 0, 1436, 1424, 1, 0, 0, 0, 1436, 1425, + 1, 0, 0, 0, 1436, 1426, 1, 0, 0, 0, 1436, 1427, 1, 0, 0, 0, 1436, 1428, + 1, 0, 0, 0, 1436, 1429, 1, 0, 0, 0, 1436, 1430, 1, 0, 0, 0, 1436, 1431, + 1, 0, 0, 0, 1436, 1432, 1, 0, 0, 0, 1436, 1433, 1, 0, 0, 0, 1436, 1434, + 1, 0, 0, 0, 1436, 1435, 1, 0, 0, 0, 1437, 227, 1, 0, 0, 0, 86, 231, 238, + 242, 246, 250, 254, 258, 262, 266, 270, 274, 276, 282, 290, 297, 301, 320, + 328, 389, 394, 403, 411, 417, 435, 447, 451, 456, 460, 465, 469, 477, 483, + 490, 499, 516, 522, 538, 544, 547, 559, 565, 573, 584, 588, 593, 635, 641, + 658, 662, 676, 684, 754, 759, 766, 773, 780, 866, 873, 885, 912, 919, 969, + 1067, 1082, 1094, 1103, 1107, 1117, 1121, 1123, 1133, 1142, 1149, 1159, + 1163, 1165, 1182, 1187, 1194, 1202, 1215, 1245, 1252, 1275, 1294, 1436, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -313,64 +868,161 @@ func NewMongoShellParser(input antlr.TokenStream) *MongoShellParser { // MongoShellParser tokens. const ( - MongoShellParserEOF = antlr.TokenEOF - MongoShellParserSHOW = 1 - MongoShellParserDBS = 2 - MongoShellParserDATABASES = 3 - MongoShellParserCOLLECTIONS = 4 - MongoShellParserDB = 5 - MongoShellParserNEW = 6 - MongoShellParserTRUE = 7 - MongoShellParserFALSE = 8 - MongoShellParserNULL = 9 - MongoShellParserGET_COLLECTION = 10 - MongoShellParserGET_COLLECTION_NAMES = 11 - MongoShellParserGET_COLLECTION_INFOS = 12 - MongoShellParserOBJECT_ID = 13 - MongoShellParserISO_DATE = 14 - MongoShellParserDATE = 15 - MongoShellParserUUID = 16 - MongoShellParserLONG = 17 - MongoShellParserNUMBER_LONG = 18 - MongoShellParserINT32 = 19 - MongoShellParserNUMBER_INT = 20 - MongoShellParserDOUBLE = 21 - MongoShellParserDECIMAL128 = 22 - MongoShellParserNUMBER_DECIMAL = 23 - MongoShellParserTIMESTAMP = 24 - MongoShellParserREG_EXP = 25 - MongoShellParserFIND = 26 - MongoShellParserFIND_ONE = 27 - MongoShellParserCOUNT_DOCUMENTS = 28 - MongoShellParserESTIMATED_DOCUMENT_COUNT = 29 - MongoShellParserDISTINCT = 30 - MongoShellParserAGGREGATE = 31 - MongoShellParserGET_INDEXES = 32 - MongoShellParserSORT = 33 - MongoShellParserLIMIT = 34 - MongoShellParserSKIP_ = 35 - MongoShellParserPROJECTION = 36 - MongoShellParserPROJECT = 37 - MongoShellParserCOUNT = 38 - MongoShellParserLPAREN = 39 - MongoShellParserRPAREN = 40 - MongoShellParserLBRACE = 41 - MongoShellParserRBRACE = 42 - MongoShellParserLBRACKET = 43 - MongoShellParserRBRACKET = 44 - MongoShellParserCOLON = 45 - MongoShellParserCOMMA = 46 - MongoShellParserDOT = 47 - MongoShellParserSEMI = 48 - MongoShellParserDOLLAR = 49 - MongoShellParserLINE_COMMENT = 50 - MongoShellParserBLOCK_COMMENT = 51 - MongoShellParserREGEX_LITERAL = 52 - MongoShellParserNUMBER = 53 - MongoShellParserDOUBLE_QUOTED_STRING = 54 - MongoShellParserSINGLE_QUOTED_STRING = 55 - MongoShellParserIDENTIFIER = 56 - MongoShellParserWS = 57 + MongoShellParserEOF = antlr.TokenEOF + MongoShellParserSHOW = 1 + MongoShellParserDBS = 2 + MongoShellParserDATABASES = 3 + MongoShellParserCOLLECTIONS = 4 + MongoShellParserDB = 5 + MongoShellParserNEW = 6 + MongoShellParserTRUE = 7 + MongoShellParserFALSE = 8 + MongoShellParserNULL = 9 + MongoShellParserGET_COLLECTION = 10 + MongoShellParserGET_COLLECTION_NAMES = 11 + MongoShellParserGET_COLLECTION_INFOS = 12 + MongoShellParserOBJECT_ID = 13 + MongoShellParserISO_DATE = 14 + MongoShellParserDATE = 15 + MongoShellParserUUID = 16 + MongoShellParserLONG = 17 + MongoShellParserNUMBER_LONG = 18 + MongoShellParserINT32 = 19 + MongoShellParserNUMBER_INT = 20 + MongoShellParserDOUBLE = 21 + MongoShellParserDECIMAL128 = 22 + MongoShellParserNUMBER_DECIMAL = 23 + MongoShellParserTIMESTAMP = 24 + MongoShellParserREG_EXP = 25 + MongoShellParserBIN_DATA = 26 + MongoShellParserBINARY = 27 + MongoShellParserBSON_REG_EXP = 28 + MongoShellParserHEX_DATA = 29 + MongoShellParserFIND = 30 + MongoShellParserFIND_ONE = 31 + MongoShellParserCOUNT_DOCUMENTS = 32 + MongoShellParserESTIMATED_DOCUMENT_COUNT = 33 + MongoShellParserDISTINCT = 34 + MongoShellParserAGGREGATE = 35 + MongoShellParserGET_INDEXES = 36 + MongoShellParserINSERT_ONE = 37 + MongoShellParserINSERT_MANY = 38 + MongoShellParserUPDATE_ONE = 39 + MongoShellParserUPDATE_MANY = 40 + MongoShellParserDELETE_ONE = 41 + MongoShellParserDELETE_MANY = 42 + MongoShellParserREPLACE_ONE = 43 + MongoShellParserFIND_ONE_AND_UPDATE = 44 + MongoShellParserFIND_ONE_AND_REPLACE = 45 + MongoShellParserFIND_ONE_AND_DELETE = 46 + MongoShellParserCREATE_INDEX = 47 + MongoShellParserCREATE_INDEXES = 48 + MongoShellParserDROP_INDEX = 49 + MongoShellParserDROP_INDEXES = 50 + MongoShellParserDROP = 51 + MongoShellParserRENAME_COLLECTION = 52 + MongoShellParserSTATS = 53 + MongoShellParserSTORAGE_SIZE = 54 + MongoShellParserTOTAL_INDEX_SIZE = 55 + MongoShellParserTOTAL_SIZE = 56 + MongoShellParserDATA_SIZE = 57 + MongoShellParserIS_CAPPED = 58 + MongoShellParserVALIDATE = 59 + MongoShellParserLATENCY_STATS = 60 + MongoShellParserCREATE_COLLECTION = 61 + MongoShellParserDROP_DATABASE = 62 + MongoShellParserHOST_INFO = 63 + MongoShellParserLIST_COMMANDS = 64 + MongoShellParserSERVER_BUILD_INFO = 65 + MongoShellParserSERVER_STATUS = 66 + MongoShellParserVERSION = 67 + MongoShellParserRUN_COMMAND = 68 + MongoShellParserADMIN_COMMAND = 69 + MongoShellParserGET_NAME = 70 + MongoShellParserGET_MONGO = 71 + MongoShellParserGET_SIBLING_DB = 72 + MongoShellParserMONGO = 73 + MongoShellParserCONNECT = 74 + MongoShellParserRS = 75 + MongoShellParserSH = 76 + MongoShellParserSP = 77 + MongoShellParserGET_DB = 78 + MongoShellParserGET_READ_CONCERN = 79 + MongoShellParserGET_READ_PREF = 80 + MongoShellParserGET_READ_PREF_MODE = 81 + MongoShellParserGET_READ_PREF_TAG_SET = 82 + MongoShellParserGET_WRITE_CONCERN = 83 + MongoShellParserSET_READ_PREF = 84 + MongoShellParserSET_READ_CONCERN = 85 + MongoShellParserSET_WRITE_CONCERN = 86 + MongoShellParserSTART_SESSION = 87 + MongoShellParserWATCH = 88 + MongoShellParserGET_DB_NAMES = 89 + MongoShellParserGET_KEY_VAULT = 90 + MongoShellParserGET_CLIENT_ENCRYPTION = 91 + MongoShellParserGET_PLAN_CACHE = 92 + MongoShellParserSORT = 93 + MongoShellParserLIMIT = 94 + MongoShellParserSKIP_ = 95 + MongoShellParserPROJECTION = 96 + MongoShellParserPROJECT = 97 + MongoShellParserCOUNT = 98 + MongoShellParserINITIALIZE_ORDERED_BULK_OP = 99 + MongoShellParserINITIALIZE_UNORDERED_BULK_OP = 100 + MongoShellParserEXECUTE = 101 + MongoShellParserGET_OPERATIONS = 102 + MongoShellParserTO_STRING = 103 + MongoShellParserINSERT = 104 + MongoShellParserREMOVE = 105 + MongoShellParserBATCH_SIZE = 106 + MongoShellParserCLOSE = 107 + MongoShellParserCOLLATION = 108 + MongoShellParserCOMMENT = 109 + MongoShellParserEXPLAIN = 110 + MongoShellParserFOR_EACH = 111 + MongoShellParserHAS_NEXT = 112 + MongoShellParserHINT = 113 + MongoShellParserIS_CLOSED = 114 + MongoShellParserIS_EXHAUSTED = 115 + MongoShellParserIT_COUNT = 116 + MongoShellParserMAP = 117 + MongoShellParserMAX = 118 + MongoShellParserMAX_AWAIT_TIME_MS = 119 + MongoShellParserMAX_TIME_MS = 120 + MongoShellParserMIN = 121 + MongoShellParserNEXT = 122 + MongoShellParserNO_CURSOR_TIMEOUT = 123 + MongoShellParserOBJS_LEFT_IN_BATCH = 124 + MongoShellParserPRETTY = 125 + MongoShellParserREAD_CONCERN = 126 + MongoShellParserREAD_PREF = 127 + MongoShellParserRETURN_KEY = 128 + MongoShellParserSHOW_RECORD_ID = 129 + MongoShellParserSIZE = 130 + MongoShellParserTAILABLE = 131 + MongoShellParserTO_ARRAY = 132 + MongoShellParserTRY_NEXT = 133 + MongoShellParserALLOW_DISK_USE = 134 + MongoShellParserADD_OPTION = 135 + MongoShellParserLPAREN = 136 + MongoShellParserRPAREN = 137 + MongoShellParserLBRACE = 138 + MongoShellParserRBRACE = 139 + MongoShellParserLBRACKET = 140 + MongoShellParserRBRACKET = 141 + MongoShellParserCOLON = 142 + MongoShellParserCOMMA = 143 + MongoShellParserDOT = 144 + MongoShellParserSEMI = 145 + MongoShellParserDOLLAR = 146 + MongoShellParserLINE_COMMENT = 147 + MongoShellParserBLOCK_COMMENT = 148 + MongoShellParserREGEX_LITERAL = 149 + MongoShellParserNUMBER = 150 + MongoShellParserDOUBLE_QUOTED_STRING = 151 + MongoShellParserSINGLE_QUOTED_STRING = 152 + MongoShellParserIDENTIFIER = 153 + MongoShellParserWS = 154 ) // MongoShellParser rules. @@ -379,44 +1031,116 @@ const ( MongoShellParserRULE_statement = 1 MongoShellParserRULE_shellCommand = 2 MongoShellParserRULE_dbStatement = 3 - MongoShellParserRULE_collectionAccess = 4 - MongoShellParserRULE_methodChain = 5 - MongoShellParserRULE_methodCall = 6 - MongoShellParserRULE_findMethod = 7 - MongoShellParserRULE_findOneMethod = 8 - MongoShellParserRULE_countDocumentsMethod = 9 - MongoShellParserRULE_estimatedDocumentCountMethod = 10 - MongoShellParserRULE_distinctMethod = 11 - MongoShellParserRULE_aggregateMethod = 12 - MongoShellParserRULE_getIndexesMethod = 13 - MongoShellParserRULE_sortMethod = 14 - MongoShellParserRULE_limitMethod = 15 - MongoShellParserRULE_skipMethod = 16 - MongoShellParserRULE_countMethod = 17 - MongoShellParserRULE_projectionMethod = 18 - MongoShellParserRULE_genericMethod = 19 - MongoShellParserRULE_arguments = 20 - MongoShellParserRULE_argument = 21 - MongoShellParserRULE_document = 22 - MongoShellParserRULE_pair = 23 - MongoShellParserRULE_key = 24 - MongoShellParserRULE_value = 25 - MongoShellParserRULE_newKeywordError = 26 - MongoShellParserRULE_array = 27 - MongoShellParserRULE_helperFunction = 28 - MongoShellParserRULE_objectIdHelper = 29 - MongoShellParserRULE_isoDateHelper = 30 - MongoShellParserRULE_dateHelper = 31 - MongoShellParserRULE_uuidHelper = 32 - MongoShellParserRULE_longHelper = 33 - MongoShellParserRULE_int32Helper = 34 - MongoShellParserRULE_doubleHelper = 35 - MongoShellParserRULE_decimal128Helper = 36 - MongoShellParserRULE_timestampHelper = 37 - MongoShellParserRULE_regExpConstructor = 38 - MongoShellParserRULE_literal = 39 - MongoShellParserRULE_stringLiteral = 40 - MongoShellParserRULE_identifier = 41 + MongoShellParserRULE_genericDbMethod = 4 + MongoShellParserRULE_bulkStatement = 5 + MongoShellParserRULE_bulkInitMethod = 6 + MongoShellParserRULE_bulkMethodChain = 7 + MongoShellParserRULE_bulkMethod = 8 + MongoShellParserRULE_connectionStatement = 9 + MongoShellParserRULE_connectionMethodChain = 10 + MongoShellParserRULE_rsStatement = 11 + MongoShellParserRULE_shStatement = 12 + MongoShellParserRULE_encryptionStatement = 13 + MongoShellParserRULE_planCacheStatement = 14 + MongoShellParserRULE_spStatement = 15 + MongoShellParserRULE_nativeFunctionCall = 16 + MongoShellParserRULE_connectionMethod = 17 + MongoShellParserRULE_collectionAccess = 18 + MongoShellParserRULE_methodChain = 19 + MongoShellParserRULE_methodCall = 20 + MongoShellParserRULE_findMethod = 21 + MongoShellParserRULE_findOneMethod = 22 + MongoShellParserRULE_countDocumentsMethod = 23 + MongoShellParserRULE_estimatedDocumentCountMethod = 24 + MongoShellParserRULE_distinctMethod = 25 + MongoShellParserRULE_aggregateMethod = 26 + MongoShellParserRULE_getIndexesMethod = 27 + MongoShellParserRULE_insertOneMethod = 28 + MongoShellParserRULE_insertManyMethod = 29 + MongoShellParserRULE_updateOneMethod = 30 + MongoShellParserRULE_updateManyMethod = 31 + MongoShellParserRULE_deleteOneMethod = 32 + MongoShellParserRULE_deleteManyMethod = 33 + MongoShellParserRULE_replaceOneMethod = 34 + MongoShellParserRULE_findOneAndUpdateMethod = 35 + MongoShellParserRULE_findOneAndReplaceMethod = 36 + MongoShellParserRULE_findOneAndDeleteMethod = 37 + MongoShellParserRULE_createIndexMethod = 38 + MongoShellParserRULE_createIndexesMethod = 39 + MongoShellParserRULE_dropIndexMethod = 40 + MongoShellParserRULE_dropIndexesMethod = 41 + MongoShellParserRULE_dropMethod = 42 + MongoShellParserRULE_renameCollectionMethod = 43 + MongoShellParserRULE_statsMethod = 44 + MongoShellParserRULE_storageSizeMethod = 45 + MongoShellParserRULE_totalIndexSizeMethod = 46 + MongoShellParserRULE_totalSizeMethod = 47 + MongoShellParserRULE_dataSizeMethod = 48 + MongoShellParserRULE_isCappedMethod = 49 + MongoShellParserRULE_validateMethod = 50 + MongoShellParserRULE_latencyStatsMethod = 51 + MongoShellParserRULE_sortMethod = 52 + MongoShellParserRULE_limitMethod = 53 + MongoShellParserRULE_skipMethod = 54 + MongoShellParserRULE_countMethod = 55 + MongoShellParserRULE_projectionMethod = 56 + MongoShellParserRULE_batchSizeMethod = 57 + MongoShellParserRULE_closeMethod = 58 + MongoShellParserRULE_collationMethod = 59 + MongoShellParserRULE_commentMethod = 60 + MongoShellParserRULE_explainMethod = 61 + MongoShellParserRULE_forEachMethod = 62 + MongoShellParserRULE_hasNextMethod = 63 + MongoShellParserRULE_hintMethod = 64 + MongoShellParserRULE_isClosedMethod = 65 + MongoShellParserRULE_isExhaustedMethod = 66 + MongoShellParserRULE_itcountMethod = 67 + MongoShellParserRULE_mapMethod = 68 + MongoShellParserRULE_maxMethod = 69 + MongoShellParserRULE_maxAwaitTimeMSMethod = 70 + MongoShellParserRULE_maxTimeMSMethod = 71 + MongoShellParserRULE_minMethod = 72 + MongoShellParserRULE_nextMethod = 73 + MongoShellParserRULE_noCursorTimeoutMethod = 74 + MongoShellParserRULE_objsLeftInBatchMethod = 75 + MongoShellParserRULE_prettyMethod = 76 + MongoShellParserRULE_readConcernMethod = 77 + MongoShellParserRULE_readPrefMethod = 78 + MongoShellParserRULE_returnKeyMethod = 79 + MongoShellParserRULE_showRecordIdMethod = 80 + MongoShellParserRULE_sizeMethod = 81 + MongoShellParserRULE_tailableMethod = 82 + MongoShellParserRULE_toArrayMethod = 83 + MongoShellParserRULE_tryNextMethod = 84 + MongoShellParserRULE_allowDiskUseMethod = 85 + MongoShellParserRULE_addOptionMethod = 86 + MongoShellParserRULE_genericMethod = 87 + MongoShellParserRULE_arguments = 88 + MongoShellParserRULE_argument = 89 + MongoShellParserRULE_document = 90 + MongoShellParserRULE_pair = 91 + MongoShellParserRULE_key = 92 + MongoShellParserRULE_value = 93 + MongoShellParserRULE_newKeywordError = 94 + MongoShellParserRULE_array = 95 + MongoShellParserRULE_helperFunction = 96 + MongoShellParserRULE_objectIdHelper = 97 + MongoShellParserRULE_isoDateHelper = 98 + MongoShellParserRULE_dateHelper = 99 + MongoShellParserRULE_uuidHelper = 100 + MongoShellParserRULE_longHelper = 101 + MongoShellParserRULE_int32Helper = 102 + MongoShellParserRULE_doubleHelper = 103 + MongoShellParserRULE_decimal128Helper = 104 + MongoShellParserRULE_timestampHelper = 105 + MongoShellParserRULE_regExpConstructor = 106 + MongoShellParserRULE_binDataHelper = 107 + MongoShellParserRULE_binaryHelper = 108 + MongoShellParserRULE_bsonRegExpHelper = 109 + MongoShellParserRULE_hexDataHelper = 110 + MongoShellParserRULE_literal = 111 + MongoShellParserRULE_stringLiteral = 112 + MongoShellParserRULE_identifier = 113 ) // IProgramContext is an interface to support dynamic dispatch. @@ -548,20 +1272,20 @@ func (p *MongoShellParser) Program() (localctx IProgramContext) { var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(87) + p.SetState(231) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - for _la == MongoShellParserSHOW || _la == MongoShellParserDB { + for ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&-2) != 0) || ((int64((_la-64)) & ^0x3f) == 0 && ((int64(1)<<(_la-64))&-1) != 0) || ((int64((_la-128)) & ^0x3f) == 0 && ((int64(1)<<(_la-128))&33816831) != 0) { { - p.SetState(84) + p.SetState(228) p.Statement() } - p.SetState(89) + p.SetState(233) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -569,7 +1293,7 @@ func (p *MongoShellParser) Program() (localctx IProgramContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(90) + p.SetState(234) p.Match(MongoShellParserEOF) if p.HasError() { // Recognition error - abort rule @@ -601,6 +1325,14 @@ type IStatementContext interface { ShellCommand() IShellCommandContext SEMI() antlr.TerminalNode DbStatement() IDbStatementContext + BulkStatement() IBulkStatementContext + ConnectionStatement() IConnectionStatementContext + RsStatement() IRsStatementContext + ShStatement() IShStatementContext + EncryptionStatement() IEncryptionStatementContext + PlanCacheStatement() IPlanCacheStatementContext + SpStatement() ISpStatementContext + NativeFunctionCall() INativeFunctionCallContext // IsStatementContext differentiates from other interfaces. IsStatementContext() @@ -674,6 +1406,134 @@ func (s *StatementContext) DbStatement() IDbStatementContext { return t.(IDbStatementContext) } +func (s *StatementContext) BulkStatement() IBulkStatementContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IBulkStatementContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IBulkStatementContext) +} + +func (s *StatementContext) ConnectionStatement() IConnectionStatementContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IConnectionStatementContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IConnectionStatementContext) +} + +func (s *StatementContext) RsStatement() IRsStatementContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IRsStatementContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IRsStatementContext) +} + +func (s *StatementContext) ShStatement() IShStatementContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IShStatementContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IShStatementContext) +} + +func (s *StatementContext) EncryptionStatement() IEncryptionStatementContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IEncryptionStatementContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IEncryptionStatementContext) +} + +func (s *StatementContext) PlanCacheStatement() IPlanCacheStatementContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPlanCacheStatementContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IPlanCacheStatementContext) +} + +func (s *StatementContext) SpStatement() ISpStatementContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISpStatementContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISpStatementContext) +} + +func (s *StatementContext) NativeFunctionCall() INativeFunctionCallContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(INativeFunctionCallContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(INativeFunctionCallContext) +} + func (s *StatementContext) GetRuleContext() antlr.RuleContext { return s } @@ -709,20 +1569,20 @@ func (p *MongoShellParser) Statement() (localctx IStatementContext) { p.EnterRule(localctx, 2, MongoShellParserRULE_statement) var _la int - p.SetState(100) + p.SetState(276) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetTokenStream().LA(1) { - case MongoShellParserSHOW: + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 11, p.GetParserRuleContext()) { + case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(92) + p.SetState(236) p.ShellCommand() } - p.SetState(94) + p.SetState(238) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -731,7 +1591,7 @@ func (p *MongoShellParser) Statement() (localctx IStatementContext) { if _la == MongoShellParserSEMI { { - p.SetState(93) + p.SetState(237) p.Match(MongoShellParserSEMI) if p.HasError() { // Recognition error - abort rule @@ -741,13 +1601,13 @@ func (p *MongoShellParser) Statement() (localctx IStatementContext) { } - case MongoShellParserDB: + case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(96) + p.SetState(240) p.DbStatement() } - p.SetState(98) + p.SetState(242) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -756,7 +1616,7 @@ func (p *MongoShellParser) Statement() (localctx IStatementContext) { if _la == MongoShellParserSEMI { { - p.SetState(97) + p.SetState(241) p.Match(MongoShellParserSEMI) if p.HasError() { // Recognition error - abort rule @@ -766,71 +1626,270 @@ func (p *MongoShellParser) Statement() (localctx IStatementContext) { } - default: - p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) - goto errorExit - } + case 3: + p.EnterOuterAlt(localctx, 3) + { + p.SetState(244) + p.BulkStatement() + } + p.SetState(246) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) -errorExit: - if p.HasError() { - v := p.GetError() - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - p.SetError(nil) - } - p.ExitRule() - return localctx - goto errorExit // Trick to prevent compiler error if the label is not used -} + if _la == MongoShellParserSEMI { + { + p.SetState(245) + p.Match(MongoShellParserSEMI) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -// IShellCommandContext is an interface to support dynamic dispatch. -type IShellCommandContext interface { - antlr.ParserRuleContext + } - // GetParser returns the parser. - GetParser() antlr.Parser - // IsShellCommandContext differentiates from other interfaces. - IsShellCommandContext() -} + case 4: + p.EnterOuterAlt(localctx, 4) + { + p.SetState(248) + p.ConnectionStatement() + } + p.SetState(250) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) -type ShellCommandContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser -} + if _la == MongoShellParserSEMI { + { + p.SetState(249) + p.Match(MongoShellParserSEMI) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func NewEmptyShellCommandContext() *ShellCommandContext { - var p = new(ShellCommandContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_shellCommand - return p -} + } -func InitEmptyShellCommandContext(p *ShellCommandContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_shellCommand -} + case 5: + p.EnterOuterAlt(localctx, 5) + { + p.SetState(252) + p.RsStatement() + } + p.SetState(254) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) -func (*ShellCommandContext) IsShellCommandContext() {} + if _la == MongoShellParserSEMI { + { + p.SetState(253) + p.Match(MongoShellParserSEMI) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func NewShellCommandContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ShellCommandContext { - var p = new(ShellCommandContext) + } - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + case 6: + p.EnterOuterAlt(localctx, 6) + { + p.SetState(256) + p.ShStatement() + } + p.SetState(258) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) - p.parser = parser - p.RuleIndex = MongoShellParserRULE_shellCommand + if _la == MongoShellParserSEMI { + { + p.SetState(257) + p.Match(MongoShellParserSEMI) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } - return p -} + } -func (s *ShellCommandContext) GetParser() antlr.Parser { return s.parser } + case 7: + p.EnterOuterAlt(localctx, 7) + { + p.SetState(260) + p.EncryptionStatement() + } + p.SetState(262) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) -func (s *ShellCommandContext) CopyAll(ctx *ShellCommandContext) { - s.CopyFrom(&ctx.BaseParserRuleContext) -} + if _la == MongoShellParserSEMI { + { + p.SetState(261) + p.Match(MongoShellParserSEMI) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *ShellCommandContext) GetRuleContext() antlr.RuleContext { + } + + case 8: + p.EnterOuterAlt(localctx, 8) + { + p.SetState(264) + p.PlanCacheStatement() + } + p.SetState(266) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == MongoShellParserSEMI { + { + p.SetState(265) + p.Match(MongoShellParserSEMI) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + + case 9: + p.EnterOuterAlt(localctx, 9) + { + p.SetState(268) + p.SpStatement() + } + p.SetState(270) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == MongoShellParserSEMI { + { + p.SetState(269) + p.Match(MongoShellParserSEMI) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + + case 10: + p.EnterOuterAlt(localctx, 10) + { + p.SetState(272) + p.NativeFunctionCall() + } + p.SetState(274) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == MongoShellParserSEMI { + { + p.SetState(273) + p.Match(MongoShellParserSEMI) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + + 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 +} + +// IShellCommandContext is an interface to support dynamic dispatch. +type IShellCommandContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsShellCommandContext differentiates from other interfaces. + IsShellCommandContext() +} + +type ShellCommandContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyShellCommandContext() *ShellCommandContext { + var p = new(ShellCommandContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_shellCommand + return p +} + +func InitEmptyShellCommandContext(p *ShellCommandContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_shellCommand +} + +func (*ShellCommandContext) IsShellCommandContext() {} + +func NewShellCommandContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ShellCommandContext { + var p = new(ShellCommandContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_shellCommand + + return p +} + +func (s *ShellCommandContext) GetParser() antlr.Parser { return s.parser } + +func (s *ShellCommandContext) CopyAll(ctx *ShellCommandContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *ShellCommandContext) GetRuleContext() antlr.RuleContext { return s } @@ -943,18 +2002,18 @@ func (p *MongoShellParser) ShellCommand() (localctx IShellCommandContext) { p.EnterRule(localctx, 4, MongoShellParserRULE_shellCommand) var _la int - p.SetState(106) + p.SetState(282) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 4, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 12, p.GetParserRuleContext()) { case 1: localctx = NewShowDatabasesContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(102) + p.SetState(278) p.Match(MongoShellParserSHOW) if p.HasError() { // Recognition error - abort rule @@ -962,7 +2021,7 @@ func (p *MongoShellParser) ShellCommand() (localctx IShellCommandContext) { } } { - p.SetState(103) + p.SetState(279) _la = p.GetTokenStream().LA(1) if !(_la == MongoShellParserDBS || _la == MongoShellParserDATABASES) { @@ -977,7 +2036,7 @@ func (p *MongoShellParser) ShellCommand() (localctx IShellCommandContext) { localctx = NewShowCollectionsContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(104) + p.SetState(280) p.Match(MongoShellParserSHOW) if p.HasError() { // Recognition error - abort rule @@ -985,7 +2044,7 @@ func (p *MongoShellParser) ShellCommand() (localctx IShellCommandContext) { } } { - p.SetState(105) + p.SetState(281) p.Match(MongoShellParserCOLLECTIONS) if p.HasError() { // Recognition error - abort rule @@ -1064,12 +2123,12 @@ func (s *DbStatementContext) ToStringTree(ruleNames []string, recog antlr.Recogn return antlr.TreesStringTree(s, ruleNames, recog) } -type CollectionOperationContext struct { +type DropDatabaseContext struct { DbStatementContext } -func NewCollectionOperationContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CollectionOperationContext { - var p = new(CollectionOperationContext) +func NewDropDatabaseContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DropDatabaseContext { + var p = new(DropDatabaseContext) InitEmptyDbStatementContext(&p.DbStatementContext) p.parser = parser @@ -1078,74 +2137,58 @@ func NewCollectionOperationContext(parser antlr.Parser, ctx antlr.ParserRuleCont return p } -func (s *CollectionOperationContext) GetRuleContext() antlr.RuleContext { +func (s *DropDatabaseContext) GetRuleContext() antlr.RuleContext { return s } -func (s *CollectionOperationContext) DB() antlr.TerminalNode { +func (s *DropDatabaseContext) DB() antlr.TerminalNode { return s.GetToken(MongoShellParserDB, 0) } -func (s *CollectionOperationContext) CollectionAccess() ICollectionAccessContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ICollectionAccessContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(ICollectionAccessContext) +func (s *DropDatabaseContext) DOT() antlr.TerminalNode { + return s.GetToken(MongoShellParserDOT, 0) } -func (s *CollectionOperationContext) MethodChain() IMethodChainContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IMethodChainContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } +func (s *DropDatabaseContext) DROP_DATABASE() antlr.TerminalNode { + return s.GetToken(MongoShellParserDROP_DATABASE, 0) +} - if t == nil { - return nil - } +func (s *DropDatabaseContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} - return t.(IMethodChainContext) +func (s *DropDatabaseContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) } -func (s *CollectionOperationContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *DropDatabaseContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterCollectionOperation(s) + listenerT.EnterDropDatabase(s) } } -func (s *CollectionOperationContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *DropDatabaseContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitCollectionOperation(s) + listenerT.ExitDropDatabase(s) } } -func (s *CollectionOperationContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *DropDatabaseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitCollectionOperation(s) + return t.VisitDropDatabase(s) default: return t.VisitChildren(s) } } -type GetCollectionNamesContext struct { +type ServerStatusContext struct { DbStatementContext } -func NewGetCollectionNamesContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *GetCollectionNamesContext { - var p = new(GetCollectionNamesContext) +func NewServerStatusContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ServerStatusContext { + var p = new(ServerStatusContext) InitEmptyDbStatementContext(&p.DbStatementContext) p.parser = parser @@ -1154,34 +2197,34 @@ func NewGetCollectionNamesContext(parser antlr.Parser, ctx antlr.ParserRuleConte return p } -func (s *GetCollectionNamesContext) GetRuleContext() antlr.RuleContext { +func (s *ServerStatusContext) GetRuleContext() antlr.RuleContext { return s } -func (s *GetCollectionNamesContext) DB() antlr.TerminalNode { +func (s *ServerStatusContext) DB() antlr.TerminalNode { return s.GetToken(MongoShellParserDB, 0) } -func (s *GetCollectionNamesContext) DOT() antlr.TerminalNode { +func (s *ServerStatusContext) DOT() antlr.TerminalNode { return s.GetToken(MongoShellParserDOT, 0) } -func (s *GetCollectionNamesContext) GET_COLLECTION_NAMES() antlr.TerminalNode { - return s.GetToken(MongoShellParserGET_COLLECTION_NAMES, 0) +func (s *ServerStatusContext) SERVER_STATUS() antlr.TerminalNode { + return s.GetToken(MongoShellParserSERVER_STATUS, 0) } -func (s *GetCollectionNamesContext) LPAREN() antlr.TerminalNode { +func (s *ServerStatusContext) LPAREN() antlr.TerminalNode { return s.GetToken(MongoShellParserLPAREN, 0) } -func (s *GetCollectionNamesContext) RPAREN() antlr.TerminalNode { +func (s *ServerStatusContext) RPAREN() antlr.TerminalNode { return s.GetToken(MongoShellParserRPAREN, 0) } -func (s *GetCollectionNamesContext) MethodChain() IMethodChainContext { +func (s *ServerStatusContext) Argument() IArgumentContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IMethodChainContext); ok { + if _, ok := ctx.(IArgumentContext); ok { t = ctx.(antlr.RuleContext) break } @@ -1191,37 +2234,37 @@ func (s *GetCollectionNamesContext) MethodChain() IMethodChainContext { return nil } - return t.(IMethodChainContext) + return t.(IArgumentContext) } -func (s *GetCollectionNamesContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *ServerStatusContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterGetCollectionNames(s) + listenerT.EnterServerStatus(s) } } -func (s *GetCollectionNamesContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *ServerStatusContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitGetCollectionNames(s) + listenerT.ExitServerStatus(s) } } -func (s *GetCollectionNamesContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *ServerStatusContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitGetCollectionNames(s) + return t.VisitServerStatus(s) default: return t.VisitChildren(s) } } -type GetCollectionInfosContext struct { +type GetNameContext struct { DbStatementContext } -func NewGetCollectionInfosContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *GetCollectionInfosContext { - var p = new(GetCollectionInfosContext) +func NewGetNameContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *GetNameContext { + var p = new(GetNameContext) InitEmptyDbStatementContext(&p.DbStatementContext) p.parser = parser @@ -1230,50 +2273,90 @@ func NewGetCollectionInfosContext(parser antlr.Parser, ctx antlr.ParserRuleConte return p } -func (s *GetCollectionInfosContext) GetRuleContext() antlr.RuleContext { +func (s *GetNameContext) GetRuleContext() antlr.RuleContext { return s } -func (s *GetCollectionInfosContext) DB() antlr.TerminalNode { +func (s *GetNameContext) DB() antlr.TerminalNode { return s.GetToken(MongoShellParserDB, 0) } -func (s *GetCollectionInfosContext) DOT() antlr.TerminalNode { +func (s *GetNameContext) DOT() antlr.TerminalNode { return s.GetToken(MongoShellParserDOT, 0) } -func (s *GetCollectionInfosContext) GET_COLLECTION_INFOS() antlr.TerminalNode { - return s.GetToken(MongoShellParserGET_COLLECTION_INFOS, 0) +func (s *GetNameContext) GET_NAME() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_NAME, 0) } -func (s *GetCollectionInfosContext) LPAREN() antlr.TerminalNode { +func (s *GetNameContext) LPAREN() antlr.TerminalNode { return s.GetToken(MongoShellParserLPAREN, 0) } -func (s *GetCollectionInfosContext) RPAREN() antlr.TerminalNode { +func (s *GetNameContext) RPAREN() antlr.TerminalNode { return s.GetToken(MongoShellParserRPAREN, 0) } -func (s *GetCollectionInfosContext) Arguments() IArgumentsContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IArgumentsContext); ok { - t = ctx.(antlr.RuleContext) - break - } +func (s *GetNameContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterGetName(s) } +} - if t == nil { - return nil +func (s *GetNameContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitGetName(s) } +} - return t.(IArgumentsContext) +func (s *GetNameContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitGetName(s) + + default: + return t.VisitChildren(s) + } } -func (s *GetCollectionInfosContext) MethodChain() IMethodChainContext { +type GetSiblingDBContext struct { + DbStatementContext +} + +func NewGetSiblingDBContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *GetSiblingDBContext { + var p = new(GetSiblingDBContext) + + InitEmptyDbStatementContext(&p.DbStatementContext) + p.parser = parser + p.CopyAll(ctx.(*DbStatementContext)) + + return p +} + +func (s *GetSiblingDBContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *GetSiblingDBContext) DB() antlr.TerminalNode { + return s.GetToken(MongoShellParserDB, 0) +} + +func (s *GetSiblingDBContext) DOT() antlr.TerminalNode { + return s.GetToken(MongoShellParserDOT, 0) +} + +func (s *GetSiblingDBContext) GET_SIBLING_DB() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_SIBLING_DB, 0) +} + +func (s *GetSiblingDBContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *GetSiblingDBContext) Argument() IArgumentContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IMethodChainContext); ok { + if _, ok := ctx.(IArgumentContext); ok { t = ctx.(antlr.RuleContext) break } @@ -1283,290 +2366,193 @@ func (s *GetCollectionInfosContext) MethodChain() IMethodChainContext { return nil } - return t.(IMethodChainContext) + return t.(IArgumentContext) } -func (s *GetCollectionInfosContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *GetSiblingDBContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *GetSiblingDBContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterGetCollectionInfos(s) + listenerT.EnterGetSiblingDB(s) } } -func (s *GetCollectionInfosContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *GetSiblingDBContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitGetCollectionInfos(s) + listenerT.ExitGetSiblingDB(s) } } -func (s *GetCollectionInfosContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *GetSiblingDBContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitGetCollectionInfos(s) + return t.VisitGetSiblingDB(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) DbStatement() (localctx IDbStatementContext) { - localctx = NewDbStatementContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 6, MongoShellParserRULE_dbStatement) - var _la int - - p.SetState(131) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } +type DbVersionContext struct { + DbStatementContext +} - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 8, p.GetParserRuleContext()) { - case 1: - localctx = NewGetCollectionNamesContext(p, localctx) - p.EnterOuterAlt(localctx, 1) - { - p.SetState(108) - p.Match(MongoShellParserDB) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(109) - p.Match(MongoShellParserDOT) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(110) - p.Match(MongoShellParserGET_COLLECTION_NAMES) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(111) - p.Match(MongoShellParserLPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(112) - p.Match(MongoShellParserRPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.SetState(114) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) +func NewDbVersionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DbVersionContext { + var p = new(DbVersionContext) - if _la == MongoShellParserDOT { - { - p.SetState(113) - p.MethodChain() - } + InitEmptyDbStatementContext(&p.DbStatementContext) + p.parser = parser + p.CopyAll(ctx.(*DbStatementContext)) - } + return p +} - case 2: - localctx = NewGetCollectionInfosContext(p, localctx) - p.EnterOuterAlt(localctx, 2) - { - p.SetState(116) - p.Match(MongoShellParserDB) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(117) - p.Match(MongoShellParserDOT) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(118) - p.Match(MongoShellParserGET_COLLECTION_INFOS) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(119) - p.Match(MongoShellParserLPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.SetState(121) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) +func (s *DbVersionContext) GetRuleContext() antlr.RuleContext { + return s +} - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&67564989593936832) != 0 { - { - p.SetState(120) - p.Arguments() - } +func (s *DbVersionContext) DB() antlr.TerminalNode { + return s.GetToken(MongoShellParserDB, 0) +} - } - { - p.SetState(123) - p.Match(MongoShellParserRPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.SetState(125) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) +func (s *DbVersionContext) DOT() antlr.TerminalNode { + return s.GetToken(MongoShellParserDOT, 0) +} - if _la == MongoShellParserDOT { - { - p.SetState(124) - p.MethodChain() - } +func (s *DbVersionContext) VERSION() antlr.TerminalNode { + return s.GetToken(MongoShellParserVERSION, 0) +} - } +func (s *DbVersionContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} - case 3: - localctx = NewCollectionOperationContext(p, localctx) - p.EnterOuterAlt(localctx, 3) - { - p.SetState(127) - p.Match(MongoShellParserDB) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(128) - p.CollectionAccess() - } - { - p.SetState(129) - p.MethodChain() - } +func (s *DbVersionContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} - case antlr.ATNInvalidAltNumber: - goto errorExit +func (s *DbVersionContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterDbVersion(s) } +} -errorExit: - if p.HasError() { - v := p.GetError() - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - p.SetError(nil) +func (s *DbVersionContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitDbVersion(s) } - p.ExitRule() - return localctx - goto errorExit // Trick to prevent compiler error if the label is not used } -// ICollectionAccessContext is an interface to support dynamic dispatch. -type ICollectionAccessContext interface { - antlr.ParserRuleContext +func (s *DbVersionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitDbVersion(s) - // GetParser returns the parser. - GetParser() antlr.Parser - // IsCollectionAccessContext differentiates from other interfaces. - IsCollectionAccessContext() + default: + return t.VisitChildren(s) + } } -type CollectionAccessContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser +type HostInfoContext struct { + DbStatementContext } -func NewEmptyCollectionAccessContext() *CollectionAccessContext { - var p = new(CollectionAccessContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_collectionAccess +func NewHostInfoContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *HostInfoContext { + var p = new(HostInfoContext) + + InitEmptyDbStatementContext(&p.DbStatementContext) + p.parser = parser + p.CopyAll(ctx.(*DbStatementContext)) + return p } -func InitEmptyCollectionAccessContext(p *CollectionAccessContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_collectionAccess +func (s *HostInfoContext) GetRuleContext() antlr.RuleContext { + return s } -func (*CollectionAccessContext) IsCollectionAccessContext() {} - -func NewCollectionAccessContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CollectionAccessContext { - var p = new(CollectionAccessContext) +func (s *HostInfoContext) DB() antlr.TerminalNode { + return s.GetToken(MongoShellParserDB, 0) +} - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) +func (s *HostInfoContext) DOT() antlr.TerminalNode { + return s.GetToken(MongoShellParserDOT, 0) +} - p.parser = parser - p.RuleIndex = MongoShellParserRULE_collectionAccess +func (s *HostInfoContext) HOST_INFO() antlr.TerminalNode { + return s.GetToken(MongoShellParserHOST_INFO, 0) +} - return p +func (s *HostInfoContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) } -func (s *CollectionAccessContext) GetParser() antlr.Parser { return s.parser } +func (s *HostInfoContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} -func (s *CollectionAccessContext) CopyAll(ctx *CollectionAccessContext) { - s.CopyFrom(&ctx.BaseParserRuleContext) +func (s *HostInfoContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterHostInfo(s) + } } -func (s *CollectionAccessContext) GetRuleContext() antlr.RuleContext { - return s +func (s *HostInfoContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitHostInfo(s) + } } -func (s *CollectionAccessContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) +func (s *HostInfoContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitHostInfo(s) + + default: + return t.VisitChildren(s) + } } -type DotAccessContext struct { - CollectionAccessContext +type AdminCommandContext struct { + DbStatementContext } -func NewDotAccessContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DotAccessContext { - var p = new(DotAccessContext) +func NewAdminCommandContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *AdminCommandContext { + var p = new(AdminCommandContext) - InitEmptyCollectionAccessContext(&p.CollectionAccessContext) + InitEmptyDbStatementContext(&p.DbStatementContext) p.parser = parser - p.CopyAll(ctx.(*CollectionAccessContext)) + p.CopyAll(ctx.(*DbStatementContext)) return p } -func (s *DotAccessContext) GetRuleContext() antlr.RuleContext { +func (s *AdminCommandContext) GetRuleContext() antlr.RuleContext { return s } -func (s *DotAccessContext) DOT() antlr.TerminalNode { +func (s *AdminCommandContext) DB() antlr.TerminalNode { + return s.GetToken(MongoShellParserDB, 0) +} + +func (s *AdminCommandContext) DOT() antlr.TerminalNode { return s.GetToken(MongoShellParserDOT, 0) } -func (s *DotAccessContext) Identifier() IIdentifierContext { +func (s *AdminCommandContext) ADMIN_COMMAND() antlr.TerminalNode { + return s.GetToken(MongoShellParserADMIN_COMMAND, 0) +} + +func (s *AdminCommandContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *AdminCommandContext) Arguments() IArgumentsContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IIdentifierContext); ok { + if _, ok := ctx.(IArgumentsContext); ok { t = ctx.(antlr.RuleContext) break } @@ -1576,65 +2562,77 @@ func (s *DotAccessContext) Identifier() IIdentifierContext { return nil } - return t.(IIdentifierContext) + return t.(IArgumentsContext) } -func (s *DotAccessContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *AdminCommandContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *AdminCommandContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterDotAccess(s) + listenerT.EnterAdminCommand(s) } } -func (s *DotAccessContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *AdminCommandContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitDotAccess(s) + listenerT.ExitAdminCommand(s) } } -func (s *DotAccessContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *AdminCommandContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitDotAccess(s) + return t.VisitAdminCommand(s) default: return t.VisitChildren(s) } } -type GetCollectionAccessContext struct { - CollectionAccessContext +type CollectionOperationContext struct { + DbStatementContext } -func NewGetCollectionAccessContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *GetCollectionAccessContext { - var p = new(GetCollectionAccessContext) +func NewCollectionOperationContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CollectionOperationContext { + var p = new(CollectionOperationContext) - InitEmptyCollectionAccessContext(&p.CollectionAccessContext) + InitEmptyDbStatementContext(&p.DbStatementContext) p.parser = parser - p.CopyAll(ctx.(*CollectionAccessContext)) + p.CopyAll(ctx.(*DbStatementContext)) return p } -func (s *GetCollectionAccessContext) GetRuleContext() antlr.RuleContext { +func (s *CollectionOperationContext) GetRuleContext() antlr.RuleContext { return s } -func (s *GetCollectionAccessContext) DOT() antlr.TerminalNode { - return s.GetToken(MongoShellParserDOT, 0) +func (s *CollectionOperationContext) DB() antlr.TerminalNode { + return s.GetToken(MongoShellParserDB, 0) } -func (s *GetCollectionAccessContext) GET_COLLECTION() antlr.TerminalNode { - return s.GetToken(MongoShellParserGET_COLLECTION, 0) -} +func (s *CollectionOperationContext) CollectionAccess() ICollectionAccessContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICollectionAccessContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } -func (s *GetCollectionAccessContext) LPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserLPAREN, 0) + if t == nil { + return nil + } + + return t.(ICollectionAccessContext) } -func (s *GetCollectionAccessContext) StringLiteral() IStringLiteralContext { +func (s *CollectionOperationContext) MethodChain() IMethodChainContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IStringLiteralContext); ok { + if _, ok := ctx.(IMethodChainContext); ok { t = ctx.(antlr.RuleContext) break } @@ -1644,294 +2642,199 @@ func (s *GetCollectionAccessContext) StringLiteral() IStringLiteralContext { return nil } - return t.(IStringLiteralContext) -} - -func (s *GetCollectionAccessContext) RPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserRPAREN, 0) + return t.(IMethodChainContext) } -func (s *GetCollectionAccessContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *CollectionOperationContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterGetCollectionAccess(s) + listenerT.EnterCollectionOperation(s) } } -func (s *GetCollectionAccessContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *CollectionOperationContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitGetCollectionAccess(s) + listenerT.ExitCollectionOperation(s) } } -func (s *GetCollectionAccessContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *CollectionOperationContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitGetCollectionAccess(s) + return t.VisitCollectionOperation(s) default: return t.VisitChildren(s) } } -type BracketAccessContext struct { - CollectionAccessContext +type ListCommandsContext struct { + DbStatementContext } -func NewBracketAccessContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BracketAccessContext { - var p = new(BracketAccessContext) +func NewListCommandsContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ListCommandsContext { + var p = new(ListCommandsContext) - InitEmptyCollectionAccessContext(&p.CollectionAccessContext) + InitEmptyDbStatementContext(&p.DbStatementContext) p.parser = parser - p.CopyAll(ctx.(*CollectionAccessContext)) + p.CopyAll(ctx.(*DbStatementContext)) return p } -func (s *BracketAccessContext) GetRuleContext() antlr.RuleContext { +func (s *ListCommandsContext) GetRuleContext() antlr.RuleContext { return s } -func (s *BracketAccessContext) LBRACKET() antlr.TerminalNode { - return s.GetToken(MongoShellParserLBRACKET, 0) +func (s *ListCommandsContext) DB() antlr.TerminalNode { + return s.GetToken(MongoShellParserDB, 0) } -func (s *BracketAccessContext) StringLiteral() IStringLiteralContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IStringLiteralContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } +func (s *ListCommandsContext) DOT() antlr.TerminalNode { + return s.GetToken(MongoShellParserDOT, 0) +} - if t == nil { - return nil - } +func (s *ListCommandsContext) LIST_COMMANDS() antlr.TerminalNode { + return s.GetToken(MongoShellParserLIST_COMMANDS, 0) +} - return t.(IStringLiteralContext) +func (s *ListCommandsContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) } -func (s *BracketAccessContext) RBRACKET() antlr.TerminalNode { - return s.GetToken(MongoShellParserRBRACKET, 0) +func (s *ListCommandsContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) } -func (s *BracketAccessContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *ListCommandsContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterBracketAccess(s) + listenerT.EnterListCommands(s) } } -func (s *BracketAccessContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *ListCommandsContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitBracketAccess(s) + listenerT.ExitListCommands(s) } } -func (s *BracketAccessContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *ListCommandsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitBracketAccess(s) + return t.VisitListCommands(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) CollectionAccess() (localctx ICollectionAccessContext) { - localctx = NewCollectionAccessContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 8, MongoShellParserRULE_collectionAccess) - p.SetState(145) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } +type DbGenericMethodContext struct { + DbStatementContext +} - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 9, p.GetParserRuleContext()) { - case 1: - localctx = NewDotAccessContext(p, localctx) - p.EnterOuterAlt(localctx, 1) - { - p.SetState(133) - p.Match(MongoShellParserDOT) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(134) - p.Identifier() - } +func NewDbGenericMethodContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DbGenericMethodContext { + var p = new(DbGenericMethodContext) - case 2: - localctx = NewBracketAccessContext(p, localctx) - p.EnterOuterAlt(localctx, 2) - { - p.SetState(135) - p.Match(MongoShellParserLBRACKET) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(136) - p.StringLiteral() - } - { - p.SetState(137) - p.Match(MongoShellParserRBRACKET) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } + InitEmptyDbStatementContext(&p.DbStatementContext) + p.parser = parser + p.CopyAll(ctx.(*DbStatementContext)) - case 3: - localctx = NewGetCollectionAccessContext(p, localctx) - p.EnterOuterAlt(localctx, 3) - { - p.SetState(139) - p.Match(MongoShellParserDOT) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(140) - p.Match(MongoShellParserGET_COLLECTION) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(141) - p.Match(MongoShellParserLPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(142) - p.StringLiteral() - } - { - p.SetState(143) - p.Match(MongoShellParserRPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } + return p +} - case antlr.ATNInvalidAltNumber: - goto errorExit - } +func (s *DbGenericMethodContext) GetRuleContext() antlr.RuleContext { + return s +} -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 (s *DbGenericMethodContext) DB() antlr.TerminalNode { + return s.GetToken(MongoShellParserDB, 0) } -// IMethodChainContext is an interface to support dynamic dispatch. -type IMethodChainContext interface { - antlr.ParserRuleContext +func (s *DbGenericMethodContext) DOT() antlr.TerminalNode { + return s.GetToken(MongoShellParserDOT, 0) +} - // GetParser returns the parser. - GetParser() antlr.Parser +func (s *DbGenericMethodContext) GenericDbMethod() IGenericDbMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IGenericDbMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } - // Getter signatures - AllDOT() []antlr.TerminalNode - DOT(i int) antlr.TerminalNode - AllMethodCall() []IMethodCallContext - MethodCall(i int) IMethodCallContext + if t == nil { + return nil + } - // IsMethodChainContext differentiates from other interfaces. - IsMethodChainContext() + return t.(IGenericDbMethodContext) } -type MethodChainContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser +func (s *DbGenericMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterDbGenericMethod(s) + } } -func NewEmptyMethodChainContext() *MethodChainContext { - var p = new(MethodChainContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_methodChain - return p +func (s *DbGenericMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitDbGenericMethod(s) + } } -func InitEmptyMethodChainContext(p *MethodChainContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_methodChain +func (s *DbGenericMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitDbGenericMethod(s) + + default: + return t.VisitChildren(s) + } } -func (*MethodChainContext) IsMethodChainContext() {} +type GetCollectionNamesContext struct { + DbStatementContext +} -func NewMethodChainContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MethodChainContext { - var p = new(MethodChainContext) - - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) +func NewGetCollectionNamesContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *GetCollectionNamesContext { + var p = new(GetCollectionNamesContext) + InitEmptyDbStatementContext(&p.DbStatementContext) p.parser = parser - p.RuleIndex = MongoShellParserRULE_methodChain + p.CopyAll(ctx.(*DbStatementContext)) return p } -func (s *MethodChainContext) GetParser() antlr.Parser { return s.parser } +func (s *GetCollectionNamesContext) GetRuleContext() antlr.RuleContext { + return s +} -func (s *MethodChainContext) AllDOT() []antlr.TerminalNode { - return s.GetTokens(MongoShellParserDOT) +func (s *GetCollectionNamesContext) DB() antlr.TerminalNode { + return s.GetToken(MongoShellParserDB, 0) } -func (s *MethodChainContext) DOT(i int) antlr.TerminalNode { - return s.GetToken(MongoShellParserDOT, i) +func (s *GetCollectionNamesContext) DOT() antlr.TerminalNode { + return s.GetToken(MongoShellParserDOT, 0) } -func (s *MethodChainContext) AllMethodCall() []IMethodCallContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IMethodCallContext); ok { - len++ - } - } +func (s *GetCollectionNamesContext) GET_COLLECTION_NAMES() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_COLLECTION_NAMES, 0) +} - tst := make([]IMethodCallContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IMethodCallContext); ok { - tst[i] = t.(IMethodCallContext) - i++ - } - } +func (s *GetCollectionNamesContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} - return tst +func (s *GetCollectionNamesContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) } -func (s *MethodChainContext) MethodCall(i int) IMethodCallContext { +func (s *GetCollectionNamesContext) MethodChain() IMethodChainContext { var t antlr.RuleContext - j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IMethodCallContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ + if _, ok := ctx.(IMethodChainContext); ok { + t = ctx.(antlr.RuleContext) + break } } @@ -1939,161 +2842,73 @@ func (s *MethodChainContext) MethodCall(i int) IMethodCallContext { return nil } - return t.(IMethodCallContext) -} - -func (s *MethodChainContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *MethodChainContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) + return t.(IMethodChainContext) } -func (s *MethodChainContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *GetCollectionNamesContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterMethodChain(s) + listenerT.EnterGetCollectionNames(s) } } -func (s *MethodChainContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *GetCollectionNamesContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitMethodChain(s) + listenerT.ExitGetCollectionNames(s) } } -func (s *MethodChainContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *GetCollectionNamesContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitMethodChain(s) + return t.VisitGetCollectionNames(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) MethodChain() (localctx IMethodChainContext) { - localctx = NewMethodChainContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 10, MongoShellParserRULE_methodChain) - var _la int - - p.EnterOuterAlt(localctx, 1) - { - p.SetState(147) - p.Match(MongoShellParserDOT) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(148) - p.MethodCall() - } - p.SetState(153) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - for _la == MongoShellParserDOT { - { - p.SetState(149) - p.Match(MongoShellParserDOT) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(150) - p.MethodCall() - } - - p.SetState(155) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - } - -errorExit: - if p.HasError() { - v := p.GetError() - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - p.SetError(nil) - } - p.ExitRule() - return localctx - goto errorExit // Trick to prevent compiler error if the label is not used +type GetCollectionInfosContext struct { + DbStatementContext } -// IMethodCallContext is an interface to support dynamic dispatch. -type IMethodCallContext interface { - antlr.ParserRuleContext - - // GetParser returns the parser. - GetParser() antlr.Parser +func NewGetCollectionInfosContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *GetCollectionInfosContext { + var p = new(GetCollectionInfosContext) - // Getter signatures - FindMethod() IFindMethodContext - FindOneMethod() IFindOneMethodContext - CountDocumentsMethod() ICountDocumentsMethodContext - EstimatedDocumentCountMethod() IEstimatedDocumentCountMethodContext - DistinctMethod() IDistinctMethodContext - AggregateMethod() IAggregateMethodContext - GetIndexesMethod() IGetIndexesMethodContext - SortMethod() ISortMethodContext - LimitMethod() ILimitMethodContext - SkipMethod() ISkipMethodContext - CountMethod() ICountMethodContext - ProjectionMethod() IProjectionMethodContext - GenericMethod() IGenericMethodContext + InitEmptyDbStatementContext(&p.DbStatementContext) + p.parser = parser + p.CopyAll(ctx.(*DbStatementContext)) - // IsMethodCallContext differentiates from other interfaces. - IsMethodCallContext() + return p } -type MethodCallContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser +func (s *GetCollectionInfosContext) GetRuleContext() antlr.RuleContext { + return s } -func NewEmptyMethodCallContext() *MethodCallContext { - var p = new(MethodCallContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_methodCall - return p +func (s *GetCollectionInfosContext) DB() antlr.TerminalNode { + return s.GetToken(MongoShellParserDB, 0) } -func InitEmptyMethodCallContext(p *MethodCallContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_methodCall +func (s *GetCollectionInfosContext) DOT() antlr.TerminalNode { + return s.GetToken(MongoShellParserDOT, 0) } -func (*MethodCallContext) IsMethodCallContext() {} - -func NewMethodCallContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MethodCallContext { - var p = new(MethodCallContext) - - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) - - p.parser = parser - p.RuleIndex = MongoShellParserRULE_methodCall +func (s *GetCollectionInfosContext) GET_COLLECTION_INFOS() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_COLLECTION_INFOS, 0) +} - return p +func (s *GetCollectionInfosContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) } -func (s *MethodCallContext) GetParser() antlr.Parser { return s.parser } +func (s *GetCollectionInfosContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} -func (s *MethodCallContext) FindMethod() IFindMethodContext { +func (s *GetCollectionInfosContext) Arguments() IArgumentsContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IFindMethodContext); ok { + if _, ok := ctx.(IArgumentsContext); ok { t = ctx.(antlr.RuleContext) break } @@ -2103,13 +2918,13 @@ func (s *MethodCallContext) FindMethod() IFindMethodContext { return nil } - return t.(IFindMethodContext) + return t.(IArgumentsContext) } -func (s *MethodCallContext) FindOneMethod() IFindOneMethodContext { +func (s *GetCollectionInfosContext) MethodChain() IMethodChainContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IFindOneMethodContext); ok { + if _, ok := ctx.(IMethodChainContext); ok { t = ctx.(antlr.RuleContext) break } @@ -2119,93 +2934,133 @@ func (s *MethodCallContext) FindOneMethod() IFindOneMethodContext { return nil } - return t.(IFindOneMethodContext) + return t.(IMethodChainContext) } -func (s *MethodCallContext) CountDocumentsMethod() ICountDocumentsMethodContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ICountDocumentsMethodContext); ok { - t = ctx.(antlr.RuleContext) - break - } +func (s *GetCollectionInfosContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterGetCollectionInfos(s) } +} - if t == nil { - return nil +func (s *GetCollectionInfosContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitGetCollectionInfos(s) } - - return t.(ICountDocumentsMethodContext) } -func (s *MethodCallContext) EstimatedDocumentCountMethod() IEstimatedDocumentCountMethodContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IEstimatedDocumentCountMethodContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } +func (s *GetCollectionInfosContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitGetCollectionInfos(s) - if t == nil { - return nil + default: + return t.VisitChildren(s) } +} - return t.(IEstimatedDocumentCountMethodContext) +type GetMongoContext struct { + DbStatementContext } -func (s *MethodCallContext) DistinctMethod() IDistinctMethodContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IDistinctMethodContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } +func NewGetMongoContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *GetMongoContext { + var p = new(GetMongoContext) - if t == nil { - return nil - } + InitEmptyDbStatementContext(&p.DbStatementContext) + p.parser = parser + p.CopyAll(ctx.(*DbStatementContext)) - return t.(IDistinctMethodContext) + return p } -func (s *MethodCallContext) AggregateMethod() IAggregateMethodContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IAggregateMethodContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } +func (s *GetMongoContext) GetRuleContext() antlr.RuleContext { + return s +} - if t == nil { - return nil - } +func (s *GetMongoContext) DB() antlr.TerminalNode { + return s.GetToken(MongoShellParserDB, 0) +} - return t.(IAggregateMethodContext) +func (s *GetMongoContext) DOT() antlr.TerminalNode { + return s.GetToken(MongoShellParserDOT, 0) } -func (s *MethodCallContext) GetIndexesMethod() IGetIndexesMethodContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IGetIndexesMethodContext); ok { - t = ctx.(antlr.RuleContext) - break - } +func (s *GetMongoContext) GET_MONGO() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_MONGO, 0) +} + +func (s *GetMongoContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *GetMongoContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *GetMongoContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterGetMongo(s) } +} - if t == nil { - return nil +func (s *GetMongoContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitGetMongo(s) } +} - return t.(IGetIndexesMethodContext) +func (s *GetMongoContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitGetMongo(s) + + default: + return t.VisitChildren(s) + } } -func (s *MethodCallContext) SortMethod() ISortMethodContext { +type DbStatsContext struct { + DbStatementContext +} + +func NewDbStatsContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DbStatsContext { + var p = new(DbStatsContext) + + InitEmptyDbStatementContext(&p.DbStatementContext) + p.parser = parser + p.CopyAll(ctx.(*DbStatementContext)) + + return p +} + +func (s *DbStatsContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DbStatsContext) DB() antlr.TerminalNode { + return s.GetToken(MongoShellParserDB, 0) +} + +func (s *DbStatsContext) DOT() antlr.TerminalNode { + return s.GetToken(MongoShellParserDOT, 0) +} + +func (s *DbStatsContext) STATS() antlr.TerminalNode { + return s.GetToken(MongoShellParserSTATS, 0) +} + +func (s *DbStatsContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *DbStatsContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *DbStatsContext) Argument() IArgumentContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ISortMethodContext); ok { + if _, ok := ctx.(IArgumentContext); ok { t = ctx.(antlr.RuleContext) break } @@ -2215,29 +3070,69 @@ func (s *MethodCallContext) SortMethod() ISortMethodContext { return nil } - return t.(ISortMethodContext) + return t.(IArgumentContext) } -func (s *MethodCallContext) LimitMethod() ILimitMethodContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ILimitMethodContext); ok { - t = ctx.(antlr.RuleContext) - break - } +func (s *DbStatsContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterDbStats(s) } +} - if t == nil { - return nil +func (s *DbStatsContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitDbStats(s) } +} - return t.(ILimitMethodContext) +func (s *DbStatsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitDbStats(s) + + default: + return t.VisitChildren(s) + } } -func (s *MethodCallContext) SkipMethod() ISkipMethodContext { +type RunCommandContext struct { + DbStatementContext +} + +func NewRunCommandContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *RunCommandContext { + var p = new(RunCommandContext) + + InitEmptyDbStatementContext(&p.DbStatementContext) + p.parser = parser + p.CopyAll(ctx.(*DbStatementContext)) + + return p +} + +func (s *RunCommandContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *RunCommandContext) DB() antlr.TerminalNode { + return s.GetToken(MongoShellParserDB, 0) +} + +func (s *RunCommandContext) DOT() antlr.TerminalNode { + return s.GetToken(MongoShellParserDOT, 0) +} + +func (s *RunCommandContext) RUN_COMMAND() antlr.TerminalNode { + return s.GetToken(MongoShellParserRUN_COMMAND, 0) +} + +func (s *RunCommandContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *RunCommandContext) Arguments() IArgumentsContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ISkipMethodContext); ok { + if _, ok := ctx.(IArgumentsContext); ok { t = ctx.(antlr.RuleContext) break } @@ -2247,45 +3142,133 @@ func (s *MethodCallContext) SkipMethod() ISkipMethodContext { return nil } - return t.(ISkipMethodContext) + return t.(IArgumentsContext) } -func (s *MethodCallContext) CountMethod() ICountMethodContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ICountMethodContext); ok { - t = ctx.(antlr.RuleContext) - break - } +func (s *RunCommandContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *RunCommandContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterRunCommand(s) } +} - if t == nil { - return nil +func (s *RunCommandContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitRunCommand(s) } +} - return t.(ICountMethodContext) +func (s *RunCommandContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitRunCommand(s) + + default: + return t.VisitChildren(s) + } } -func (s *MethodCallContext) ProjectionMethod() IProjectionMethodContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IProjectionMethodContext); ok { - t = ctx.(antlr.RuleContext) - break - } +type ServerBuildInfoContext struct { + DbStatementContext +} + +func NewServerBuildInfoContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ServerBuildInfoContext { + var p = new(ServerBuildInfoContext) + + InitEmptyDbStatementContext(&p.DbStatementContext) + p.parser = parser + p.CopyAll(ctx.(*DbStatementContext)) + + return p +} + +func (s *ServerBuildInfoContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ServerBuildInfoContext) DB() antlr.TerminalNode { + return s.GetToken(MongoShellParserDB, 0) +} + +func (s *ServerBuildInfoContext) DOT() antlr.TerminalNode { + return s.GetToken(MongoShellParserDOT, 0) +} + +func (s *ServerBuildInfoContext) SERVER_BUILD_INFO() antlr.TerminalNode { + return s.GetToken(MongoShellParserSERVER_BUILD_INFO, 0) +} + +func (s *ServerBuildInfoContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ServerBuildInfoContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ServerBuildInfoContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterServerBuildInfo(s) } +} - if t == nil { - return nil +func (s *ServerBuildInfoContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitServerBuildInfo(s) } +} - return t.(IProjectionMethodContext) +func (s *ServerBuildInfoContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitServerBuildInfo(s) + + default: + return t.VisitChildren(s) + } } -func (s *MethodCallContext) GenericMethod() IGenericMethodContext { +type CreateCollectionContext struct { + DbStatementContext +} + +func NewCreateCollectionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *CreateCollectionContext { + var p = new(CreateCollectionContext) + + InitEmptyDbStatementContext(&p.DbStatementContext) + p.parser = parser + p.CopyAll(ctx.(*DbStatementContext)) + + return p +} + +func (s *CreateCollectionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *CreateCollectionContext) DB() antlr.TerminalNode { + return s.GetToken(MongoShellParserDB, 0) +} + +func (s *CreateCollectionContext) DOT() antlr.TerminalNode { + return s.GetToken(MongoShellParserDOT, 0) +} + +func (s *CreateCollectionContext) CREATE_COLLECTION() antlr.TerminalNode { + return s.GetToken(MongoShellParserCREATE_COLLECTION, 0) +} + +func (s *CreateCollectionContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *CreateCollectionContext) Arguments() IArgumentsContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IGenericMethodContext); ok { + if _, ok := ctx.(IArgumentsContext); ok { t = ctx.(antlr.RuleContext) break } @@ -2295,146 +3278,17669 @@ func (s *MethodCallContext) GenericMethod() IGenericMethodContext { return nil } - return t.(IGenericMethodContext) -} - -func (s *MethodCallContext) GetRuleContext() antlr.RuleContext { - return s + return t.(IArgumentsContext) } -func (s *MethodCallContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) +func (s *CreateCollectionContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) } -func (s *MethodCallContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *CreateCollectionContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterMethodCall(s) + listenerT.EnterCreateCollection(s) } } -func (s *MethodCallContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *CreateCollectionContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitMethodCall(s) + listenerT.ExitCreateCollection(s) } } -func (s *MethodCallContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *CreateCollectionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitMethodCall(s) + return t.VisitCreateCollection(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) MethodCall() (localctx IMethodCallContext) { - localctx = NewMethodCallContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 12, MongoShellParserRULE_methodCall) - p.SetState(169) +func (p *MongoShellParser) DbStatement() (localctx IDbStatementContext) { + localctx = NewDbStatementContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 6, MongoShellParserRULE_dbStatement) + var _la int + + p.SetState(389) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 11, p.GetParserRuleContext()) { + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 18, p.GetParserRuleContext()) { case 1: + localctx = NewGetCollectionNamesContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(156) - p.FindMethod() - } - - case 2: + p.SetState(284) + p.Match(MongoShellParserDB) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(285) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(286) + p.Match(MongoShellParserGET_COLLECTION_NAMES) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(287) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(288) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(290) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == MongoShellParserDOT { + { + p.SetState(289) + p.MethodChain() + } + + } + + case 2: + localctx = NewGetCollectionInfosContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(157) - p.FindOneMethod() + p.SetState(292) + p.Match(MongoShellParserDB) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(293) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(294) + p.Match(MongoShellParserGET_COLLECTION_INFOS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(295) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(297) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(296) + p.Arguments() + } + + } + { + p.SetState(299) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(301) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == MongoShellParserDOT { + { + p.SetState(300) + p.MethodChain() + } + } case 3: + localctx = NewCreateCollectionContext(p, localctx) p.EnterOuterAlt(localctx, 3) { - p.SetState(158) - p.CountDocumentsMethod() + p.SetState(303) + p.Match(MongoShellParserDB) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(304) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(305) + p.Match(MongoShellParserCREATE_COLLECTION) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(306) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(307) + p.Arguments() + } + { + p.SetState(308) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } case 4: + localctx = NewDropDatabaseContext(p, localctx) p.EnterOuterAlt(localctx, 4) { - p.SetState(159) - p.EstimatedDocumentCountMethod() + p.SetState(310) + p.Match(MongoShellParserDB) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - - case 5: - p.EnterOuterAlt(localctx, 5) { - p.SetState(160) - p.DistinctMethod() + p.SetState(311) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - - case 6: - p.EnterOuterAlt(localctx, 6) { - p.SetState(161) - p.AggregateMethod() + p.SetState(312) + p.Match(MongoShellParserDROP_DATABASE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - - case 7: - p.EnterOuterAlt(localctx, 7) { - p.SetState(162) - p.GetIndexesMethod() + p.SetState(313) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - - case 8: - p.EnterOuterAlt(localctx, 8) { - p.SetState(163) - p.SortMethod() + p.SetState(314) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - case 9: - p.EnterOuterAlt(localctx, 9) + case 5: + localctx = NewDbStatsContext(p, localctx) + p.EnterOuterAlt(localctx, 5) { - p.SetState(164) - p.LimitMethod() + p.SetState(315) + p.Match(MongoShellParserDB) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - - case 10: - p.EnterOuterAlt(localctx, 10) { - p.SetState(165) - p.SkipMethod() + p.SetState(316) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - - case 11: - p.EnterOuterAlt(localctx, 11) { - p.SetState(166) - p.CountMethod() + p.SetState(317) + p.Match(MongoShellParserSTATS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - - case 12: - p.EnterOuterAlt(localctx, 12) { - p.SetState(167) - p.ProjectionMethod() + p.SetState(318) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(320) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit } + _la = p.GetTokenStream().LA(1) - case 13: - p.EnterOuterAlt(localctx, 13) + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(319) + p.Argument() + } + + } { - p.SetState(168) - p.GenericMethod() + p.SetState(322) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - case antlr.ATNInvalidAltNumber: - goto errorExit - } - -errorExit: - if p.HasError() { + case 6: + localctx = NewServerStatusContext(p, localctx) + p.EnterOuterAlt(localctx, 6) + { + p.SetState(323) + p.Match(MongoShellParserDB) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(324) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(325) + p.Match(MongoShellParserSERVER_STATUS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(326) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(328) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(327) + p.Argument() + } + + } + { + p.SetState(330) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 7: + localctx = NewServerBuildInfoContext(p, localctx) + p.EnterOuterAlt(localctx, 7) + { + p.SetState(331) + p.Match(MongoShellParserDB) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(332) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(333) + p.Match(MongoShellParserSERVER_BUILD_INFO) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(334) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(335) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 8: + localctx = NewDbVersionContext(p, localctx) + p.EnterOuterAlt(localctx, 8) + { + p.SetState(336) + p.Match(MongoShellParserDB) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(337) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(338) + p.Match(MongoShellParserVERSION) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(339) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(340) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 9: + localctx = NewHostInfoContext(p, localctx) + p.EnterOuterAlt(localctx, 9) + { + p.SetState(341) + p.Match(MongoShellParserDB) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(342) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(343) + p.Match(MongoShellParserHOST_INFO) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(344) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(345) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 10: + localctx = NewListCommandsContext(p, localctx) + p.EnterOuterAlt(localctx, 10) + { + p.SetState(346) + p.Match(MongoShellParserDB) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(347) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(348) + p.Match(MongoShellParserLIST_COMMANDS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(349) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(350) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 11: + localctx = NewRunCommandContext(p, localctx) + p.EnterOuterAlt(localctx, 11) + { + p.SetState(351) + p.Match(MongoShellParserDB) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(352) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(353) + p.Match(MongoShellParserRUN_COMMAND) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(354) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(355) + p.Arguments() + } + { + p.SetState(356) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 12: + localctx = NewAdminCommandContext(p, localctx) + p.EnterOuterAlt(localctx, 12) + { + p.SetState(358) + p.Match(MongoShellParserDB) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(359) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(360) + p.Match(MongoShellParserADMIN_COMMAND) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(361) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(362) + p.Arguments() + } + { + p.SetState(363) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 13: + localctx = NewGetNameContext(p, localctx) + p.EnterOuterAlt(localctx, 13) + { + p.SetState(365) + p.Match(MongoShellParserDB) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(366) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(367) + p.Match(MongoShellParserGET_NAME) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(368) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(369) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 14: + localctx = NewGetMongoContext(p, localctx) + p.EnterOuterAlt(localctx, 14) + { + p.SetState(370) + p.Match(MongoShellParserDB) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(371) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(372) + p.Match(MongoShellParserGET_MONGO) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(373) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(374) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 15: + localctx = NewGetSiblingDBContext(p, localctx) + p.EnterOuterAlt(localctx, 15) + { + p.SetState(375) + p.Match(MongoShellParserDB) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(376) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(377) + p.Match(MongoShellParserGET_SIBLING_DB) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(378) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(379) + p.Argument() + } + { + p.SetState(380) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 16: + localctx = NewDbGenericMethodContext(p, localctx) + p.EnterOuterAlt(localctx, 16) + { + p.SetState(382) + p.Match(MongoShellParserDB) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(383) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(384) + p.GenericDbMethod() + } + + case 17: + localctx = NewCollectionOperationContext(p, localctx) + p.EnterOuterAlt(localctx, 17) + { + p.SetState(385) + p.Match(MongoShellParserDB) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(386) + p.CollectionAccess() + } + { + p.SetState(387) + p.MethodChain() + } + + 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 +} + +// IGenericDbMethodContext is an interface to support dynamic dispatch. +type IGenericDbMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + Identifier() IIdentifierContext + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + Arguments() IArgumentsContext + + // IsGenericDbMethodContext differentiates from other interfaces. + IsGenericDbMethodContext() +} + +type GenericDbMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyGenericDbMethodContext() *GenericDbMethodContext { + var p = new(GenericDbMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_genericDbMethod + return p +} + +func InitEmptyGenericDbMethodContext(p *GenericDbMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_genericDbMethod +} + +func (*GenericDbMethodContext) IsGenericDbMethodContext() {} + +func NewGenericDbMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *GenericDbMethodContext { + var p = new(GenericDbMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_genericDbMethod + + return p +} + +func (s *GenericDbMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *GenericDbMethodContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *GenericDbMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *GenericDbMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *GenericDbMethodContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *GenericDbMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *GenericDbMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *GenericDbMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterGenericDbMethod(s) + } +} + +func (s *GenericDbMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitGenericDbMethod(s) + } +} + +func (s *GenericDbMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitGenericDbMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) GenericDbMethod() (localctx IGenericDbMethodContext) { + localctx = NewGenericDbMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 8, MongoShellParserRULE_genericDbMethod) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(391) + p.Identifier() + } + { + p.SetState(392) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(394) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(393) + p.Arguments() + } + + } + { + p.SetState(396) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IBulkStatementContext is an interface to support dynamic dispatch. +type IBulkStatementContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + DB() antlr.TerminalNode + CollectionAccess() ICollectionAccessContext + DOT() antlr.TerminalNode + BulkInitMethod() IBulkInitMethodContext + BulkMethodChain() IBulkMethodChainContext + + // IsBulkStatementContext differentiates from other interfaces. + IsBulkStatementContext() +} + +type BulkStatementContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyBulkStatementContext() *BulkStatementContext { + var p = new(BulkStatementContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_bulkStatement + return p +} + +func InitEmptyBulkStatementContext(p *BulkStatementContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_bulkStatement +} + +func (*BulkStatementContext) IsBulkStatementContext() {} + +func NewBulkStatementContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BulkStatementContext { + var p = new(BulkStatementContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_bulkStatement + + return p +} + +func (s *BulkStatementContext) GetParser() antlr.Parser { return s.parser } + +func (s *BulkStatementContext) DB() antlr.TerminalNode { + return s.GetToken(MongoShellParserDB, 0) +} + +func (s *BulkStatementContext) CollectionAccess() ICollectionAccessContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICollectionAccessContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ICollectionAccessContext) +} + +func (s *BulkStatementContext) DOT() antlr.TerminalNode { + return s.GetToken(MongoShellParserDOT, 0) +} + +func (s *BulkStatementContext) BulkInitMethod() IBulkInitMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IBulkInitMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IBulkInitMethodContext) +} + +func (s *BulkStatementContext) BulkMethodChain() IBulkMethodChainContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IBulkMethodChainContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IBulkMethodChainContext) +} + +func (s *BulkStatementContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *BulkStatementContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *BulkStatementContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterBulkStatement(s) + } +} + +func (s *BulkStatementContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitBulkStatement(s) + } +} + +func (s *BulkStatementContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitBulkStatement(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) BulkStatement() (localctx IBulkStatementContext) { + localctx = NewBulkStatementContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 10, MongoShellParserRULE_bulkStatement) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(398) + p.Match(MongoShellParserDB) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(399) + p.CollectionAccess() + } + { + p.SetState(400) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(401) + p.BulkInitMethod() + } + p.SetState(403) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == MongoShellParserDOT { + { + p.SetState(402) + p.BulkMethodChain() + } + + } + +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 +} + +// IBulkInitMethodContext is an interface to support dynamic dispatch. +type IBulkInitMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + INITIALIZE_ORDERED_BULK_OP() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + INITIALIZE_UNORDERED_BULK_OP() antlr.TerminalNode + + // IsBulkInitMethodContext differentiates from other interfaces. + IsBulkInitMethodContext() +} + +type BulkInitMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyBulkInitMethodContext() *BulkInitMethodContext { + var p = new(BulkInitMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_bulkInitMethod + return p +} + +func InitEmptyBulkInitMethodContext(p *BulkInitMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_bulkInitMethod +} + +func (*BulkInitMethodContext) IsBulkInitMethodContext() {} + +func NewBulkInitMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BulkInitMethodContext { + var p = new(BulkInitMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_bulkInitMethod + + return p +} + +func (s *BulkInitMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *BulkInitMethodContext) INITIALIZE_ORDERED_BULK_OP() antlr.TerminalNode { + return s.GetToken(MongoShellParserINITIALIZE_ORDERED_BULK_OP, 0) +} + +func (s *BulkInitMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *BulkInitMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *BulkInitMethodContext) INITIALIZE_UNORDERED_BULK_OP() antlr.TerminalNode { + return s.GetToken(MongoShellParserINITIALIZE_UNORDERED_BULK_OP, 0) +} + +func (s *BulkInitMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *BulkInitMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *BulkInitMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterBulkInitMethod(s) + } +} + +func (s *BulkInitMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitBulkInitMethod(s) + } +} + +func (s *BulkInitMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitBulkInitMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) BulkInitMethod() (localctx IBulkInitMethodContext) { + localctx = NewBulkInitMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 12, MongoShellParserRULE_bulkInitMethod) + p.SetState(411) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case MongoShellParserINITIALIZE_ORDERED_BULK_OP: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(405) + p.Match(MongoShellParserINITIALIZE_ORDERED_BULK_OP) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(406) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(407) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case MongoShellParserINITIALIZE_UNORDERED_BULK_OP: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(408) + p.Match(MongoShellParserINITIALIZE_UNORDERED_BULK_OP) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(409) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(410) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + default: + 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 +} + +// IBulkMethodChainContext is an interface to support dynamic dispatch. +type IBulkMethodChainContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + AllDOT() []antlr.TerminalNode + DOT(i int) antlr.TerminalNode + AllBulkMethod() []IBulkMethodContext + BulkMethod(i int) IBulkMethodContext + + // IsBulkMethodChainContext differentiates from other interfaces. + IsBulkMethodChainContext() +} + +type BulkMethodChainContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyBulkMethodChainContext() *BulkMethodChainContext { + var p = new(BulkMethodChainContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_bulkMethodChain + return p +} + +func InitEmptyBulkMethodChainContext(p *BulkMethodChainContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_bulkMethodChain +} + +func (*BulkMethodChainContext) IsBulkMethodChainContext() {} + +func NewBulkMethodChainContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BulkMethodChainContext { + var p = new(BulkMethodChainContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_bulkMethodChain + + return p +} + +func (s *BulkMethodChainContext) GetParser() antlr.Parser { return s.parser } + +func (s *BulkMethodChainContext) AllDOT() []antlr.TerminalNode { + return s.GetTokens(MongoShellParserDOT) +} + +func (s *BulkMethodChainContext) DOT(i int) antlr.TerminalNode { + return s.GetToken(MongoShellParserDOT, i) +} + +func (s *BulkMethodChainContext) AllBulkMethod() []IBulkMethodContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IBulkMethodContext); ok { + len++ + } + } + + tst := make([]IBulkMethodContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IBulkMethodContext); ok { + tst[i] = t.(IBulkMethodContext) + i++ + } + } + + return tst +} + +func (s *BulkMethodChainContext) BulkMethod(i int) IBulkMethodContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IBulkMethodContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IBulkMethodContext) +} + +func (s *BulkMethodChainContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *BulkMethodChainContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *BulkMethodChainContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterBulkMethodChain(s) + } +} + +func (s *BulkMethodChainContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitBulkMethodChain(s) + } +} + +func (s *BulkMethodChainContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitBulkMethodChain(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) BulkMethodChain() (localctx IBulkMethodChainContext) { + localctx = NewBulkMethodChainContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 14, MongoShellParserRULE_bulkMethodChain) + var _la int + + p.EnterOuterAlt(localctx, 1) + p.SetState(415) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for ok := true; ok; ok = _la == MongoShellParserDOT { + { + p.SetState(413) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(414) + p.BulkMethod() + } + + p.SetState(417) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IBulkMethodContext is an interface to support dynamic dispatch. +type IBulkMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsBulkMethodContext differentiates from other interfaces. + IsBulkMethodContext() +} + +type BulkMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyBulkMethodContext() *BulkMethodContext { + var p = new(BulkMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_bulkMethod + return p +} + +func InitEmptyBulkMethodContext(p *BulkMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_bulkMethod +} + +func (*BulkMethodContext) IsBulkMethodContext() {} + +func NewBulkMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BulkMethodContext { + var p = new(BulkMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_bulkMethod + + return p +} + +func (s *BulkMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *BulkMethodContext) CopyAll(ctx *BulkMethodContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *BulkMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *BulkMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type BulkToStringContext struct { + BulkMethodContext +} + +func NewBulkToStringContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BulkToStringContext { + var p = new(BulkToStringContext) + + InitEmptyBulkMethodContext(&p.BulkMethodContext) + p.parser = parser + p.CopyAll(ctx.(*BulkMethodContext)) + + return p +} + +func (s *BulkToStringContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *BulkToStringContext) TO_STRING() antlr.TerminalNode { + return s.GetToken(MongoShellParserTO_STRING, 0) +} + +func (s *BulkToStringContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *BulkToStringContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *BulkToStringContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterBulkToString(s) + } +} + +func (s *BulkToStringContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitBulkToString(s) + } +} + +func (s *BulkToStringContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitBulkToString(s) + + default: + return t.VisitChildren(s) + } +} + +type BulkGetOperationsContext struct { + BulkMethodContext +} + +func NewBulkGetOperationsContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BulkGetOperationsContext { + var p = new(BulkGetOperationsContext) + + InitEmptyBulkMethodContext(&p.BulkMethodContext) + p.parser = parser + p.CopyAll(ctx.(*BulkMethodContext)) + + return p +} + +func (s *BulkGetOperationsContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *BulkGetOperationsContext) GET_OPERATIONS() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_OPERATIONS, 0) +} + +func (s *BulkGetOperationsContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *BulkGetOperationsContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *BulkGetOperationsContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterBulkGetOperations(s) + } +} + +func (s *BulkGetOperationsContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitBulkGetOperations(s) + } +} + +func (s *BulkGetOperationsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitBulkGetOperations(s) + + default: + return t.VisitChildren(s) + } +} + +type BulkFindContext struct { + BulkMethodContext +} + +func NewBulkFindContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BulkFindContext { + var p = new(BulkFindContext) + + InitEmptyBulkMethodContext(&p.BulkMethodContext) + p.parser = parser + p.CopyAll(ctx.(*BulkMethodContext)) + + return p +} + +func (s *BulkFindContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *BulkFindContext) FIND() antlr.TerminalNode { + return s.GetToken(MongoShellParserFIND, 0) +} + +func (s *BulkFindContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *BulkFindContext) Argument() IArgumentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentContext) +} + +func (s *BulkFindContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *BulkFindContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterBulkFind(s) + } +} + +func (s *BulkFindContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitBulkFind(s) + } +} + +func (s *BulkFindContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitBulkFind(s) + + default: + return t.VisitChildren(s) + } +} + +type BulkInsertContext struct { + BulkMethodContext +} + +func NewBulkInsertContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BulkInsertContext { + var p = new(BulkInsertContext) + + InitEmptyBulkMethodContext(&p.BulkMethodContext) + p.parser = parser + p.CopyAll(ctx.(*BulkMethodContext)) + + return p +} + +func (s *BulkInsertContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *BulkInsertContext) INSERT() antlr.TerminalNode { + return s.GetToken(MongoShellParserINSERT, 0) +} + +func (s *BulkInsertContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *BulkInsertContext) Argument() IArgumentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentContext) +} + +func (s *BulkInsertContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *BulkInsertContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterBulkInsert(s) + } +} + +func (s *BulkInsertContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitBulkInsert(s) + } +} + +func (s *BulkInsertContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitBulkInsert(s) + + default: + return t.VisitChildren(s) + } +} + +type BulkExecuteContext struct { + BulkMethodContext +} + +func NewBulkExecuteContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BulkExecuteContext { + var p = new(BulkExecuteContext) + + InitEmptyBulkMethodContext(&p.BulkMethodContext) + p.parser = parser + p.CopyAll(ctx.(*BulkMethodContext)) + + return p +} + +func (s *BulkExecuteContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *BulkExecuteContext) EXECUTE() antlr.TerminalNode { + return s.GetToken(MongoShellParserEXECUTE, 0) +} + +func (s *BulkExecuteContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *BulkExecuteContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *BulkExecuteContext) Argument() IArgumentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentContext) +} + +func (s *BulkExecuteContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterBulkExecute(s) + } +} + +func (s *BulkExecuteContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitBulkExecute(s) + } +} + +func (s *BulkExecuteContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitBulkExecute(s) + + default: + return t.VisitChildren(s) + } +} + +type BulkRemoveContext struct { + BulkMethodContext +} + +func NewBulkRemoveContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BulkRemoveContext { + var p = new(BulkRemoveContext) + + InitEmptyBulkMethodContext(&p.BulkMethodContext) + p.parser = parser + p.CopyAll(ctx.(*BulkMethodContext)) + + return p +} + +func (s *BulkRemoveContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *BulkRemoveContext) REMOVE() antlr.TerminalNode { + return s.GetToken(MongoShellParserREMOVE, 0) +} + +func (s *BulkRemoveContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *BulkRemoveContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *BulkRemoveContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterBulkRemove(s) + } +} + +func (s *BulkRemoveContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitBulkRemove(s) + } +} + +func (s *BulkRemoveContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitBulkRemove(s) + + default: + return t.VisitChildren(s) + } +} + +type BulkGenericMethodContext struct { + BulkMethodContext +} + +func NewBulkGenericMethodContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BulkGenericMethodContext { + var p = new(BulkGenericMethodContext) + + InitEmptyBulkMethodContext(&p.BulkMethodContext) + p.parser = parser + p.CopyAll(ctx.(*BulkMethodContext)) + + return p +} + +func (s *BulkGenericMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *BulkGenericMethodContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *BulkGenericMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *BulkGenericMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *BulkGenericMethodContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *BulkGenericMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterBulkGenericMethod(s) + } +} + +func (s *BulkGenericMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitBulkGenericMethod(s) + } +} + +func (s *BulkGenericMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitBulkGenericMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) BulkMethod() (localctx IBulkMethodContext) { + localctx = NewBulkMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 16, MongoShellParserRULE_bulkMethod) + var _la int + + p.SetState(451) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 25, p.GetParserRuleContext()) { + case 1: + localctx = NewBulkFindContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(419) + p.Match(MongoShellParserFIND) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(420) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(421) + p.Argument() + } + { + p.SetState(422) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 2: + localctx = NewBulkInsertContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(424) + p.Match(MongoShellParserINSERT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(425) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(426) + p.Argument() + } + { + p.SetState(427) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 3: + localctx = NewBulkRemoveContext(p, localctx) + p.EnterOuterAlt(localctx, 3) + { + p.SetState(429) + p.Match(MongoShellParserREMOVE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(430) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(431) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 4: + localctx = NewBulkExecuteContext(p, localctx) + p.EnterOuterAlt(localctx, 4) + { + p.SetState(432) + p.Match(MongoShellParserEXECUTE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(433) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(435) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(434) + p.Argument() + } + + } + { + p.SetState(437) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 5: + localctx = NewBulkGetOperationsContext(p, localctx) + p.EnterOuterAlt(localctx, 5) + { + p.SetState(438) + p.Match(MongoShellParserGET_OPERATIONS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(439) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(440) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 6: + localctx = NewBulkToStringContext(p, localctx) + p.EnterOuterAlt(localctx, 6) + { + p.SetState(441) + p.Match(MongoShellParserTO_STRING) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(442) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(443) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 7: + localctx = NewBulkGenericMethodContext(p, localctx) + p.EnterOuterAlt(localctx, 7) + { + p.SetState(444) + p.Identifier() + } + { + p.SetState(445) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(447) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(446) + p.Arguments() + } + + } + { + p.SetState(449) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + 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 +} + +// IConnectionStatementContext is an interface to support dynamic dispatch. +type IConnectionStatementContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsConnectionStatementContext differentiates from other interfaces. + IsConnectionStatementContext() +} + +type ConnectionStatementContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyConnectionStatementContext() *ConnectionStatementContext { + var p = new(ConnectionStatementContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_connectionStatement + return p +} + +func InitEmptyConnectionStatementContext(p *ConnectionStatementContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_connectionStatement +} + +func (*ConnectionStatementContext) IsConnectionStatementContext() {} + +func NewConnectionStatementContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ConnectionStatementContext { + var p = new(ConnectionStatementContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_connectionStatement + + return p +} + +func (s *ConnectionStatementContext) GetParser() antlr.Parser { return s.parser } + +func (s *ConnectionStatementContext) CopyAll(ctx *ConnectionStatementContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *ConnectionStatementContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ConnectionStatementContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type ConnectCallContext struct { + ConnectionStatementContext +} + +func NewConnectCallContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ConnectCallContext { + var p = new(ConnectCallContext) + + InitEmptyConnectionStatementContext(&p.ConnectionStatementContext) + p.parser = parser + p.CopyAll(ctx.(*ConnectionStatementContext)) + + return p +} + +func (s *ConnectCallContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ConnectCallContext) CONNECT() antlr.TerminalNode { + return s.GetToken(MongoShellParserCONNECT, 0) +} + +func (s *ConnectCallContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ConnectCallContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ConnectCallContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *ConnectCallContext) ConnectionMethodChain() IConnectionMethodChainContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IConnectionMethodChainContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IConnectionMethodChainContext) +} + +func (s *ConnectCallContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterConnectCall(s) + } +} + +func (s *ConnectCallContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitConnectCall(s) + } +} + +func (s *ConnectCallContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitConnectCall(s) + + default: + return t.VisitChildren(s) + } +} + +type MongoConnectionContext struct { + ConnectionStatementContext +} + +func NewMongoConnectionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *MongoConnectionContext { + var p = new(MongoConnectionContext) + + InitEmptyConnectionStatementContext(&p.ConnectionStatementContext) + p.parser = parser + p.CopyAll(ctx.(*ConnectionStatementContext)) + + return p +} + +func (s *MongoConnectionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *MongoConnectionContext) MONGO() antlr.TerminalNode { + return s.GetToken(MongoShellParserMONGO, 0) +} + +func (s *MongoConnectionContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *MongoConnectionContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *MongoConnectionContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *MongoConnectionContext) ConnectionMethodChain() IConnectionMethodChainContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IConnectionMethodChainContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IConnectionMethodChainContext) +} + +func (s *MongoConnectionContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterMongoConnection(s) + } +} + +func (s *MongoConnectionContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitMongoConnection(s) + } +} + +func (s *MongoConnectionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitMongoConnection(s) + + default: + return t.VisitChildren(s) + } +} + +type DbGetMongoChainContext struct { + ConnectionStatementContext +} + +func NewDbGetMongoChainContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DbGetMongoChainContext { + var p = new(DbGetMongoChainContext) + + InitEmptyConnectionStatementContext(&p.ConnectionStatementContext) + p.parser = parser + p.CopyAll(ctx.(*ConnectionStatementContext)) + + return p +} + +func (s *DbGetMongoChainContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DbGetMongoChainContext) DB() antlr.TerminalNode { + return s.GetToken(MongoShellParserDB, 0) +} + +func (s *DbGetMongoChainContext) DOT() antlr.TerminalNode { + return s.GetToken(MongoShellParserDOT, 0) +} + +func (s *DbGetMongoChainContext) GET_MONGO() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_MONGO, 0) +} + +func (s *DbGetMongoChainContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *DbGetMongoChainContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *DbGetMongoChainContext) ConnectionMethodChain() IConnectionMethodChainContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IConnectionMethodChainContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IConnectionMethodChainContext) +} + +func (s *DbGetMongoChainContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterDbGetMongoChain(s) + } +} + +func (s *DbGetMongoChainContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitDbGetMongoChain(s) + } +} + +func (s *DbGetMongoChainContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitDbGetMongoChain(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) ConnectionStatement() (localctx IConnectionStatementContext) { + localctx = NewConnectionStatementContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 18, MongoShellParserRULE_connectionStatement) + var _la int + + p.SetState(477) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case MongoShellParserMONGO: + localctx = NewMongoConnectionContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(453) + p.Match(MongoShellParserMONGO) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(454) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(456) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(455) + p.Arguments() + } + + } + { + p.SetState(458) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(460) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == MongoShellParserDOT { + { + p.SetState(459) + p.ConnectionMethodChain() + } + + } + + case MongoShellParserCONNECT: + localctx = NewConnectCallContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(462) + p.Match(MongoShellParserCONNECT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(463) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(465) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(464) + p.Arguments() + } + + } + { + p.SetState(467) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(469) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == MongoShellParserDOT { + { + p.SetState(468) + p.ConnectionMethodChain() + } + + } + + case MongoShellParserDB: + localctx = NewDbGetMongoChainContext(p, localctx) + p.EnterOuterAlt(localctx, 3) + { + p.SetState(471) + p.Match(MongoShellParserDB) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(472) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(473) + p.Match(MongoShellParserGET_MONGO) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(474) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(475) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(476) + p.ConnectionMethodChain() + } + + default: + 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 +} + +// IConnectionMethodChainContext is an interface to support dynamic dispatch. +type IConnectionMethodChainContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + AllDOT() []antlr.TerminalNode + DOT(i int) antlr.TerminalNode + AllConnectionMethod() []IConnectionMethodContext + ConnectionMethod(i int) IConnectionMethodContext + + // IsConnectionMethodChainContext differentiates from other interfaces. + IsConnectionMethodChainContext() +} + +type ConnectionMethodChainContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyConnectionMethodChainContext() *ConnectionMethodChainContext { + var p = new(ConnectionMethodChainContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_connectionMethodChain + return p +} + +func InitEmptyConnectionMethodChainContext(p *ConnectionMethodChainContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_connectionMethodChain +} + +func (*ConnectionMethodChainContext) IsConnectionMethodChainContext() {} + +func NewConnectionMethodChainContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ConnectionMethodChainContext { + var p = new(ConnectionMethodChainContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_connectionMethodChain + + return p +} + +func (s *ConnectionMethodChainContext) GetParser() antlr.Parser { return s.parser } + +func (s *ConnectionMethodChainContext) AllDOT() []antlr.TerminalNode { + return s.GetTokens(MongoShellParserDOT) +} + +func (s *ConnectionMethodChainContext) DOT(i int) antlr.TerminalNode { + return s.GetToken(MongoShellParserDOT, i) +} + +func (s *ConnectionMethodChainContext) AllConnectionMethod() []IConnectionMethodContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IConnectionMethodContext); ok { + len++ + } + } + + tst := make([]IConnectionMethodContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IConnectionMethodContext); ok { + tst[i] = t.(IConnectionMethodContext) + i++ + } + } + + return tst +} + +func (s *ConnectionMethodChainContext) ConnectionMethod(i int) IConnectionMethodContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IConnectionMethodContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IConnectionMethodContext) +} + +func (s *ConnectionMethodChainContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ConnectionMethodChainContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ConnectionMethodChainContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterConnectionMethodChain(s) + } +} + +func (s *ConnectionMethodChainContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitConnectionMethodChain(s) + } +} + +func (s *ConnectionMethodChainContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitConnectionMethodChain(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) ConnectionMethodChain() (localctx IConnectionMethodChainContext) { + localctx = NewConnectionMethodChainContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 20, MongoShellParserRULE_connectionMethodChain) + var _la int + + p.EnterOuterAlt(localctx, 1) + p.SetState(481) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for ok := true; ok; ok = _la == MongoShellParserDOT { + { + p.SetState(479) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(480) + p.ConnectionMethod() + } + + p.SetState(483) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IRsStatementContext is an interface to support dynamic dispatch. +type IRsStatementContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + RS() antlr.TerminalNode + DOT() antlr.TerminalNode + Identifier() IIdentifierContext + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + Arguments() IArgumentsContext + + // IsRsStatementContext differentiates from other interfaces. + IsRsStatementContext() +} + +type RsStatementContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyRsStatementContext() *RsStatementContext { + var p = new(RsStatementContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_rsStatement + return p +} + +func InitEmptyRsStatementContext(p *RsStatementContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_rsStatement +} + +func (*RsStatementContext) IsRsStatementContext() {} + +func NewRsStatementContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *RsStatementContext { + var p = new(RsStatementContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_rsStatement + + return p +} + +func (s *RsStatementContext) GetParser() antlr.Parser { return s.parser } + +func (s *RsStatementContext) RS() antlr.TerminalNode { + return s.GetToken(MongoShellParserRS, 0) +} + +func (s *RsStatementContext) DOT() antlr.TerminalNode { + return s.GetToken(MongoShellParserDOT, 0) +} + +func (s *RsStatementContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *RsStatementContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *RsStatementContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *RsStatementContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *RsStatementContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *RsStatementContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *RsStatementContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterRsStatement(s) + } +} + +func (s *RsStatementContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitRsStatement(s) + } +} + +func (s *RsStatementContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitRsStatement(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) RsStatement() (localctx IRsStatementContext) { + localctx = NewRsStatementContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 22, MongoShellParserRULE_rsStatement) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(485) + p.Match(MongoShellParserRS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(486) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(487) + p.Identifier() + } + { + p.SetState(488) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(490) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(489) + p.Arguments() + } + + } + { + p.SetState(492) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IShStatementContext is an interface to support dynamic dispatch. +type IShStatementContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + SH() antlr.TerminalNode + DOT() antlr.TerminalNode + Identifier() IIdentifierContext + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + Arguments() IArgumentsContext + + // IsShStatementContext differentiates from other interfaces. + IsShStatementContext() +} + +type ShStatementContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyShStatementContext() *ShStatementContext { + var p = new(ShStatementContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_shStatement + return p +} + +func InitEmptyShStatementContext(p *ShStatementContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_shStatement +} + +func (*ShStatementContext) IsShStatementContext() {} + +func NewShStatementContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ShStatementContext { + var p = new(ShStatementContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_shStatement + + return p +} + +func (s *ShStatementContext) GetParser() antlr.Parser { return s.parser } + +func (s *ShStatementContext) SH() antlr.TerminalNode { + return s.GetToken(MongoShellParserSH, 0) +} + +func (s *ShStatementContext) DOT() antlr.TerminalNode { + return s.GetToken(MongoShellParserDOT, 0) +} + +func (s *ShStatementContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *ShStatementContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ShStatementContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ShStatementContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *ShStatementContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ShStatementContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ShStatementContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterShStatement(s) + } +} + +func (s *ShStatementContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitShStatement(s) + } +} + +func (s *ShStatementContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitShStatement(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) ShStatement() (localctx IShStatementContext) { + localctx = NewShStatementContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 24, MongoShellParserRULE_shStatement) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(494) + p.Match(MongoShellParserSH) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(495) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(496) + p.Identifier() + } + { + p.SetState(497) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(499) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(498) + p.Arguments() + } + + } + { + p.SetState(501) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IEncryptionStatementContext is an interface to support dynamic dispatch. +type IEncryptionStatementContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsEncryptionStatementContext differentiates from other interfaces. + IsEncryptionStatementContext() +} + +type EncryptionStatementContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyEncryptionStatementContext() *EncryptionStatementContext { + var p = new(EncryptionStatementContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_encryptionStatement + return p +} + +func InitEmptyEncryptionStatementContext(p *EncryptionStatementContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_encryptionStatement +} + +func (*EncryptionStatementContext) IsEncryptionStatementContext() {} + +func NewEncryptionStatementContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *EncryptionStatementContext { + var p = new(EncryptionStatementContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_encryptionStatement + + return p +} + +func (s *EncryptionStatementContext) GetParser() antlr.Parser { return s.parser } + +func (s *EncryptionStatementContext) CopyAll(ctx *EncryptionStatementContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *EncryptionStatementContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *EncryptionStatementContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type KeyVaultStatementContext struct { + EncryptionStatementContext +} + +func NewKeyVaultStatementContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *KeyVaultStatementContext { + var p = new(KeyVaultStatementContext) + + InitEmptyEncryptionStatementContext(&p.EncryptionStatementContext) + p.parser = parser + p.CopyAll(ctx.(*EncryptionStatementContext)) + + return p +} + +func (s *KeyVaultStatementContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *KeyVaultStatementContext) DB() antlr.TerminalNode { + return s.GetToken(MongoShellParserDB, 0) +} + +func (s *KeyVaultStatementContext) AllDOT() []antlr.TerminalNode { + return s.GetTokens(MongoShellParserDOT) +} + +func (s *KeyVaultStatementContext) DOT(i int) antlr.TerminalNode { + return s.GetToken(MongoShellParserDOT, i) +} + +func (s *KeyVaultStatementContext) GET_MONGO() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_MONGO, 0) +} + +func (s *KeyVaultStatementContext) AllLPAREN() []antlr.TerminalNode { + return s.GetTokens(MongoShellParserLPAREN) +} + +func (s *KeyVaultStatementContext) LPAREN(i int) antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, i) +} + +func (s *KeyVaultStatementContext) AllRPAREN() []antlr.TerminalNode { + return s.GetTokens(MongoShellParserRPAREN) +} + +func (s *KeyVaultStatementContext) RPAREN(i int) antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, i) +} + +func (s *KeyVaultStatementContext) GET_KEY_VAULT() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_KEY_VAULT, 0) +} + +func (s *KeyVaultStatementContext) AllIdentifier() []IIdentifierContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IIdentifierContext); ok { + len++ + } + } + + tst := make([]IIdentifierContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IIdentifierContext); ok { + tst[i] = t.(IIdentifierContext) + i++ + } + } + + return tst +} + +func (s *KeyVaultStatementContext) Identifier(i int) IIdentifierContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *KeyVaultStatementContext) AllArguments() []IArgumentsContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IArgumentsContext); ok { + len++ + } + } + + tst := make([]IArgumentsContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IArgumentsContext); ok { + tst[i] = t.(IArgumentsContext) + i++ + } + } + + return tst +} + +func (s *KeyVaultStatementContext) Arguments(i int) IArgumentsContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *KeyVaultStatementContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterKeyVaultStatement(s) + } +} + +func (s *KeyVaultStatementContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitKeyVaultStatement(s) + } +} + +func (s *KeyVaultStatementContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitKeyVaultStatement(s) + + default: + return t.VisitChildren(s) + } +} + +type ClientEncryptionStatementContext struct { + EncryptionStatementContext +} + +func NewClientEncryptionStatementContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ClientEncryptionStatementContext { + var p = new(ClientEncryptionStatementContext) + + InitEmptyEncryptionStatementContext(&p.EncryptionStatementContext) + p.parser = parser + p.CopyAll(ctx.(*EncryptionStatementContext)) + + return p +} + +func (s *ClientEncryptionStatementContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ClientEncryptionStatementContext) DB() antlr.TerminalNode { + return s.GetToken(MongoShellParserDB, 0) +} + +func (s *ClientEncryptionStatementContext) AllDOT() []antlr.TerminalNode { + return s.GetTokens(MongoShellParserDOT) +} + +func (s *ClientEncryptionStatementContext) DOT(i int) antlr.TerminalNode { + return s.GetToken(MongoShellParserDOT, i) +} + +func (s *ClientEncryptionStatementContext) GET_MONGO() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_MONGO, 0) +} + +func (s *ClientEncryptionStatementContext) AllLPAREN() []antlr.TerminalNode { + return s.GetTokens(MongoShellParserLPAREN) +} + +func (s *ClientEncryptionStatementContext) LPAREN(i int) antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, i) +} + +func (s *ClientEncryptionStatementContext) AllRPAREN() []antlr.TerminalNode { + return s.GetTokens(MongoShellParserRPAREN) +} + +func (s *ClientEncryptionStatementContext) RPAREN(i int) antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, i) +} + +func (s *ClientEncryptionStatementContext) GET_CLIENT_ENCRYPTION() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_CLIENT_ENCRYPTION, 0) +} + +func (s *ClientEncryptionStatementContext) AllIdentifier() []IIdentifierContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IIdentifierContext); ok { + len++ + } + } + + tst := make([]IIdentifierContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IIdentifierContext); ok { + tst[i] = t.(IIdentifierContext) + i++ + } + } + + return tst +} + +func (s *ClientEncryptionStatementContext) Identifier(i int) IIdentifierContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *ClientEncryptionStatementContext) AllArguments() []IArgumentsContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IArgumentsContext); ok { + len++ + } + } + + tst := make([]IArgumentsContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IArgumentsContext); ok { + tst[i] = t.(IArgumentsContext) + i++ + } + } + + return tst +} + +func (s *ClientEncryptionStatementContext) Arguments(i int) IArgumentsContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *ClientEncryptionStatementContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterClientEncryptionStatement(s) + } +} + +func (s *ClientEncryptionStatementContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitClientEncryptionStatement(s) + } +} + +func (s *ClientEncryptionStatementContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitClientEncryptionStatement(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) EncryptionStatement() (localctx IEncryptionStatementContext) { + localctx = NewEncryptionStatementContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 26, MongoShellParserRULE_encryptionStatement) + var _la int + + p.SetState(547) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 38, p.GetParserRuleContext()) { + case 1: + localctx = NewKeyVaultStatementContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(503) + p.Match(MongoShellParserDB) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(504) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(505) + p.Match(MongoShellParserGET_MONGO) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(506) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(507) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(508) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(509) + p.Match(MongoShellParserGET_KEY_VAULT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(510) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(511) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(522) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == MongoShellParserDOT { + { + p.SetState(512) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(513) + p.Identifier() + } + { + p.SetState(514) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(516) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(515) + p.Arguments() + } + + } + { + p.SetState(518) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + p.SetState(524) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + + case 2: + localctx = NewClientEncryptionStatementContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(525) + p.Match(MongoShellParserDB) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(526) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(527) + p.Match(MongoShellParserGET_MONGO) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(528) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(529) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(530) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(531) + p.Match(MongoShellParserGET_CLIENT_ENCRYPTION) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(532) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(533) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(544) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == MongoShellParserDOT { + { + p.SetState(534) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(535) + p.Identifier() + } + { + p.SetState(536) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(538) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(537) + p.Arguments() + } + + } + { + p.SetState(540) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + p.SetState(546) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + + 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 +} + +// IPlanCacheStatementContext is an interface to support dynamic dispatch. +type IPlanCacheStatementContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + DB() antlr.TerminalNode + CollectionAccess() ICollectionAccessContext + AllDOT() []antlr.TerminalNode + DOT(i int) antlr.TerminalNode + GET_PLAN_CACHE() antlr.TerminalNode + AllLPAREN() []antlr.TerminalNode + LPAREN(i int) antlr.TerminalNode + AllRPAREN() []antlr.TerminalNode + RPAREN(i int) antlr.TerminalNode + AllIdentifier() []IIdentifierContext + Identifier(i int) IIdentifierContext + AllArguments() []IArgumentsContext + Arguments(i int) IArgumentsContext + + // IsPlanCacheStatementContext differentiates from other interfaces. + IsPlanCacheStatementContext() +} + +type PlanCacheStatementContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyPlanCacheStatementContext() *PlanCacheStatementContext { + var p = new(PlanCacheStatementContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_planCacheStatement + return p +} + +func InitEmptyPlanCacheStatementContext(p *PlanCacheStatementContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_planCacheStatement +} + +func (*PlanCacheStatementContext) IsPlanCacheStatementContext() {} + +func NewPlanCacheStatementContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PlanCacheStatementContext { + var p = new(PlanCacheStatementContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_planCacheStatement + + return p +} + +func (s *PlanCacheStatementContext) GetParser() antlr.Parser { return s.parser } + +func (s *PlanCacheStatementContext) DB() antlr.TerminalNode { + return s.GetToken(MongoShellParserDB, 0) +} + +func (s *PlanCacheStatementContext) CollectionAccess() ICollectionAccessContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICollectionAccessContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ICollectionAccessContext) +} + +func (s *PlanCacheStatementContext) AllDOT() []antlr.TerminalNode { + return s.GetTokens(MongoShellParserDOT) +} + +func (s *PlanCacheStatementContext) DOT(i int) antlr.TerminalNode { + return s.GetToken(MongoShellParserDOT, i) +} + +func (s *PlanCacheStatementContext) GET_PLAN_CACHE() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_PLAN_CACHE, 0) +} + +func (s *PlanCacheStatementContext) AllLPAREN() []antlr.TerminalNode { + return s.GetTokens(MongoShellParserLPAREN) +} + +func (s *PlanCacheStatementContext) LPAREN(i int) antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, i) +} + +func (s *PlanCacheStatementContext) AllRPAREN() []antlr.TerminalNode { + return s.GetTokens(MongoShellParserRPAREN) +} + +func (s *PlanCacheStatementContext) RPAREN(i int) antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, i) +} + +func (s *PlanCacheStatementContext) AllIdentifier() []IIdentifierContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IIdentifierContext); ok { + len++ + } + } + + tst := make([]IIdentifierContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IIdentifierContext); ok { + tst[i] = t.(IIdentifierContext) + i++ + } + } + + return tst +} + +func (s *PlanCacheStatementContext) Identifier(i int) IIdentifierContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *PlanCacheStatementContext) AllArguments() []IArgumentsContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IArgumentsContext); ok { + len++ + } + } + + tst := make([]IArgumentsContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IArgumentsContext); ok { + tst[i] = t.(IArgumentsContext) + i++ + } + } + + return tst +} + +func (s *PlanCacheStatementContext) Arguments(i int) IArgumentsContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *PlanCacheStatementContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PlanCacheStatementContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *PlanCacheStatementContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterPlanCacheStatement(s) + } +} + +func (s *PlanCacheStatementContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitPlanCacheStatement(s) + } +} + +func (s *PlanCacheStatementContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitPlanCacheStatement(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) PlanCacheStatement() (localctx IPlanCacheStatementContext) { + localctx = NewPlanCacheStatementContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 28, MongoShellParserRULE_planCacheStatement) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(549) + p.Match(MongoShellParserDB) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(550) + p.CollectionAccess() + } + { + p.SetState(551) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(552) + p.Match(MongoShellParserGET_PLAN_CACHE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(553) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(554) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(565) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == MongoShellParserDOT { + { + p.SetState(555) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(556) + p.Identifier() + } + { + p.SetState(557) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(559) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(558) + p.Arguments() + } + + } + { + p.SetState(561) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + p.SetState(567) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// ISpStatementContext is an interface to support dynamic dispatch. +type ISpStatementContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + SP() antlr.TerminalNode + AllDOT() []antlr.TerminalNode + DOT(i int) antlr.TerminalNode + AllIdentifier() []IIdentifierContext + Identifier(i int) IIdentifierContext + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + Arguments() IArgumentsContext + + // IsSpStatementContext differentiates from other interfaces. + IsSpStatementContext() +} + +type SpStatementContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptySpStatementContext() *SpStatementContext { + var p = new(SpStatementContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_spStatement + return p +} + +func InitEmptySpStatementContext(p *SpStatementContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_spStatement +} + +func (*SpStatementContext) IsSpStatementContext() {} + +func NewSpStatementContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SpStatementContext { + var p = new(SpStatementContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_spStatement + + return p +} + +func (s *SpStatementContext) GetParser() antlr.Parser { return s.parser } + +func (s *SpStatementContext) SP() antlr.TerminalNode { + return s.GetToken(MongoShellParserSP, 0) +} + +func (s *SpStatementContext) AllDOT() []antlr.TerminalNode { + return s.GetTokens(MongoShellParserDOT) +} + +func (s *SpStatementContext) DOT(i int) antlr.TerminalNode { + return s.GetToken(MongoShellParserDOT, i) +} + +func (s *SpStatementContext) AllIdentifier() []IIdentifierContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IIdentifierContext); ok { + len++ + } + } + + tst := make([]IIdentifierContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IIdentifierContext); ok { + tst[i] = t.(IIdentifierContext) + i++ + } + } + + return tst +} + +func (s *SpStatementContext) Identifier(i int) IIdentifierContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *SpStatementContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *SpStatementContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *SpStatementContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *SpStatementContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *SpStatementContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *SpStatementContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterSpStatement(s) + } +} + +func (s *SpStatementContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitSpStatement(s) + } +} + +func (s *SpStatementContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitSpStatement(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) SpStatement() (localctx ISpStatementContext) { + localctx = NewSpStatementContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 30, MongoShellParserRULE_spStatement) + var _la int + + p.SetState(588) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 43, p.GetParserRuleContext()) { + case 1: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(568) + p.Match(MongoShellParserSP) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(569) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(570) + p.Identifier() + } + { + p.SetState(571) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(573) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(572) + p.Arguments() + } + + } + { + p.SetState(575) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 2: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(577) + p.Match(MongoShellParserSP) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(578) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(579) + p.Identifier() + } + { + p.SetState(580) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(581) + p.Identifier() + } + { + p.SetState(582) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(584) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(583) + p.Arguments() + } + + } + { + p.SetState(586) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + 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 +} + +// INativeFunctionCallContext is an interface to support dynamic dispatch. +type INativeFunctionCallContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + Identifier() IIdentifierContext + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + Arguments() IArgumentsContext + + // IsNativeFunctionCallContext differentiates from other interfaces. + IsNativeFunctionCallContext() +} + +type NativeFunctionCallContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyNativeFunctionCallContext() *NativeFunctionCallContext { + var p = new(NativeFunctionCallContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_nativeFunctionCall + return p +} + +func InitEmptyNativeFunctionCallContext(p *NativeFunctionCallContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_nativeFunctionCall +} + +func (*NativeFunctionCallContext) IsNativeFunctionCallContext() {} + +func NewNativeFunctionCallContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *NativeFunctionCallContext { + var p = new(NativeFunctionCallContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_nativeFunctionCall + + return p +} + +func (s *NativeFunctionCallContext) GetParser() antlr.Parser { return s.parser } + +func (s *NativeFunctionCallContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *NativeFunctionCallContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *NativeFunctionCallContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *NativeFunctionCallContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *NativeFunctionCallContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *NativeFunctionCallContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *NativeFunctionCallContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterNativeFunctionCall(s) + } +} + +func (s *NativeFunctionCallContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitNativeFunctionCall(s) + } +} + +func (s *NativeFunctionCallContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitNativeFunctionCall(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) NativeFunctionCall() (localctx INativeFunctionCallContext) { + localctx = NewNativeFunctionCallContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 32, MongoShellParserRULE_nativeFunctionCall) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(590) + p.Identifier() + } + { + p.SetState(591) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(593) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(592) + p.Arguments() + } + + } + { + p.SetState(595) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IConnectionMethodContext is an interface to support dynamic dispatch. +type IConnectionMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsConnectionMethodContext differentiates from other interfaces. + IsConnectionMethodContext() +} + +type ConnectionMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyConnectionMethodContext() *ConnectionMethodContext { + var p = new(ConnectionMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_connectionMethod + return p +} + +func InitEmptyConnectionMethodContext(p *ConnectionMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_connectionMethod +} + +func (*ConnectionMethodContext) IsConnectionMethodContext() {} + +func NewConnectionMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ConnectionMethodContext { + var p = new(ConnectionMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_connectionMethod + + return p +} + +func (s *ConnectionMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *ConnectionMethodContext) CopyAll(ctx *ConnectionMethodContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *ConnectionMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ConnectionMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type ConnGetReadConcernContext struct { + ConnectionMethodContext +} + +func NewConnGetReadConcernContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ConnGetReadConcernContext { + var p = new(ConnGetReadConcernContext) + + InitEmptyConnectionMethodContext(&p.ConnectionMethodContext) + p.parser = parser + p.CopyAll(ctx.(*ConnectionMethodContext)) + + return p +} + +func (s *ConnGetReadConcernContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ConnGetReadConcernContext) GET_READ_CONCERN() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_READ_CONCERN, 0) +} + +func (s *ConnGetReadConcernContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ConnGetReadConcernContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ConnGetReadConcernContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterConnGetReadConcern(s) + } +} + +func (s *ConnGetReadConcernContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitConnGetReadConcern(s) + } +} + +func (s *ConnGetReadConcernContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitConnGetReadConcern(s) + + default: + return t.VisitChildren(s) + } +} + +type ConnSetReadPrefContext struct { + ConnectionMethodContext +} + +func NewConnSetReadPrefContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ConnSetReadPrefContext { + var p = new(ConnSetReadPrefContext) + + InitEmptyConnectionMethodContext(&p.ConnectionMethodContext) + p.parser = parser + p.CopyAll(ctx.(*ConnectionMethodContext)) + + return p +} + +func (s *ConnSetReadPrefContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ConnSetReadPrefContext) SET_READ_PREF() antlr.TerminalNode { + return s.GetToken(MongoShellParserSET_READ_PREF, 0) +} + +func (s *ConnSetReadPrefContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ConnSetReadPrefContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *ConnSetReadPrefContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ConnSetReadPrefContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterConnSetReadPref(s) + } +} + +func (s *ConnSetReadPrefContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitConnSetReadPref(s) + } +} + +func (s *ConnSetReadPrefContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitConnSetReadPref(s) + + default: + return t.VisitChildren(s) + } +} + +type ConnAdminCommandContext struct { + ConnectionMethodContext +} + +func NewConnAdminCommandContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ConnAdminCommandContext { + var p = new(ConnAdminCommandContext) + + InitEmptyConnectionMethodContext(&p.ConnectionMethodContext) + p.parser = parser + p.CopyAll(ctx.(*ConnectionMethodContext)) + + return p +} + +func (s *ConnAdminCommandContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ConnAdminCommandContext) ADMIN_COMMAND() antlr.TerminalNode { + return s.GetToken(MongoShellParserADMIN_COMMAND, 0) +} + +func (s *ConnAdminCommandContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ConnAdminCommandContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *ConnAdminCommandContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ConnAdminCommandContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterConnAdminCommand(s) + } +} + +func (s *ConnAdminCommandContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitConnAdminCommand(s) + } +} + +func (s *ConnAdminCommandContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitConnAdminCommand(s) + + default: + return t.VisitChildren(s) + } +} + +type ConnGetReadPrefTagSetContext struct { + ConnectionMethodContext +} + +func NewConnGetReadPrefTagSetContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ConnGetReadPrefTagSetContext { + var p = new(ConnGetReadPrefTagSetContext) + + InitEmptyConnectionMethodContext(&p.ConnectionMethodContext) + p.parser = parser + p.CopyAll(ctx.(*ConnectionMethodContext)) + + return p +} + +func (s *ConnGetReadPrefTagSetContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ConnGetReadPrefTagSetContext) GET_READ_PREF_TAG_SET() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_READ_PREF_TAG_SET, 0) +} + +func (s *ConnGetReadPrefTagSetContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ConnGetReadPrefTagSetContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ConnGetReadPrefTagSetContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterConnGetReadPrefTagSet(s) + } +} + +func (s *ConnGetReadPrefTagSetContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitConnGetReadPrefTagSet(s) + } +} + +func (s *ConnGetReadPrefTagSetContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitConnGetReadPrefTagSet(s) + + default: + return t.VisitChildren(s) + } +} + +type ConnGetWriteConcernContext struct { + ConnectionMethodContext +} + +func NewConnGetWriteConcernContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ConnGetWriteConcernContext { + var p = new(ConnGetWriteConcernContext) + + InitEmptyConnectionMethodContext(&p.ConnectionMethodContext) + p.parser = parser + p.CopyAll(ctx.(*ConnectionMethodContext)) + + return p +} + +func (s *ConnGetWriteConcernContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ConnGetWriteConcernContext) GET_WRITE_CONCERN() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_WRITE_CONCERN, 0) +} + +func (s *ConnGetWriteConcernContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ConnGetWriteConcernContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ConnGetWriteConcernContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterConnGetWriteConcern(s) + } +} + +func (s *ConnGetWriteConcernContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitConnGetWriteConcern(s) + } +} + +func (s *ConnGetWriteConcernContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitConnGetWriteConcern(s) + + default: + return t.VisitChildren(s) + } +} + +type ConnWatchContext struct { + ConnectionMethodContext +} + +func NewConnWatchContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ConnWatchContext { + var p = new(ConnWatchContext) + + InitEmptyConnectionMethodContext(&p.ConnectionMethodContext) + p.parser = parser + p.CopyAll(ctx.(*ConnectionMethodContext)) + + return p +} + +func (s *ConnWatchContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ConnWatchContext) WATCH() antlr.TerminalNode { + return s.GetToken(MongoShellParserWATCH, 0) +} + +func (s *ConnWatchContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ConnWatchContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ConnWatchContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *ConnWatchContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterConnWatch(s) + } +} + +func (s *ConnWatchContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitConnWatch(s) + } +} + +func (s *ConnWatchContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitConnWatch(s) + + default: + return t.VisitChildren(s) + } +} + +type ConnGetReadPrefContext struct { + ConnectionMethodContext +} + +func NewConnGetReadPrefContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ConnGetReadPrefContext { + var p = new(ConnGetReadPrefContext) + + InitEmptyConnectionMethodContext(&p.ConnectionMethodContext) + p.parser = parser + p.CopyAll(ctx.(*ConnectionMethodContext)) + + return p +} + +func (s *ConnGetReadPrefContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ConnGetReadPrefContext) GET_READ_PREF() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_READ_PREF, 0) +} + +func (s *ConnGetReadPrefContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ConnGetReadPrefContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ConnGetReadPrefContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterConnGetReadPref(s) + } +} + +func (s *ConnGetReadPrefContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitConnGetReadPref(s) + } +} + +func (s *ConnGetReadPrefContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitConnGetReadPref(s) + + default: + return t.VisitChildren(s) + } +} + +type ConnSetReadConcernContext struct { + ConnectionMethodContext +} + +func NewConnSetReadConcernContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ConnSetReadConcernContext { + var p = new(ConnSetReadConcernContext) + + InitEmptyConnectionMethodContext(&p.ConnectionMethodContext) + p.parser = parser + p.CopyAll(ctx.(*ConnectionMethodContext)) + + return p +} + +func (s *ConnSetReadConcernContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ConnSetReadConcernContext) SET_READ_CONCERN() antlr.TerminalNode { + return s.GetToken(MongoShellParserSET_READ_CONCERN, 0) +} + +func (s *ConnSetReadConcernContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ConnSetReadConcernContext) Argument() IArgumentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentContext) +} + +func (s *ConnSetReadConcernContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ConnSetReadConcernContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterConnSetReadConcern(s) + } +} + +func (s *ConnSetReadConcernContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitConnSetReadConcern(s) + } +} + +func (s *ConnSetReadConcernContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitConnSetReadConcern(s) + + default: + return t.VisitChildren(s) + } +} + +type ConnCloseContext struct { + ConnectionMethodContext +} + +func NewConnCloseContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ConnCloseContext { + var p = new(ConnCloseContext) + + InitEmptyConnectionMethodContext(&p.ConnectionMethodContext) + p.parser = parser + p.CopyAll(ctx.(*ConnectionMethodContext)) + + return p +} + +func (s *ConnCloseContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ConnCloseContext) CLOSE() antlr.TerminalNode { + return s.GetToken(MongoShellParserCLOSE, 0) +} + +func (s *ConnCloseContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ConnCloseContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ConnCloseContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterConnClose(s) + } +} + +func (s *ConnCloseContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitConnClose(s) + } +} + +func (s *ConnCloseContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitConnClose(s) + + default: + return t.VisitChildren(s) + } +} + +type ConnGenericMethodContext struct { + ConnectionMethodContext +} + +func NewConnGenericMethodContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ConnGenericMethodContext { + var p = new(ConnGenericMethodContext) + + InitEmptyConnectionMethodContext(&p.ConnectionMethodContext) + p.parser = parser + p.CopyAll(ctx.(*ConnectionMethodContext)) + + return p +} + +func (s *ConnGenericMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ConnGenericMethodContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *ConnGenericMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ConnGenericMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ConnGenericMethodContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *ConnGenericMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterConnGenericMethod(s) + } +} + +func (s *ConnGenericMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitConnGenericMethod(s) + } +} + +func (s *ConnGenericMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitConnGenericMethod(s) + + default: + return t.VisitChildren(s) + } +} + +type ConnGetDBNamesContext struct { + ConnectionMethodContext +} + +func NewConnGetDBNamesContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ConnGetDBNamesContext { + var p = new(ConnGetDBNamesContext) + + InitEmptyConnectionMethodContext(&p.ConnectionMethodContext) + p.parser = parser + p.CopyAll(ctx.(*ConnectionMethodContext)) + + return p +} + +func (s *ConnGetDBNamesContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ConnGetDBNamesContext) GET_DB_NAMES() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_DB_NAMES, 0) +} + +func (s *ConnGetDBNamesContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ConnGetDBNamesContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ConnGetDBNamesContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterConnGetDBNames(s) + } +} + +func (s *ConnGetDBNamesContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitConnGetDBNames(s) + } +} + +func (s *ConnGetDBNamesContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitConnGetDBNames(s) + + default: + return t.VisitChildren(s) + } +} + +type ConnGetDBContext struct { + ConnectionMethodContext +} + +func NewConnGetDBContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ConnGetDBContext { + var p = new(ConnGetDBContext) + + InitEmptyConnectionMethodContext(&p.ConnectionMethodContext) + p.parser = parser + p.CopyAll(ctx.(*ConnectionMethodContext)) + + return p +} + +func (s *ConnGetDBContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ConnGetDBContext) GET_DB() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_DB, 0) +} + +func (s *ConnGetDBContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ConnGetDBContext) Argument() IArgumentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentContext) +} + +func (s *ConnGetDBContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ConnGetDBContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterConnGetDB(s) + } +} + +func (s *ConnGetDBContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitConnGetDB(s) + } +} + +func (s *ConnGetDBContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitConnGetDB(s) + + default: + return t.VisitChildren(s) + } +} + +type ConnGetReadPrefModeContext struct { + ConnectionMethodContext +} + +func NewConnGetReadPrefModeContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ConnGetReadPrefModeContext { + var p = new(ConnGetReadPrefModeContext) + + InitEmptyConnectionMethodContext(&p.ConnectionMethodContext) + p.parser = parser + p.CopyAll(ctx.(*ConnectionMethodContext)) + + return p +} + +func (s *ConnGetReadPrefModeContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ConnGetReadPrefModeContext) GET_READ_PREF_MODE() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_READ_PREF_MODE, 0) +} + +func (s *ConnGetReadPrefModeContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ConnGetReadPrefModeContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ConnGetReadPrefModeContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterConnGetReadPrefMode(s) + } +} + +func (s *ConnGetReadPrefModeContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitConnGetReadPrefMode(s) + } +} + +func (s *ConnGetReadPrefModeContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitConnGetReadPrefMode(s) + + default: + return t.VisitChildren(s) + } +} + +type ConnStartSessionContext struct { + ConnectionMethodContext +} + +func NewConnStartSessionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ConnStartSessionContext { + var p = new(ConnStartSessionContext) + + InitEmptyConnectionMethodContext(&p.ConnectionMethodContext) + p.parser = parser + p.CopyAll(ctx.(*ConnectionMethodContext)) + + return p +} + +func (s *ConnStartSessionContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ConnStartSessionContext) START_SESSION() antlr.TerminalNode { + return s.GetToken(MongoShellParserSTART_SESSION, 0) +} + +func (s *ConnStartSessionContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ConnStartSessionContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ConnStartSessionContext) Argument() IArgumentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentContext) +} + +func (s *ConnStartSessionContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterConnStartSession(s) + } +} + +func (s *ConnStartSessionContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitConnStartSession(s) + } +} + +func (s *ConnStartSessionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitConnStartSession(s) + + default: + return t.VisitChildren(s) + } +} + +type ConnSetWriteConcernContext struct { + ConnectionMethodContext +} + +func NewConnSetWriteConcernContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ConnSetWriteConcernContext { + var p = new(ConnSetWriteConcernContext) + + InitEmptyConnectionMethodContext(&p.ConnectionMethodContext) + p.parser = parser + p.CopyAll(ctx.(*ConnectionMethodContext)) + + return p +} + +func (s *ConnSetWriteConcernContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ConnSetWriteConcernContext) SET_WRITE_CONCERN() antlr.TerminalNode { + return s.GetToken(MongoShellParserSET_WRITE_CONCERN, 0) +} + +func (s *ConnSetWriteConcernContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ConnSetWriteConcernContext) Argument() IArgumentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentContext) +} + +func (s *ConnSetWriteConcernContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ConnSetWriteConcernContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterConnSetWriteConcern(s) + } +} + +func (s *ConnSetWriteConcernContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitConnSetWriteConcern(s) + } +} + +func (s *ConnSetWriteConcernContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitConnSetWriteConcern(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) ConnectionMethod() (localctx IConnectionMethodContext) { + localctx = NewConnectionMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 34, MongoShellParserRULE_connectionMethod) + var _la int + + p.SetState(662) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 48, p.GetParserRuleContext()) { + case 1: + localctx = NewConnGetDBContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(597) + p.Match(MongoShellParserGET_DB) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(598) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(599) + p.Argument() + } + { + p.SetState(600) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 2: + localctx = NewConnGetReadConcernContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(602) + p.Match(MongoShellParserGET_READ_CONCERN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(603) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(604) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 3: + localctx = NewConnGetReadPrefContext(p, localctx) + p.EnterOuterAlt(localctx, 3) + { + p.SetState(605) + p.Match(MongoShellParserGET_READ_PREF) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(606) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(607) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 4: + localctx = NewConnGetReadPrefModeContext(p, localctx) + p.EnterOuterAlt(localctx, 4) + { + p.SetState(608) + p.Match(MongoShellParserGET_READ_PREF_MODE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(609) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(610) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 5: + localctx = NewConnGetReadPrefTagSetContext(p, localctx) + p.EnterOuterAlt(localctx, 5) + { + p.SetState(611) + p.Match(MongoShellParserGET_READ_PREF_TAG_SET) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(612) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(613) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 6: + localctx = NewConnGetWriteConcernContext(p, localctx) + p.EnterOuterAlt(localctx, 6) + { + p.SetState(614) + p.Match(MongoShellParserGET_WRITE_CONCERN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(615) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(616) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 7: + localctx = NewConnSetReadPrefContext(p, localctx) + p.EnterOuterAlt(localctx, 7) + { + p.SetState(617) + p.Match(MongoShellParserSET_READ_PREF) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(618) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(619) + p.Arguments() + } + { + p.SetState(620) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 8: + localctx = NewConnSetReadConcernContext(p, localctx) + p.EnterOuterAlt(localctx, 8) + { + p.SetState(622) + p.Match(MongoShellParserSET_READ_CONCERN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(623) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(624) + p.Argument() + } + { + p.SetState(625) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 9: + localctx = NewConnSetWriteConcernContext(p, localctx) + p.EnterOuterAlt(localctx, 9) + { + p.SetState(627) + p.Match(MongoShellParserSET_WRITE_CONCERN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(628) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(629) + p.Argument() + } + { + p.SetState(630) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 10: + localctx = NewConnStartSessionContext(p, localctx) + p.EnterOuterAlt(localctx, 10) + { + p.SetState(632) + p.Match(MongoShellParserSTART_SESSION) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(633) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(635) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(634) + p.Argument() + } + + } + { + p.SetState(637) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 11: + localctx = NewConnWatchContext(p, localctx) + p.EnterOuterAlt(localctx, 11) + { + p.SetState(638) + p.Match(MongoShellParserWATCH) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(639) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(641) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(640) + p.Arguments() + } + + } + { + p.SetState(643) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 12: + localctx = NewConnCloseContext(p, localctx) + p.EnterOuterAlt(localctx, 12) + { + p.SetState(644) + p.Match(MongoShellParserCLOSE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(645) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(646) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 13: + localctx = NewConnAdminCommandContext(p, localctx) + p.EnterOuterAlt(localctx, 13) + { + p.SetState(647) + p.Match(MongoShellParserADMIN_COMMAND) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(648) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(649) + p.Arguments() + } + { + p.SetState(650) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 14: + localctx = NewConnGetDBNamesContext(p, localctx) + p.EnterOuterAlt(localctx, 14) + { + p.SetState(652) + p.Match(MongoShellParserGET_DB_NAMES) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(653) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(654) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 15: + localctx = NewConnGenericMethodContext(p, localctx) + p.EnterOuterAlt(localctx, 15) + { + p.SetState(655) + p.Identifier() + } + { + p.SetState(656) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(658) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(657) + p.Arguments() + } + + } + { + p.SetState(660) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + 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 +} + +// ICollectionAccessContext is an interface to support dynamic dispatch. +type ICollectionAccessContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + // IsCollectionAccessContext differentiates from other interfaces. + IsCollectionAccessContext() +} + +type CollectionAccessContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyCollectionAccessContext() *CollectionAccessContext { + var p = new(CollectionAccessContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_collectionAccess + return p +} + +func InitEmptyCollectionAccessContext(p *CollectionAccessContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_collectionAccess +} + +func (*CollectionAccessContext) IsCollectionAccessContext() {} + +func NewCollectionAccessContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CollectionAccessContext { + var p = new(CollectionAccessContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_collectionAccess + + return p +} + +func (s *CollectionAccessContext) GetParser() antlr.Parser { return s.parser } + +func (s *CollectionAccessContext) CopyAll(ctx *CollectionAccessContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *CollectionAccessContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *CollectionAccessContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type DotAccessContext struct { + CollectionAccessContext +} + +func NewDotAccessContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DotAccessContext { + var p = new(DotAccessContext) + + InitEmptyCollectionAccessContext(&p.CollectionAccessContext) + p.parser = parser + p.CopyAll(ctx.(*CollectionAccessContext)) + + return p +} + +func (s *DotAccessContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DotAccessContext) DOT() antlr.TerminalNode { + return s.GetToken(MongoShellParserDOT, 0) +} + +func (s *DotAccessContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) +} + +func (s *DotAccessContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterDotAccess(s) + } +} + +func (s *DotAccessContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitDotAccess(s) + } +} + +func (s *DotAccessContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitDotAccess(s) + + default: + return t.VisitChildren(s) + } +} + +type GetCollectionAccessContext struct { + CollectionAccessContext +} + +func NewGetCollectionAccessContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *GetCollectionAccessContext { + var p = new(GetCollectionAccessContext) + + InitEmptyCollectionAccessContext(&p.CollectionAccessContext) + p.parser = parser + p.CopyAll(ctx.(*CollectionAccessContext)) + + return p +} + +func (s *GetCollectionAccessContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *GetCollectionAccessContext) DOT() antlr.TerminalNode { + return s.GetToken(MongoShellParserDOT, 0) +} + +func (s *GetCollectionAccessContext) GET_COLLECTION() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_COLLECTION, 0) +} + +func (s *GetCollectionAccessContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *GetCollectionAccessContext) StringLiteral() IStringLiteralContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IStringLiteralContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IStringLiteralContext) +} + +func (s *GetCollectionAccessContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *GetCollectionAccessContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterGetCollectionAccess(s) + } +} + +func (s *GetCollectionAccessContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitGetCollectionAccess(s) + } +} + +func (s *GetCollectionAccessContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitGetCollectionAccess(s) + + default: + return t.VisitChildren(s) + } +} + +type BracketAccessContext struct { + CollectionAccessContext +} + +func NewBracketAccessContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BracketAccessContext { + var p = new(BracketAccessContext) + + InitEmptyCollectionAccessContext(&p.CollectionAccessContext) + p.parser = parser + p.CopyAll(ctx.(*CollectionAccessContext)) + + return p +} + +func (s *BracketAccessContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *BracketAccessContext) LBRACKET() antlr.TerminalNode { + return s.GetToken(MongoShellParserLBRACKET, 0) +} + +func (s *BracketAccessContext) StringLiteral() IStringLiteralContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IStringLiteralContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IStringLiteralContext) +} + +func (s *BracketAccessContext) RBRACKET() antlr.TerminalNode { + return s.GetToken(MongoShellParserRBRACKET, 0) +} + +func (s *BracketAccessContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterBracketAccess(s) + } +} + +func (s *BracketAccessContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitBracketAccess(s) + } +} + +func (s *BracketAccessContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitBracketAccess(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) CollectionAccess() (localctx ICollectionAccessContext) { + localctx = NewCollectionAccessContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 36, MongoShellParserRULE_collectionAccess) + p.SetState(676) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 49, p.GetParserRuleContext()) { + case 1: + localctx = NewDotAccessContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(664) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(665) + p.Identifier() + } + + case 2: + localctx = NewBracketAccessContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(666) + p.Match(MongoShellParserLBRACKET) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(667) + p.StringLiteral() + } + { + p.SetState(668) + p.Match(MongoShellParserRBRACKET) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case 3: + localctx = NewGetCollectionAccessContext(p, localctx) + p.EnterOuterAlt(localctx, 3) + { + p.SetState(670) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(671) + p.Match(MongoShellParserGET_COLLECTION) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(672) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(673) + p.StringLiteral() + } + { + p.SetState(674) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + 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 +} + +// IMethodChainContext is an interface to support dynamic dispatch. +type IMethodChainContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + AllDOT() []antlr.TerminalNode + DOT(i int) antlr.TerminalNode + AllMethodCall() []IMethodCallContext + MethodCall(i int) IMethodCallContext + + // IsMethodChainContext differentiates from other interfaces. + IsMethodChainContext() +} + +type MethodChainContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyMethodChainContext() *MethodChainContext { + var p = new(MethodChainContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_methodChain + return p +} + +func InitEmptyMethodChainContext(p *MethodChainContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_methodChain +} + +func (*MethodChainContext) IsMethodChainContext() {} + +func NewMethodChainContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MethodChainContext { + var p = new(MethodChainContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_methodChain + + return p +} + +func (s *MethodChainContext) GetParser() antlr.Parser { return s.parser } + +func (s *MethodChainContext) AllDOT() []antlr.TerminalNode { + return s.GetTokens(MongoShellParserDOT) +} + +func (s *MethodChainContext) DOT(i int) antlr.TerminalNode { + return s.GetToken(MongoShellParserDOT, i) +} + +func (s *MethodChainContext) AllMethodCall() []IMethodCallContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IMethodCallContext); ok { + len++ + } + } + + tst := make([]IMethodCallContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IMethodCallContext); ok { + tst[i] = t.(IMethodCallContext) + i++ + } + } + + return tst +} + +func (s *MethodChainContext) MethodCall(i int) IMethodCallContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMethodCallContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IMethodCallContext) +} + +func (s *MethodChainContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *MethodChainContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *MethodChainContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterMethodChain(s) + } +} + +func (s *MethodChainContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitMethodChain(s) + } +} + +func (s *MethodChainContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitMethodChain(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) MethodChain() (localctx IMethodChainContext) { + localctx = NewMethodChainContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 38, MongoShellParserRULE_methodChain) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(678) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(679) + p.MethodCall() + } + p.SetState(684) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + for _la == MongoShellParserDOT { + { + p.SetState(680) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(681) + p.MethodCall() + } + + p.SetState(686) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + } + +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used +} + +// IMethodCallContext is an interface to support dynamic dispatch. +type IMethodCallContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + FindMethod() IFindMethodContext + FindOneMethod() IFindOneMethodContext + CountDocumentsMethod() ICountDocumentsMethodContext + EstimatedDocumentCountMethod() IEstimatedDocumentCountMethodContext + DistinctMethod() IDistinctMethodContext + AggregateMethod() IAggregateMethodContext + GetIndexesMethod() IGetIndexesMethodContext + InsertOneMethod() IInsertOneMethodContext + InsertManyMethod() IInsertManyMethodContext + UpdateOneMethod() IUpdateOneMethodContext + UpdateManyMethod() IUpdateManyMethodContext + DeleteOneMethod() IDeleteOneMethodContext + DeleteManyMethod() IDeleteManyMethodContext + ReplaceOneMethod() IReplaceOneMethodContext + FindOneAndUpdateMethod() IFindOneAndUpdateMethodContext + FindOneAndReplaceMethod() IFindOneAndReplaceMethodContext + FindOneAndDeleteMethod() IFindOneAndDeleteMethodContext + CreateIndexMethod() ICreateIndexMethodContext + CreateIndexesMethod() ICreateIndexesMethodContext + DropIndexMethod() IDropIndexMethodContext + DropIndexesMethod() IDropIndexesMethodContext + DropMethod() IDropMethodContext + RenameCollectionMethod() IRenameCollectionMethodContext + StatsMethod() IStatsMethodContext + StorageSizeMethod() IStorageSizeMethodContext + TotalIndexSizeMethod() ITotalIndexSizeMethodContext + TotalSizeMethod() ITotalSizeMethodContext + DataSizeMethod() IDataSizeMethodContext + IsCappedMethod() IIsCappedMethodContext + ValidateMethod() IValidateMethodContext + LatencyStatsMethod() ILatencyStatsMethodContext + SortMethod() ISortMethodContext + LimitMethod() ILimitMethodContext + SkipMethod() ISkipMethodContext + CountMethod() ICountMethodContext + ProjectionMethod() IProjectionMethodContext + BatchSizeMethod() IBatchSizeMethodContext + CloseMethod() ICloseMethodContext + CollationMethod() ICollationMethodContext + CommentMethod() ICommentMethodContext + ExplainMethod() IExplainMethodContext + ForEachMethod() IForEachMethodContext + HasNextMethod() IHasNextMethodContext + HintMethod() IHintMethodContext + IsClosedMethod() IIsClosedMethodContext + IsExhaustedMethod() IIsExhaustedMethodContext + ItcountMethod() IItcountMethodContext + MapMethod() IMapMethodContext + MaxMethod() IMaxMethodContext + MaxAwaitTimeMSMethod() IMaxAwaitTimeMSMethodContext + MaxTimeMSMethod() IMaxTimeMSMethodContext + MinMethod() IMinMethodContext + NextMethod() INextMethodContext + NoCursorTimeoutMethod() INoCursorTimeoutMethodContext + ObjsLeftInBatchMethod() IObjsLeftInBatchMethodContext + PrettyMethod() IPrettyMethodContext + ReadConcernMethod() IReadConcernMethodContext + ReadPrefMethod() IReadPrefMethodContext + ReturnKeyMethod() IReturnKeyMethodContext + ShowRecordIdMethod() IShowRecordIdMethodContext + SizeMethod() ISizeMethodContext + TailableMethod() ITailableMethodContext + ToArrayMethod() IToArrayMethodContext + TryNextMethod() ITryNextMethodContext + AllowDiskUseMethod() IAllowDiskUseMethodContext + AddOptionMethod() IAddOptionMethodContext + GenericMethod() IGenericMethodContext + + // IsMethodCallContext differentiates from other interfaces. + IsMethodCallContext() +} + +type MethodCallContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyMethodCallContext() *MethodCallContext { + var p = new(MethodCallContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_methodCall + return p +} + +func InitEmptyMethodCallContext(p *MethodCallContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_methodCall +} + +func (*MethodCallContext) IsMethodCallContext() {} + +func NewMethodCallContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MethodCallContext { + var p = new(MethodCallContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_methodCall + + return p +} + +func (s *MethodCallContext) GetParser() antlr.Parser { return s.parser } + +func (s *MethodCallContext) FindMethod() IFindMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IFindMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IFindMethodContext) +} + +func (s *MethodCallContext) FindOneMethod() IFindOneMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IFindOneMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IFindOneMethodContext) +} + +func (s *MethodCallContext) CountDocumentsMethod() ICountDocumentsMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICountDocumentsMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ICountDocumentsMethodContext) +} + +func (s *MethodCallContext) EstimatedDocumentCountMethod() IEstimatedDocumentCountMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IEstimatedDocumentCountMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IEstimatedDocumentCountMethodContext) +} + +func (s *MethodCallContext) DistinctMethod() IDistinctMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDistinctMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IDistinctMethodContext) +} + +func (s *MethodCallContext) AggregateMethod() IAggregateMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IAggregateMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IAggregateMethodContext) +} + +func (s *MethodCallContext) GetIndexesMethod() IGetIndexesMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IGetIndexesMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IGetIndexesMethodContext) +} + +func (s *MethodCallContext) InsertOneMethod() IInsertOneMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IInsertOneMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IInsertOneMethodContext) +} + +func (s *MethodCallContext) InsertManyMethod() IInsertManyMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IInsertManyMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IInsertManyMethodContext) +} + +func (s *MethodCallContext) UpdateOneMethod() IUpdateOneMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IUpdateOneMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IUpdateOneMethodContext) +} + +func (s *MethodCallContext) UpdateManyMethod() IUpdateManyMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IUpdateManyMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IUpdateManyMethodContext) +} + +func (s *MethodCallContext) DeleteOneMethod() IDeleteOneMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDeleteOneMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IDeleteOneMethodContext) +} + +func (s *MethodCallContext) DeleteManyMethod() IDeleteManyMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDeleteManyMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IDeleteManyMethodContext) +} + +func (s *MethodCallContext) ReplaceOneMethod() IReplaceOneMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IReplaceOneMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IReplaceOneMethodContext) +} + +func (s *MethodCallContext) FindOneAndUpdateMethod() IFindOneAndUpdateMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IFindOneAndUpdateMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IFindOneAndUpdateMethodContext) +} + +func (s *MethodCallContext) FindOneAndReplaceMethod() IFindOneAndReplaceMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IFindOneAndReplaceMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IFindOneAndReplaceMethodContext) +} + +func (s *MethodCallContext) FindOneAndDeleteMethod() IFindOneAndDeleteMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IFindOneAndDeleteMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IFindOneAndDeleteMethodContext) +} + +func (s *MethodCallContext) CreateIndexMethod() ICreateIndexMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICreateIndexMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ICreateIndexMethodContext) +} + +func (s *MethodCallContext) CreateIndexesMethod() ICreateIndexesMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICreateIndexesMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ICreateIndexesMethodContext) +} + +func (s *MethodCallContext) DropIndexMethod() IDropIndexMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDropIndexMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IDropIndexMethodContext) +} + +func (s *MethodCallContext) DropIndexesMethod() IDropIndexesMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDropIndexesMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IDropIndexesMethodContext) +} + +func (s *MethodCallContext) DropMethod() IDropMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDropMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IDropMethodContext) +} + +func (s *MethodCallContext) RenameCollectionMethod() IRenameCollectionMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IRenameCollectionMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IRenameCollectionMethodContext) +} + +func (s *MethodCallContext) StatsMethod() IStatsMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IStatsMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IStatsMethodContext) +} + +func (s *MethodCallContext) StorageSizeMethod() IStorageSizeMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IStorageSizeMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IStorageSizeMethodContext) +} + +func (s *MethodCallContext) TotalIndexSizeMethod() ITotalIndexSizeMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITotalIndexSizeMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ITotalIndexSizeMethodContext) +} + +func (s *MethodCallContext) TotalSizeMethod() ITotalSizeMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITotalSizeMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ITotalSizeMethodContext) +} + +func (s *MethodCallContext) DataSizeMethod() IDataSizeMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDataSizeMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IDataSizeMethodContext) +} + +func (s *MethodCallContext) IsCappedMethod() IIsCappedMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIsCappedMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIsCappedMethodContext) +} + +func (s *MethodCallContext) ValidateMethod() IValidateMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IValidateMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IValidateMethodContext) +} + +func (s *MethodCallContext) LatencyStatsMethod() ILatencyStatsMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ILatencyStatsMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ILatencyStatsMethodContext) +} + +func (s *MethodCallContext) SortMethod() ISortMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISortMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISortMethodContext) +} + +func (s *MethodCallContext) LimitMethod() ILimitMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ILimitMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ILimitMethodContext) +} + +func (s *MethodCallContext) SkipMethod() ISkipMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISkipMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISkipMethodContext) +} + +func (s *MethodCallContext) CountMethod() ICountMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICountMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ICountMethodContext) +} + +func (s *MethodCallContext) ProjectionMethod() IProjectionMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IProjectionMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IProjectionMethodContext) +} + +func (s *MethodCallContext) BatchSizeMethod() IBatchSizeMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IBatchSizeMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IBatchSizeMethodContext) +} + +func (s *MethodCallContext) CloseMethod() ICloseMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICloseMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ICloseMethodContext) +} + +func (s *MethodCallContext) CollationMethod() ICollationMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICollationMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ICollationMethodContext) +} + +func (s *MethodCallContext) CommentMethod() ICommentMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICommentMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ICommentMethodContext) +} + +func (s *MethodCallContext) ExplainMethod() IExplainMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IExplainMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IExplainMethodContext) +} + +func (s *MethodCallContext) ForEachMethod() IForEachMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IForEachMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IForEachMethodContext) +} + +func (s *MethodCallContext) HasNextMethod() IHasNextMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IHasNextMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IHasNextMethodContext) +} + +func (s *MethodCallContext) HintMethod() IHintMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IHintMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IHintMethodContext) +} + +func (s *MethodCallContext) IsClosedMethod() IIsClosedMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIsClosedMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIsClosedMethodContext) +} + +func (s *MethodCallContext) IsExhaustedMethod() IIsExhaustedMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIsExhaustedMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIsExhaustedMethodContext) +} + +func (s *MethodCallContext) ItcountMethod() IItcountMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IItcountMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IItcountMethodContext) +} + +func (s *MethodCallContext) MapMethod() IMapMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMapMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IMapMethodContext) +} + +func (s *MethodCallContext) MaxMethod() IMaxMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMaxMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IMaxMethodContext) +} + +func (s *MethodCallContext) MaxAwaitTimeMSMethod() IMaxAwaitTimeMSMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMaxAwaitTimeMSMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IMaxAwaitTimeMSMethodContext) +} + +func (s *MethodCallContext) MaxTimeMSMethod() IMaxTimeMSMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMaxTimeMSMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IMaxTimeMSMethodContext) +} + +func (s *MethodCallContext) MinMethod() IMinMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMinMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IMinMethodContext) +} + +func (s *MethodCallContext) NextMethod() INextMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(INextMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(INextMethodContext) +} + +func (s *MethodCallContext) NoCursorTimeoutMethod() INoCursorTimeoutMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(INoCursorTimeoutMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(INoCursorTimeoutMethodContext) +} + +func (s *MethodCallContext) ObjsLeftInBatchMethod() IObjsLeftInBatchMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IObjsLeftInBatchMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IObjsLeftInBatchMethodContext) +} + +func (s *MethodCallContext) PrettyMethod() IPrettyMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPrettyMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IPrettyMethodContext) +} + +func (s *MethodCallContext) ReadConcernMethod() IReadConcernMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IReadConcernMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IReadConcernMethodContext) +} + +func (s *MethodCallContext) ReadPrefMethod() IReadPrefMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IReadPrefMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IReadPrefMethodContext) +} + +func (s *MethodCallContext) ReturnKeyMethod() IReturnKeyMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IReturnKeyMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IReturnKeyMethodContext) +} + +func (s *MethodCallContext) ShowRecordIdMethod() IShowRecordIdMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IShowRecordIdMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IShowRecordIdMethodContext) +} + +func (s *MethodCallContext) SizeMethod() ISizeMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISizeMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ISizeMethodContext) +} + +func (s *MethodCallContext) TailableMethod() ITailableMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITailableMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ITailableMethodContext) +} + +func (s *MethodCallContext) ToArrayMethod() IToArrayMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IToArrayMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IToArrayMethodContext) +} + +func (s *MethodCallContext) TryNextMethod() ITryNextMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITryNextMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(ITryNextMethodContext) +} + +func (s *MethodCallContext) AllowDiskUseMethod() IAllowDiskUseMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IAllowDiskUseMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IAllowDiskUseMethodContext) +} + +func (s *MethodCallContext) AddOptionMethod() IAddOptionMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IAddOptionMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IAddOptionMethodContext) +} + +func (s *MethodCallContext) GenericMethod() IGenericMethodContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IGenericMethodContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IGenericMethodContext) +} + +func (s *MethodCallContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *MethodCallContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *MethodCallContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterMethodCall(s) + } +} + +func (s *MethodCallContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitMethodCall(s) + } +} + +func (s *MethodCallContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitMethodCall(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) MethodCall() (localctx IMethodCallContext) { + localctx = NewMethodCallContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 40, MongoShellParserRULE_methodCall) + p.SetState(754) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 51, p.GetParserRuleContext()) { + case 1: + p.EnterOuterAlt(localctx, 1) + { + p.SetState(687) + p.FindMethod() + } + + case 2: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(688) + p.FindOneMethod() + } + + case 3: + p.EnterOuterAlt(localctx, 3) + { + p.SetState(689) + p.CountDocumentsMethod() + } + + case 4: + p.EnterOuterAlt(localctx, 4) + { + p.SetState(690) + p.EstimatedDocumentCountMethod() + } + + case 5: + p.EnterOuterAlt(localctx, 5) + { + p.SetState(691) + p.DistinctMethod() + } + + case 6: + p.EnterOuterAlt(localctx, 6) + { + p.SetState(692) + p.AggregateMethod() + } + + case 7: + p.EnterOuterAlt(localctx, 7) + { + p.SetState(693) + p.GetIndexesMethod() + } + + case 8: + p.EnterOuterAlt(localctx, 8) + { + p.SetState(694) + p.InsertOneMethod() + } + + case 9: + p.EnterOuterAlt(localctx, 9) + { + p.SetState(695) + p.InsertManyMethod() + } + + case 10: + p.EnterOuterAlt(localctx, 10) + { + p.SetState(696) + p.UpdateOneMethod() + } + + case 11: + p.EnterOuterAlt(localctx, 11) + { + p.SetState(697) + p.UpdateManyMethod() + } + + case 12: + p.EnterOuterAlt(localctx, 12) + { + p.SetState(698) + p.DeleteOneMethod() + } + + case 13: + p.EnterOuterAlt(localctx, 13) + { + p.SetState(699) + p.DeleteManyMethod() + } + + case 14: + p.EnterOuterAlt(localctx, 14) + { + p.SetState(700) + p.ReplaceOneMethod() + } + + case 15: + p.EnterOuterAlt(localctx, 15) + { + p.SetState(701) + p.FindOneAndUpdateMethod() + } + + case 16: + p.EnterOuterAlt(localctx, 16) + { + p.SetState(702) + p.FindOneAndReplaceMethod() + } + + case 17: + p.EnterOuterAlt(localctx, 17) + { + p.SetState(703) + p.FindOneAndDeleteMethod() + } + + case 18: + p.EnterOuterAlt(localctx, 18) + { + p.SetState(704) + p.CreateIndexMethod() + } + + case 19: + p.EnterOuterAlt(localctx, 19) + { + p.SetState(705) + p.CreateIndexesMethod() + } + + case 20: + p.EnterOuterAlt(localctx, 20) + { + p.SetState(706) + p.DropIndexMethod() + } + + case 21: + p.EnterOuterAlt(localctx, 21) + { + p.SetState(707) + p.DropIndexesMethod() + } + + case 22: + p.EnterOuterAlt(localctx, 22) + { + p.SetState(708) + p.DropMethod() + } + + case 23: + p.EnterOuterAlt(localctx, 23) + { + p.SetState(709) + p.RenameCollectionMethod() + } + + case 24: + p.EnterOuterAlt(localctx, 24) + { + p.SetState(710) + p.StatsMethod() + } + + case 25: + p.EnterOuterAlt(localctx, 25) + { + p.SetState(711) + p.StorageSizeMethod() + } + + case 26: + p.EnterOuterAlt(localctx, 26) + { + p.SetState(712) + p.TotalIndexSizeMethod() + } + + case 27: + p.EnterOuterAlt(localctx, 27) + { + p.SetState(713) + p.TotalSizeMethod() + } + + case 28: + p.EnterOuterAlt(localctx, 28) + { + p.SetState(714) + p.DataSizeMethod() + } + + case 29: + p.EnterOuterAlt(localctx, 29) + { + p.SetState(715) + p.IsCappedMethod() + } + + case 30: + p.EnterOuterAlt(localctx, 30) + { + p.SetState(716) + p.ValidateMethod() + } + + case 31: + p.EnterOuterAlt(localctx, 31) + { + p.SetState(717) + p.LatencyStatsMethod() + } + + case 32: + p.EnterOuterAlt(localctx, 32) + { + p.SetState(718) + p.SortMethod() + } + + case 33: + p.EnterOuterAlt(localctx, 33) + { + p.SetState(719) + p.LimitMethod() + } + + case 34: + p.EnterOuterAlt(localctx, 34) + { + p.SetState(720) + p.SkipMethod() + } + + case 35: + p.EnterOuterAlt(localctx, 35) + { + p.SetState(721) + p.CountMethod() + } + + case 36: + p.EnterOuterAlt(localctx, 36) + { + p.SetState(722) + p.ProjectionMethod() + } + + case 37: + p.EnterOuterAlt(localctx, 37) + { + p.SetState(723) + p.BatchSizeMethod() + } + + case 38: + p.EnterOuterAlt(localctx, 38) + { + p.SetState(724) + p.CloseMethod() + } + + case 39: + p.EnterOuterAlt(localctx, 39) + { + p.SetState(725) + p.CollationMethod() + } + + case 40: + p.EnterOuterAlt(localctx, 40) + { + p.SetState(726) + p.CommentMethod() + } + + case 41: + p.EnterOuterAlt(localctx, 41) + { + p.SetState(727) + p.ExplainMethod() + } + + case 42: + p.EnterOuterAlt(localctx, 42) + { + p.SetState(728) + p.ForEachMethod() + } + + case 43: + p.EnterOuterAlt(localctx, 43) + { + p.SetState(729) + p.HasNextMethod() + } + + case 44: + p.EnterOuterAlt(localctx, 44) + { + p.SetState(730) + p.HintMethod() + } + + case 45: + p.EnterOuterAlt(localctx, 45) + { + p.SetState(731) + p.IsClosedMethod() + } + + case 46: + p.EnterOuterAlt(localctx, 46) + { + p.SetState(732) + p.IsExhaustedMethod() + } + + case 47: + p.EnterOuterAlt(localctx, 47) + { + p.SetState(733) + p.ItcountMethod() + } + + case 48: + p.EnterOuterAlt(localctx, 48) + { + p.SetState(734) + p.MapMethod() + } + + case 49: + p.EnterOuterAlt(localctx, 49) + { + p.SetState(735) + p.MaxMethod() + } + + case 50: + p.EnterOuterAlt(localctx, 50) + { + p.SetState(736) + p.MaxAwaitTimeMSMethod() + } + + case 51: + p.EnterOuterAlt(localctx, 51) + { + p.SetState(737) + p.MaxTimeMSMethod() + } + + case 52: + p.EnterOuterAlt(localctx, 52) + { + p.SetState(738) + p.MinMethod() + } + + case 53: + p.EnterOuterAlt(localctx, 53) + { + p.SetState(739) + p.NextMethod() + } + + case 54: + p.EnterOuterAlt(localctx, 54) + { + p.SetState(740) + p.NoCursorTimeoutMethod() + } + + case 55: + p.EnterOuterAlt(localctx, 55) + { + p.SetState(741) + p.ObjsLeftInBatchMethod() + } + + case 56: + p.EnterOuterAlt(localctx, 56) + { + p.SetState(742) + p.PrettyMethod() + } + + case 57: + p.EnterOuterAlt(localctx, 57) + { + p.SetState(743) + p.ReadConcernMethod() + } + + case 58: + p.EnterOuterAlt(localctx, 58) + { + p.SetState(744) + p.ReadPrefMethod() + } + + case 59: + p.EnterOuterAlt(localctx, 59) + { + p.SetState(745) + p.ReturnKeyMethod() + } + + case 60: + p.EnterOuterAlt(localctx, 60) + { + p.SetState(746) + p.ShowRecordIdMethod() + } + + case 61: + p.EnterOuterAlt(localctx, 61) + { + p.SetState(747) + p.SizeMethod() + } + + case 62: + p.EnterOuterAlt(localctx, 62) + { + p.SetState(748) + p.TailableMethod() + } + + case 63: + p.EnterOuterAlt(localctx, 63) + { + p.SetState(749) + p.ToArrayMethod() + } + + case 64: + p.EnterOuterAlt(localctx, 64) + { + p.SetState(750) + p.TryNextMethod() + } + + case 65: + p.EnterOuterAlt(localctx, 65) + { + p.SetState(751) + p.AllowDiskUseMethod() + } + + case 66: + p.EnterOuterAlt(localctx, 66) + { + p.SetState(752) + p.AddOptionMethod() + } + + case 67: + p.EnterOuterAlt(localctx, 67) + { + p.SetState(753) + p.GenericMethod() + } + + 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 +} + +// IFindMethodContext is an interface to support dynamic dispatch. +type IFindMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + FIND() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + Argument() IArgumentContext + + // IsFindMethodContext differentiates from other interfaces. + IsFindMethodContext() +} + +type FindMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyFindMethodContext() *FindMethodContext { + var p = new(FindMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_findMethod + return p +} + +func InitEmptyFindMethodContext(p *FindMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_findMethod +} + +func (*FindMethodContext) IsFindMethodContext() {} + +func NewFindMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *FindMethodContext { + var p = new(FindMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_findMethod + + return p +} + +func (s *FindMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *FindMethodContext) FIND() antlr.TerminalNode { + return s.GetToken(MongoShellParserFIND, 0) +} + +func (s *FindMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *FindMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *FindMethodContext) Argument() IArgumentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentContext) +} + +func (s *FindMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *FindMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *FindMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterFindMethod(s) + } +} + +func (s *FindMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitFindMethod(s) + } +} + +func (s *FindMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitFindMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) FindMethod() (localctx IFindMethodContext) { + localctx = NewFindMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 42, MongoShellParserRULE_findMethod) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(756) + p.Match(MongoShellParserFIND) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(757) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(759) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(758) + p.Argument() + } + + } + { + p.SetState(761) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IFindOneMethodContext is an interface to support dynamic dispatch. +type IFindOneMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + FIND_ONE() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + Argument() IArgumentContext + + // IsFindOneMethodContext differentiates from other interfaces. + IsFindOneMethodContext() +} + +type FindOneMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyFindOneMethodContext() *FindOneMethodContext { + var p = new(FindOneMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_findOneMethod + return p +} + +func InitEmptyFindOneMethodContext(p *FindOneMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_findOneMethod +} + +func (*FindOneMethodContext) IsFindOneMethodContext() {} + +func NewFindOneMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *FindOneMethodContext { + var p = new(FindOneMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_findOneMethod + + return p +} + +func (s *FindOneMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *FindOneMethodContext) FIND_ONE() antlr.TerminalNode { + return s.GetToken(MongoShellParserFIND_ONE, 0) +} + +func (s *FindOneMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *FindOneMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *FindOneMethodContext) Argument() IArgumentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentContext) +} + +func (s *FindOneMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *FindOneMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *FindOneMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterFindOneMethod(s) + } +} + +func (s *FindOneMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitFindOneMethod(s) + } +} + +func (s *FindOneMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitFindOneMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) FindOneMethod() (localctx IFindOneMethodContext) { + localctx = NewFindOneMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 44, MongoShellParserRULE_findOneMethod) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(763) + p.Match(MongoShellParserFIND_ONE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(764) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(766) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(765) + p.Argument() + } + + } + { + p.SetState(768) + p.Match(MongoShellParserRPAREN) + 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 +} + +// ICountDocumentsMethodContext is an interface to support dynamic dispatch. +type ICountDocumentsMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + COUNT_DOCUMENTS() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + Arguments() IArgumentsContext + + // IsCountDocumentsMethodContext differentiates from other interfaces. + IsCountDocumentsMethodContext() +} + +type CountDocumentsMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyCountDocumentsMethodContext() *CountDocumentsMethodContext { + var p = new(CountDocumentsMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_countDocumentsMethod + return p +} + +func InitEmptyCountDocumentsMethodContext(p *CountDocumentsMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_countDocumentsMethod +} + +func (*CountDocumentsMethodContext) IsCountDocumentsMethodContext() {} + +func NewCountDocumentsMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CountDocumentsMethodContext { + var p = new(CountDocumentsMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_countDocumentsMethod + + return p +} + +func (s *CountDocumentsMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *CountDocumentsMethodContext) COUNT_DOCUMENTS() antlr.TerminalNode { + return s.GetToken(MongoShellParserCOUNT_DOCUMENTS, 0) +} + +func (s *CountDocumentsMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *CountDocumentsMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *CountDocumentsMethodContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *CountDocumentsMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *CountDocumentsMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *CountDocumentsMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterCountDocumentsMethod(s) + } +} + +func (s *CountDocumentsMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitCountDocumentsMethod(s) + } +} + +func (s *CountDocumentsMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitCountDocumentsMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) CountDocumentsMethod() (localctx ICountDocumentsMethodContext) { + localctx = NewCountDocumentsMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 46, MongoShellParserRULE_countDocumentsMethod) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(770) + p.Match(MongoShellParserCOUNT_DOCUMENTS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(771) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(773) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(772) + p.Arguments() + } + + } + { + p.SetState(775) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IEstimatedDocumentCountMethodContext is an interface to support dynamic dispatch. +type IEstimatedDocumentCountMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + ESTIMATED_DOCUMENT_COUNT() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + Argument() IArgumentContext + + // IsEstimatedDocumentCountMethodContext differentiates from other interfaces. + IsEstimatedDocumentCountMethodContext() +} + +type EstimatedDocumentCountMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyEstimatedDocumentCountMethodContext() *EstimatedDocumentCountMethodContext { + var p = new(EstimatedDocumentCountMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_estimatedDocumentCountMethod + return p +} + +func InitEmptyEstimatedDocumentCountMethodContext(p *EstimatedDocumentCountMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_estimatedDocumentCountMethod +} + +func (*EstimatedDocumentCountMethodContext) IsEstimatedDocumentCountMethodContext() {} + +func NewEstimatedDocumentCountMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *EstimatedDocumentCountMethodContext { + var p = new(EstimatedDocumentCountMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_estimatedDocumentCountMethod + + return p +} + +func (s *EstimatedDocumentCountMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *EstimatedDocumentCountMethodContext) ESTIMATED_DOCUMENT_COUNT() antlr.TerminalNode { + return s.GetToken(MongoShellParserESTIMATED_DOCUMENT_COUNT, 0) +} + +func (s *EstimatedDocumentCountMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *EstimatedDocumentCountMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *EstimatedDocumentCountMethodContext) Argument() IArgumentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentContext) +} + +func (s *EstimatedDocumentCountMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *EstimatedDocumentCountMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *EstimatedDocumentCountMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterEstimatedDocumentCountMethod(s) + } +} + +func (s *EstimatedDocumentCountMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitEstimatedDocumentCountMethod(s) + } +} + +func (s *EstimatedDocumentCountMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitEstimatedDocumentCountMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) EstimatedDocumentCountMethod() (localctx IEstimatedDocumentCountMethodContext) { + localctx = NewEstimatedDocumentCountMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 48, MongoShellParserRULE_estimatedDocumentCountMethod) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(777) + p.Match(MongoShellParserESTIMATED_DOCUMENT_COUNT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(778) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(780) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(779) + p.Argument() + } + + } + { + p.SetState(782) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IDistinctMethodContext is an interface to support dynamic dispatch. +type IDistinctMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + DISTINCT() antlr.TerminalNode + LPAREN() antlr.TerminalNode + Arguments() IArgumentsContext + RPAREN() antlr.TerminalNode + + // IsDistinctMethodContext differentiates from other interfaces. + IsDistinctMethodContext() +} + +type DistinctMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDistinctMethodContext() *DistinctMethodContext { + var p = new(DistinctMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_distinctMethod + return p +} + +func InitEmptyDistinctMethodContext(p *DistinctMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_distinctMethod +} + +func (*DistinctMethodContext) IsDistinctMethodContext() {} + +func NewDistinctMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DistinctMethodContext { + var p = new(DistinctMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_distinctMethod + + return p +} + +func (s *DistinctMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *DistinctMethodContext) DISTINCT() antlr.TerminalNode { + return s.GetToken(MongoShellParserDISTINCT, 0) +} + +func (s *DistinctMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *DistinctMethodContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *DistinctMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *DistinctMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DistinctMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *DistinctMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterDistinctMethod(s) + } +} + +func (s *DistinctMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitDistinctMethod(s) + } +} + +func (s *DistinctMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitDistinctMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) DistinctMethod() (localctx IDistinctMethodContext) { + localctx = NewDistinctMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 50, MongoShellParserRULE_distinctMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(784) + p.Match(MongoShellParserDISTINCT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(785) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(786) + p.Arguments() + } + { + p.SetState(787) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IAggregateMethodContext is an interface to support dynamic dispatch. +type IAggregateMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + AGGREGATE() antlr.TerminalNode + LPAREN() antlr.TerminalNode + Arguments() IArgumentsContext + RPAREN() antlr.TerminalNode + + // IsAggregateMethodContext differentiates from other interfaces. + IsAggregateMethodContext() +} + +type AggregateMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyAggregateMethodContext() *AggregateMethodContext { + var p = new(AggregateMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_aggregateMethod + return p +} + +func InitEmptyAggregateMethodContext(p *AggregateMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_aggregateMethod +} + +func (*AggregateMethodContext) IsAggregateMethodContext() {} + +func NewAggregateMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AggregateMethodContext { + var p = new(AggregateMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_aggregateMethod + + return p +} + +func (s *AggregateMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *AggregateMethodContext) AGGREGATE() antlr.TerminalNode { + return s.GetToken(MongoShellParserAGGREGATE, 0) +} + +func (s *AggregateMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *AggregateMethodContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *AggregateMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *AggregateMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *AggregateMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *AggregateMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterAggregateMethod(s) + } +} + +func (s *AggregateMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitAggregateMethod(s) + } +} + +func (s *AggregateMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitAggregateMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) AggregateMethod() (localctx IAggregateMethodContext) { + localctx = NewAggregateMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 52, MongoShellParserRULE_aggregateMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(789) + p.Match(MongoShellParserAGGREGATE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(790) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(791) + p.Arguments() + } + { + p.SetState(792) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IGetIndexesMethodContext is an interface to support dynamic dispatch. +type IGetIndexesMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + GET_INDEXES() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + + // IsGetIndexesMethodContext differentiates from other interfaces. + IsGetIndexesMethodContext() +} + +type GetIndexesMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyGetIndexesMethodContext() *GetIndexesMethodContext { + var p = new(GetIndexesMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_getIndexesMethod + return p +} + +func InitEmptyGetIndexesMethodContext(p *GetIndexesMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_getIndexesMethod +} + +func (*GetIndexesMethodContext) IsGetIndexesMethodContext() {} + +func NewGetIndexesMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *GetIndexesMethodContext { + var p = new(GetIndexesMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_getIndexesMethod + + return p +} + +func (s *GetIndexesMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *GetIndexesMethodContext) GET_INDEXES() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_INDEXES, 0) +} + +func (s *GetIndexesMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *GetIndexesMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *GetIndexesMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *GetIndexesMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *GetIndexesMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterGetIndexesMethod(s) + } +} + +func (s *GetIndexesMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitGetIndexesMethod(s) + } +} + +func (s *GetIndexesMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitGetIndexesMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) GetIndexesMethod() (localctx IGetIndexesMethodContext) { + localctx = NewGetIndexesMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 54, MongoShellParserRULE_getIndexesMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(794) + p.Match(MongoShellParserGET_INDEXES) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(795) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(796) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IInsertOneMethodContext is an interface to support dynamic dispatch. +type IInsertOneMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + INSERT_ONE() antlr.TerminalNode + LPAREN() antlr.TerminalNode + Arguments() IArgumentsContext + RPAREN() antlr.TerminalNode + + // IsInsertOneMethodContext differentiates from other interfaces. + IsInsertOneMethodContext() +} + +type InsertOneMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyInsertOneMethodContext() *InsertOneMethodContext { + var p = new(InsertOneMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_insertOneMethod + return p +} + +func InitEmptyInsertOneMethodContext(p *InsertOneMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_insertOneMethod +} + +func (*InsertOneMethodContext) IsInsertOneMethodContext() {} + +func NewInsertOneMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *InsertOneMethodContext { + var p = new(InsertOneMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_insertOneMethod + + return p +} + +func (s *InsertOneMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *InsertOneMethodContext) INSERT_ONE() antlr.TerminalNode { + return s.GetToken(MongoShellParserINSERT_ONE, 0) +} + +func (s *InsertOneMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *InsertOneMethodContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *InsertOneMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *InsertOneMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *InsertOneMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *InsertOneMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterInsertOneMethod(s) + } +} + +func (s *InsertOneMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitInsertOneMethod(s) + } +} + +func (s *InsertOneMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitInsertOneMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) InsertOneMethod() (localctx IInsertOneMethodContext) { + localctx = NewInsertOneMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 56, MongoShellParserRULE_insertOneMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(798) + p.Match(MongoShellParserINSERT_ONE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(799) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(800) + p.Arguments() + } + { + p.SetState(801) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IInsertManyMethodContext is an interface to support dynamic dispatch. +type IInsertManyMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + INSERT_MANY() antlr.TerminalNode + LPAREN() antlr.TerminalNode + Arguments() IArgumentsContext + RPAREN() antlr.TerminalNode + + // IsInsertManyMethodContext differentiates from other interfaces. + IsInsertManyMethodContext() +} + +type InsertManyMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyInsertManyMethodContext() *InsertManyMethodContext { + var p = new(InsertManyMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_insertManyMethod + return p +} + +func InitEmptyInsertManyMethodContext(p *InsertManyMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_insertManyMethod +} + +func (*InsertManyMethodContext) IsInsertManyMethodContext() {} + +func NewInsertManyMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *InsertManyMethodContext { + var p = new(InsertManyMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_insertManyMethod + + return p +} + +func (s *InsertManyMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *InsertManyMethodContext) INSERT_MANY() antlr.TerminalNode { + return s.GetToken(MongoShellParserINSERT_MANY, 0) +} + +func (s *InsertManyMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *InsertManyMethodContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *InsertManyMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *InsertManyMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *InsertManyMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *InsertManyMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterInsertManyMethod(s) + } +} + +func (s *InsertManyMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitInsertManyMethod(s) + } +} + +func (s *InsertManyMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitInsertManyMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) InsertManyMethod() (localctx IInsertManyMethodContext) { + localctx = NewInsertManyMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 58, MongoShellParserRULE_insertManyMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(803) + p.Match(MongoShellParserINSERT_MANY) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(804) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(805) + p.Arguments() + } + { + p.SetState(806) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IUpdateOneMethodContext is an interface to support dynamic dispatch. +type IUpdateOneMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + UPDATE_ONE() antlr.TerminalNode + LPAREN() antlr.TerminalNode + Arguments() IArgumentsContext + RPAREN() antlr.TerminalNode + + // IsUpdateOneMethodContext differentiates from other interfaces. + IsUpdateOneMethodContext() +} + +type UpdateOneMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyUpdateOneMethodContext() *UpdateOneMethodContext { + var p = new(UpdateOneMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_updateOneMethod + return p +} + +func InitEmptyUpdateOneMethodContext(p *UpdateOneMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_updateOneMethod +} + +func (*UpdateOneMethodContext) IsUpdateOneMethodContext() {} + +func NewUpdateOneMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *UpdateOneMethodContext { + var p = new(UpdateOneMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_updateOneMethod + + return p +} + +func (s *UpdateOneMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *UpdateOneMethodContext) UPDATE_ONE() antlr.TerminalNode { + return s.GetToken(MongoShellParserUPDATE_ONE, 0) +} + +func (s *UpdateOneMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *UpdateOneMethodContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *UpdateOneMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *UpdateOneMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *UpdateOneMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *UpdateOneMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterUpdateOneMethod(s) + } +} + +func (s *UpdateOneMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitUpdateOneMethod(s) + } +} + +func (s *UpdateOneMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitUpdateOneMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) UpdateOneMethod() (localctx IUpdateOneMethodContext) { + localctx = NewUpdateOneMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 60, MongoShellParserRULE_updateOneMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(808) + p.Match(MongoShellParserUPDATE_ONE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(809) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(810) + p.Arguments() + } + { + p.SetState(811) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IUpdateManyMethodContext is an interface to support dynamic dispatch. +type IUpdateManyMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + UPDATE_MANY() antlr.TerminalNode + LPAREN() antlr.TerminalNode + Arguments() IArgumentsContext + RPAREN() antlr.TerminalNode + + // IsUpdateManyMethodContext differentiates from other interfaces. + IsUpdateManyMethodContext() +} + +type UpdateManyMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyUpdateManyMethodContext() *UpdateManyMethodContext { + var p = new(UpdateManyMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_updateManyMethod + return p +} + +func InitEmptyUpdateManyMethodContext(p *UpdateManyMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_updateManyMethod +} + +func (*UpdateManyMethodContext) IsUpdateManyMethodContext() {} + +func NewUpdateManyMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *UpdateManyMethodContext { + var p = new(UpdateManyMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_updateManyMethod + + return p +} + +func (s *UpdateManyMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *UpdateManyMethodContext) UPDATE_MANY() antlr.TerminalNode { + return s.GetToken(MongoShellParserUPDATE_MANY, 0) +} + +func (s *UpdateManyMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *UpdateManyMethodContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *UpdateManyMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *UpdateManyMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *UpdateManyMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *UpdateManyMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterUpdateManyMethod(s) + } +} + +func (s *UpdateManyMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitUpdateManyMethod(s) + } +} + +func (s *UpdateManyMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitUpdateManyMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) UpdateManyMethod() (localctx IUpdateManyMethodContext) { + localctx = NewUpdateManyMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 62, MongoShellParserRULE_updateManyMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(813) + p.Match(MongoShellParserUPDATE_MANY) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(814) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(815) + p.Arguments() + } + { + p.SetState(816) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IDeleteOneMethodContext is an interface to support dynamic dispatch. +type IDeleteOneMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + DELETE_ONE() antlr.TerminalNode + LPAREN() antlr.TerminalNode + Arguments() IArgumentsContext + RPAREN() antlr.TerminalNode + + // IsDeleteOneMethodContext differentiates from other interfaces. + IsDeleteOneMethodContext() +} + +type DeleteOneMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDeleteOneMethodContext() *DeleteOneMethodContext { + var p = new(DeleteOneMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_deleteOneMethod + return p +} + +func InitEmptyDeleteOneMethodContext(p *DeleteOneMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_deleteOneMethod +} + +func (*DeleteOneMethodContext) IsDeleteOneMethodContext() {} + +func NewDeleteOneMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DeleteOneMethodContext { + var p = new(DeleteOneMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_deleteOneMethod + + return p +} + +func (s *DeleteOneMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *DeleteOneMethodContext) DELETE_ONE() antlr.TerminalNode { + return s.GetToken(MongoShellParserDELETE_ONE, 0) +} + +func (s *DeleteOneMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *DeleteOneMethodContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *DeleteOneMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *DeleteOneMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DeleteOneMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *DeleteOneMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterDeleteOneMethod(s) + } +} + +func (s *DeleteOneMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitDeleteOneMethod(s) + } +} + +func (s *DeleteOneMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitDeleteOneMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) DeleteOneMethod() (localctx IDeleteOneMethodContext) { + localctx = NewDeleteOneMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 64, MongoShellParserRULE_deleteOneMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(818) + p.Match(MongoShellParserDELETE_ONE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(819) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(820) + p.Arguments() + } + { + p.SetState(821) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IDeleteManyMethodContext is an interface to support dynamic dispatch. +type IDeleteManyMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + DELETE_MANY() antlr.TerminalNode + LPAREN() antlr.TerminalNode + Arguments() IArgumentsContext + RPAREN() antlr.TerminalNode + + // IsDeleteManyMethodContext differentiates from other interfaces. + IsDeleteManyMethodContext() +} + +type DeleteManyMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDeleteManyMethodContext() *DeleteManyMethodContext { + var p = new(DeleteManyMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_deleteManyMethod + return p +} + +func InitEmptyDeleteManyMethodContext(p *DeleteManyMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_deleteManyMethod +} + +func (*DeleteManyMethodContext) IsDeleteManyMethodContext() {} + +func NewDeleteManyMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DeleteManyMethodContext { + var p = new(DeleteManyMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_deleteManyMethod + + return p +} + +func (s *DeleteManyMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *DeleteManyMethodContext) DELETE_MANY() antlr.TerminalNode { + return s.GetToken(MongoShellParserDELETE_MANY, 0) +} + +func (s *DeleteManyMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *DeleteManyMethodContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *DeleteManyMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *DeleteManyMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DeleteManyMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *DeleteManyMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterDeleteManyMethod(s) + } +} + +func (s *DeleteManyMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitDeleteManyMethod(s) + } +} + +func (s *DeleteManyMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitDeleteManyMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) DeleteManyMethod() (localctx IDeleteManyMethodContext) { + localctx = NewDeleteManyMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 66, MongoShellParserRULE_deleteManyMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(823) + p.Match(MongoShellParserDELETE_MANY) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(824) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(825) + p.Arguments() + } + { + p.SetState(826) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IReplaceOneMethodContext is an interface to support dynamic dispatch. +type IReplaceOneMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + REPLACE_ONE() antlr.TerminalNode + LPAREN() antlr.TerminalNode + Arguments() IArgumentsContext + RPAREN() antlr.TerminalNode + + // IsReplaceOneMethodContext differentiates from other interfaces. + IsReplaceOneMethodContext() +} + +type ReplaceOneMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyReplaceOneMethodContext() *ReplaceOneMethodContext { + var p = new(ReplaceOneMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_replaceOneMethod + return p +} + +func InitEmptyReplaceOneMethodContext(p *ReplaceOneMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_replaceOneMethod +} + +func (*ReplaceOneMethodContext) IsReplaceOneMethodContext() {} + +func NewReplaceOneMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ReplaceOneMethodContext { + var p = new(ReplaceOneMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_replaceOneMethod + + return p +} + +func (s *ReplaceOneMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *ReplaceOneMethodContext) REPLACE_ONE() antlr.TerminalNode { + return s.GetToken(MongoShellParserREPLACE_ONE, 0) +} + +func (s *ReplaceOneMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ReplaceOneMethodContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *ReplaceOneMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ReplaceOneMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ReplaceOneMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ReplaceOneMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterReplaceOneMethod(s) + } +} + +func (s *ReplaceOneMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitReplaceOneMethod(s) + } +} + +func (s *ReplaceOneMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitReplaceOneMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) ReplaceOneMethod() (localctx IReplaceOneMethodContext) { + localctx = NewReplaceOneMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 68, MongoShellParserRULE_replaceOneMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(828) + p.Match(MongoShellParserREPLACE_ONE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(829) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(830) + p.Arguments() + } + { + p.SetState(831) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IFindOneAndUpdateMethodContext is an interface to support dynamic dispatch. +type IFindOneAndUpdateMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + FIND_ONE_AND_UPDATE() antlr.TerminalNode + LPAREN() antlr.TerminalNode + Arguments() IArgumentsContext + RPAREN() antlr.TerminalNode + + // IsFindOneAndUpdateMethodContext differentiates from other interfaces. + IsFindOneAndUpdateMethodContext() +} + +type FindOneAndUpdateMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyFindOneAndUpdateMethodContext() *FindOneAndUpdateMethodContext { + var p = new(FindOneAndUpdateMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_findOneAndUpdateMethod + return p +} + +func InitEmptyFindOneAndUpdateMethodContext(p *FindOneAndUpdateMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_findOneAndUpdateMethod +} + +func (*FindOneAndUpdateMethodContext) IsFindOneAndUpdateMethodContext() {} + +func NewFindOneAndUpdateMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *FindOneAndUpdateMethodContext { + var p = new(FindOneAndUpdateMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_findOneAndUpdateMethod + + return p +} + +func (s *FindOneAndUpdateMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *FindOneAndUpdateMethodContext) FIND_ONE_AND_UPDATE() antlr.TerminalNode { + return s.GetToken(MongoShellParserFIND_ONE_AND_UPDATE, 0) +} + +func (s *FindOneAndUpdateMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *FindOneAndUpdateMethodContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *FindOneAndUpdateMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *FindOneAndUpdateMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *FindOneAndUpdateMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *FindOneAndUpdateMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterFindOneAndUpdateMethod(s) + } +} + +func (s *FindOneAndUpdateMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitFindOneAndUpdateMethod(s) + } +} + +func (s *FindOneAndUpdateMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitFindOneAndUpdateMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) FindOneAndUpdateMethod() (localctx IFindOneAndUpdateMethodContext) { + localctx = NewFindOneAndUpdateMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 70, MongoShellParserRULE_findOneAndUpdateMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(833) + p.Match(MongoShellParserFIND_ONE_AND_UPDATE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(834) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(835) + p.Arguments() + } + { + p.SetState(836) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IFindOneAndReplaceMethodContext is an interface to support dynamic dispatch. +type IFindOneAndReplaceMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + FIND_ONE_AND_REPLACE() antlr.TerminalNode + LPAREN() antlr.TerminalNode + Arguments() IArgumentsContext + RPAREN() antlr.TerminalNode + + // IsFindOneAndReplaceMethodContext differentiates from other interfaces. + IsFindOneAndReplaceMethodContext() +} + +type FindOneAndReplaceMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyFindOneAndReplaceMethodContext() *FindOneAndReplaceMethodContext { + var p = new(FindOneAndReplaceMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_findOneAndReplaceMethod + return p +} + +func InitEmptyFindOneAndReplaceMethodContext(p *FindOneAndReplaceMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_findOneAndReplaceMethod +} + +func (*FindOneAndReplaceMethodContext) IsFindOneAndReplaceMethodContext() {} + +func NewFindOneAndReplaceMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *FindOneAndReplaceMethodContext { + var p = new(FindOneAndReplaceMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_findOneAndReplaceMethod + + return p +} + +func (s *FindOneAndReplaceMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *FindOneAndReplaceMethodContext) FIND_ONE_AND_REPLACE() antlr.TerminalNode { + return s.GetToken(MongoShellParserFIND_ONE_AND_REPLACE, 0) +} + +func (s *FindOneAndReplaceMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *FindOneAndReplaceMethodContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *FindOneAndReplaceMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *FindOneAndReplaceMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *FindOneAndReplaceMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *FindOneAndReplaceMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterFindOneAndReplaceMethod(s) + } +} + +func (s *FindOneAndReplaceMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitFindOneAndReplaceMethod(s) + } +} + +func (s *FindOneAndReplaceMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitFindOneAndReplaceMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) FindOneAndReplaceMethod() (localctx IFindOneAndReplaceMethodContext) { + localctx = NewFindOneAndReplaceMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 72, MongoShellParserRULE_findOneAndReplaceMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(838) + p.Match(MongoShellParserFIND_ONE_AND_REPLACE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(839) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(840) + p.Arguments() + } + { + p.SetState(841) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IFindOneAndDeleteMethodContext is an interface to support dynamic dispatch. +type IFindOneAndDeleteMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + FIND_ONE_AND_DELETE() antlr.TerminalNode + LPAREN() antlr.TerminalNode + Arguments() IArgumentsContext + RPAREN() antlr.TerminalNode + + // IsFindOneAndDeleteMethodContext differentiates from other interfaces. + IsFindOneAndDeleteMethodContext() +} + +type FindOneAndDeleteMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyFindOneAndDeleteMethodContext() *FindOneAndDeleteMethodContext { + var p = new(FindOneAndDeleteMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_findOneAndDeleteMethod + return p +} + +func InitEmptyFindOneAndDeleteMethodContext(p *FindOneAndDeleteMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_findOneAndDeleteMethod +} + +func (*FindOneAndDeleteMethodContext) IsFindOneAndDeleteMethodContext() {} + +func NewFindOneAndDeleteMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *FindOneAndDeleteMethodContext { + var p = new(FindOneAndDeleteMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_findOneAndDeleteMethod + + return p +} + +func (s *FindOneAndDeleteMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *FindOneAndDeleteMethodContext) FIND_ONE_AND_DELETE() antlr.TerminalNode { + return s.GetToken(MongoShellParserFIND_ONE_AND_DELETE, 0) +} + +func (s *FindOneAndDeleteMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *FindOneAndDeleteMethodContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *FindOneAndDeleteMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *FindOneAndDeleteMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *FindOneAndDeleteMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *FindOneAndDeleteMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterFindOneAndDeleteMethod(s) + } +} + +func (s *FindOneAndDeleteMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitFindOneAndDeleteMethod(s) + } +} + +func (s *FindOneAndDeleteMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitFindOneAndDeleteMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) FindOneAndDeleteMethod() (localctx IFindOneAndDeleteMethodContext) { + localctx = NewFindOneAndDeleteMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 74, MongoShellParserRULE_findOneAndDeleteMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(843) + p.Match(MongoShellParserFIND_ONE_AND_DELETE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(844) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(845) + p.Arguments() + } + { + p.SetState(846) + p.Match(MongoShellParserRPAREN) + 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 +} + +// ICreateIndexMethodContext is an interface to support dynamic dispatch. +type ICreateIndexMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + CREATE_INDEX() antlr.TerminalNode + LPAREN() antlr.TerminalNode + Arguments() IArgumentsContext + RPAREN() antlr.TerminalNode + + // IsCreateIndexMethodContext differentiates from other interfaces. + IsCreateIndexMethodContext() +} + +type CreateIndexMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyCreateIndexMethodContext() *CreateIndexMethodContext { + var p = new(CreateIndexMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_createIndexMethod + return p +} + +func InitEmptyCreateIndexMethodContext(p *CreateIndexMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_createIndexMethod +} + +func (*CreateIndexMethodContext) IsCreateIndexMethodContext() {} + +func NewCreateIndexMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CreateIndexMethodContext { + var p = new(CreateIndexMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_createIndexMethod + + return p +} + +func (s *CreateIndexMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *CreateIndexMethodContext) CREATE_INDEX() antlr.TerminalNode { + return s.GetToken(MongoShellParserCREATE_INDEX, 0) +} + +func (s *CreateIndexMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *CreateIndexMethodContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *CreateIndexMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *CreateIndexMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *CreateIndexMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *CreateIndexMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterCreateIndexMethod(s) + } +} + +func (s *CreateIndexMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitCreateIndexMethod(s) + } +} + +func (s *CreateIndexMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitCreateIndexMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) CreateIndexMethod() (localctx ICreateIndexMethodContext) { + localctx = NewCreateIndexMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 76, MongoShellParserRULE_createIndexMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(848) + p.Match(MongoShellParserCREATE_INDEX) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(849) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(850) + p.Arguments() + } + { + p.SetState(851) + p.Match(MongoShellParserRPAREN) + 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 +} + +// ICreateIndexesMethodContext is an interface to support dynamic dispatch. +type ICreateIndexesMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + CREATE_INDEXES() antlr.TerminalNode + LPAREN() antlr.TerminalNode + Arguments() IArgumentsContext + RPAREN() antlr.TerminalNode + + // IsCreateIndexesMethodContext differentiates from other interfaces. + IsCreateIndexesMethodContext() +} + +type CreateIndexesMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyCreateIndexesMethodContext() *CreateIndexesMethodContext { + var p = new(CreateIndexesMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_createIndexesMethod + return p +} + +func InitEmptyCreateIndexesMethodContext(p *CreateIndexesMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_createIndexesMethod +} + +func (*CreateIndexesMethodContext) IsCreateIndexesMethodContext() {} + +func NewCreateIndexesMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CreateIndexesMethodContext { + var p = new(CreateIndexesMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_createIndexesMethod + + return p +} + +func (s *CreateIndexesMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *CreateIndexesMethodContext) CREATE_INDEXES() antlr.TerminalNode { + return s.GetToken(MongoShellParserCREATE_INDEXES, 0) +} + +func (s *CreateIndexesMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *CreateIndexesMethodContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *CreateIndexesMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *CreateIndexesMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *CreateIndexesMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *CreateIndexesMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterCreateIndexesMethod(s) + } +} + +func (s *CreateIndexesMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitCreateIndexesMethod(s) + } +} + +func (s *CreateIndexesMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitCreateIndexesMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) CreateIndexesMethod() (localctx ICreateIndexesMethodContext) { + localctx = NewCreateIndexesMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 78, MongoShellParserRULE_createIndexesMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(853) + p.Match(MongoShellParserCREATE_INDEXES) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(854) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(855) + p.Arguments() + } + { + p.SetState(856) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IDropIndexMethodContext is an interface to support dynamic dispatch. +type IDropIndexMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + DROP_INDEX() antlr.TerminalNode + LPAREN() antlr.TerminalNode + Argument() IArgumentContext + RPAREN() antlr.TerminalNode + + // IsDropIndexMethodContext differentiates from other interfaces. + IsDropIndexMethodContext() +} + +type DropIndexMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDropIndexMethodContext() *DropIndexMethodContext { + var p = new(DropIndexMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_dropIndexMethod + return p +} + +func InitEmptyDropIndexMethodContext(p *DropIndexMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_dropIndexMethod +} + +func (*DropIndexMethodContext) IsDropIndexMethodContext() {} + +func NewDropIndexMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DropIndexMethodContext { + var p = new(DropIndexMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_dropIndexMethod + + return p +} + +func (s *DropIndexMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *DropIndexMethodContext) DROP_INDEX() antlr.TerminalNode { + return s.GetToken(MongoShellParserDROP_INDEX, 0) +} + +func (s *DropIndexMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *DropIndexMethodContext) Argument() IArgumentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentContext) +} + +func (s *DropIndexMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *DropIndexMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DropIndexMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *DropIndexMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterDropIndexMethod(s) + } +} + +func (s *DropIndexMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitDropIndexMethod(s) + } +} + +func (s *DropIndexMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitDropIndexMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) DropIndexMethod() (localctx IDropIndexMethodContext) { + localctx = NewDropIndexMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 80, MongoShellParserRULE_dropIndexMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(858) + p.Match(MongoShellParserDROP_INDEX) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(859) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(860) + p.Argument() + } + { + p.SetState(861) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IDropIndexesMethodContext is an interface to support dynamic dispatch. +type IDropIndexesMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + DROP_INDEXES() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + Argument() IArgumentContext + + // IsDropIndexesMethodContext differentiates from other interfaces. + IsDropIndexesMethodContext() +} + +type DropIndexesMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDropIndexesMethodContext() *DropIndexesMethodContext { + var p = new(DropIndexesMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_dropIndexesMethod + return p +} + +func InitEmptyDropIndexesMethodContext(p *DropIndexesMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_dropIndexesMethod +} + +func (*DropIndexesMethodContext) IsDropIndexesMethodContext() {} + +func NewDropIndexesMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DropIndexesMethodContext { + var p = new(DropIndexesMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_dropIndexesMethod + + return p +} + +func (s *DropIndexesMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *DropIndexesMethodContext) DROP_INDEXES() antlr.TerminalNode { + return s.GetToken(MongoShellParserDROP_INDEXES, 0) +} + +func (s *DropIndexesMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *DropIndexesMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *DropIndexesMethodContext) Argument() IArgumentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentContext) +} + +func (s *DropIndexesMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DropIndexesMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *DropIndexesMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterDropIndexesMethod(s) + } +} + +func (s *DropIndexesMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitDropIndexesMethod(s) + } +} + +func (s *DropIndexesMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitDropIndexesMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) DropIndexesMethod() (localctx IDropIndexesMethodContext) { + localctx = NewDropIndexesMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 82, MongoShellParserRULE_dropIndexesMethod) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(863) + p.Match(MongoShellParserDROP_INDEXES) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(864) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(866) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(865) + p.Argument() + } + + } + { + p.SetState(868) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IDropMethodContext is an interface to support dynamic dispatch. +type IDropMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + DROP() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + Argument() IArgumentContext + + // IsDropMethodContext differentiates from other interfaces. + IsDropMethodContext() +} + +type DropMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDropMethodContext() *DropMethodContext { + var p = new(DropMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_dropMethod + return p +} + +func InitEmptyDropMethodContext(p *DropMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_dropMethod +} + +func (*DropMethodContext) IsDropMethodContext() {} + +func NewDropMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DropMethodContext { + var p = new(DropMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_dropMethod + + return p +} + +func (s *DropMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *DropMethodContext) DROP() antlr.TerminalNode { + return s.GetToken(MongoShellParserDROP, 0) +} + +func (s *DropMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *DropMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *DropMethodContext) Argument() IArgumentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentContext) +} + +func (s *DropMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DropMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *DropMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterDropMethod(s) + } +} + +func (s *DropMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitDropMethod(s) + } +} + +func (s *DropMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitDropMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) DropMethod() (localctx IDropMethodContext) { + localctx = NewDropMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 84, MongoShellParserRULE_dropMethod) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(870) + p.Match(MongoShellParserDROP) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(871) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(873) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(872) + p.Argument() + } + + } + { + p.SetState(875) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IRenameCollectionMethodContext is an interface to support dynamic dispatch. +type IRenameCollectionMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + RENAME_COLLECTION() antlr.TerminalNode + LPAREN() antlr.TerminalNode + Arguments() IArgumentsContext + RPAREN() antlr.TerminalNode + + // IsRenameCollectionMethodContext differentiates from other interfaces. + IsRenameCollectionMethodContext() +} + +type RenameCollectionMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyRenameCollectionMethodContext() *RenameCollectionMethodContext { + var p = new(RenameCollectionMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_renameCollectionMethod + return p +} + +func InitEmptyRenameCollectionMethodContext(p *RenameCollectionMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_renameCollectionMethod +} + +func (*RenameCollectionMethodContext) IsRenameCollectionMethodContext() {} + +func NewRenameCollectionMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *RenameCollectionMethodContext { + var p = new(RenameCollectionMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_renameCollectionMethod + + return p +} + +func (s *RenameCollectionMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *RenameCollectionMethodContext) RENAME_COLLECTION() antlr.TerminalNode { + return s.GetToken(MongoShellParserRENAME_COLLECTION, 0) +} + +func (s *RenameCollectionMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *RenameCollectionMethodContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *RenameCollectionMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *RenameCollectionMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *RenameCollectionMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *RenameCollectionMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterRenameCollectionMethod(s) + } +} + +func (s *RenameCollectionMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitRenameCollectionMethod(s) + } +} + +func (s *RenameCollectionMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitRenameCollectionMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) RenameCollectionMethod() (localctx IRenameCollectionMethodContext) { + localctx = NewRenameCollectionMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 86, MongoShellParserRULE_renameCollectionMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(877) + p.Match(MongoShellParserRENAME_COLLECTION) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(878) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(879) + p.Arguments() + } + { + p.SetState(880) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IStatsMethodContext is an interface to support dynamic dispatch. +type IStatsMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + STATS() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + Argument() IArgumentContext + + // IsStatsMethodContext differentiates from other interfaces. + IsStatsMethodContext() +} + +type StatsMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyStatsMethodContext() *StatsMethodContext { + var p = new(StatsMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_statsMethod + return p +} + +func InitEmptyStatsMethodContext(p *StatsMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_statsMethod +} + +func (*StatsMethodContext) IsStatsMethodContext() {} + +func NewStatsMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StatsMethodContext { + var p = new(StatsMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_statsMethod + + return p +} + +func (s *StatsMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *StatsMethodContext) STATS() antlr.TerminalNode { + return s.GetToken(MongoShellParserSTATS, 0) +} + +func (s *StatsMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *StatsMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *StatsMethodContext) Argument() IArgumentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentContext) +} + +func (s *StatsMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *StatsMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *StatsMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterStatsMethod(s) + } +} + +func (s *StatsMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitStatsMethod(s) + } +} + +func (s *StatsMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitStatsMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) StatsMethod() (localctx IStatsMethodContext) { + localctx = NewStatsMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 88, MongoShellParserRULE_statsMethod) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(882) + p.Match(MongoShellParserSTATS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(883) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(885) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(884) + p.Argument() + } + + } + { + p.SetState(887) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IStorageSizeMethodContext is an interface to support dynamic dispatch. +type IStorageSizeMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + STORAGE_SIZE() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + + // IsStorageSizeMethodContext differentiates from other interfaces. + IsStorageSizeMethodContext() +} + +type StorageSizeMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyStorageSizeMethodContext() *StorageSizeMethodContext { + var p = new(StorageSizeMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_storageSizeMethod + return p +} + +func InitEmptyStorageSizeMethodContext(p *StorageSizeMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_storageSizeMethod +} + +func (*StorageSizeMethodContext) IsStorageSizeMethodContext() {} + +func NewStorageSizeMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StorageSizeMethodContext { + var p = new(StorageSizeMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_storageSizeMethod + + return p +} + +func (s *StorageSizeMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *StorageSizeMethodContext) STORAGE_SIZE() antlr.TerminalNode { + return s.GetToken(MongoShellParserSTORAGE_SIZE, 0) +} + +func (s *StorageSizeMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *StorageSizeMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *StorageSizeMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *StorageSizeMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *StorageSizeMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterStorageSizeMethod(s) + } +} + +func (s *StorageSizeMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitStorageSizeMethod(s) + } +} + +func (s *StorageSizeMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitStorageSizeMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) StorageSizeMethod() (localctx IStorageSizeMethodContext) { + localctx = NewStorageSizeMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 90, MongoShellParserRULE_storageSizeMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(889) + p.Match(MongoShellParserSTORAGE_SIZE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(890) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(891) + p.Match(MongoShellParserRPAREN) + 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 +} + +// ITotalIndexSizeMethodContext is an interface to support dynamic dispatch. +type ITotalIndexSizeMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + TOTAL_INDEX_SIZE() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + + // IsTotalIndexSizeMethodContext differentiates from other interfaces. + IsTotalIndexSizeMethodContext() +} + +type TotalIndexSizeMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyTotalIndexSizeMethodContext() *TotalIndexSizeMethodContext { + var p = new(TotalIndexSizeMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_totalIndexSizeMethod + return p +} + +func InitEmptyTotalIndexSizeMethodContext(p *TotalIndexSizeMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_totalIndexSizeMethod +} + +func (*TotalIndexSizeMethodContext) IsTotalIndexSizeMethodContext() {} + +func NewTotalIndexSizeMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TotalIndexSizeMethodContext { + var p = new(TotalIndexSizeMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_totalIndexSizeMethod + + return p +} + +func (s *TotalIndexSizeMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *TotalIndexSizeMethodContext) TOTAL_INDEX_SIZE() antlr.TerminalNode { + return s.GetToken(MongoShellParserTOTAL_INDEX_SIZE, 0) +} + +func (s *TotalIndexSizeMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *TotalIndexSizeMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *TotalIndexSizeMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TotalIndexSizeMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *TotalIndexSizeMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterTotalIndexSizeMethod(s) + } +} + +func (s *TotalIndexSizeMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitTotalIndexSizeMethod(s) + } +} + +func (s *TotalIndexSizeMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitTotalIndexSizeMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) TotalIndexSizeMethod() (localctx ITotalIndexSizeMethodContext) { + localctx = NewTotalIndexSizeMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 92, MongoShellParserRULE_totalIndexSizeMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(893) + p.Match(MongoShellParserTOTAL_INDEX_SIZE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(894) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(895) + p.Match(MongoShellParserRPAREN) + 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 +} + +// ITotalSizeMethodContext is an interface to support dynamic dispatch. +type ITotalSizeMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + TOTAL_SIZE() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + + // IsTotalSizeMethodContext differentiates from other interfaces. + IsTotalSizeMethodContext() +} + +type TotalSizeMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyTotalSizeMethodContext() *TotalSizeMethodContext { + var p = new(TotalSizeMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_totalSizeMethod + return p +} + +func InitEmptyTotalSizeMethodContext(p *TotalSizeMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_totalSizeMethod +} + +func (*TotalSizeMethodContext) IsTotalSizeMethodContext() {} + +func NewTotalSizeMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TotalSizeMethodContext { + var p = new(TotalSizeMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_totalSizeMethod + + return p +} + +func (s *TotalSizeMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *TotalSizeMethodContext) TOTAL_SIZE() antlr.TerminalNode { + return s.GetToken(MongoShellParserTOTAL_SIZE, 0) +} + +func (s *TotalSizeMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *TotalSizeMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *TotalSizeMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TotalSizeMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *TotalSizeMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterTotalSizeMethod(s) + } +} + +func (s *TotalSizeMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitTotalSizeMethod(s) + } +} + +func (s *TotalSizeMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitTotalSizeMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) TotalSizeMethod() (localctx ITotalSizeMethodContext) { + localctx = NewTotalSizeMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 94, MongoShellParserRULE_totalSizeMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(897) + p.Match(MongoShellParserTOTAL_SIZE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(898) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(899) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IDataSizeMethodContext is an interface to support dynamic dispatch. +type IDataSizeMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + DATA_SIZE() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + + // IsDataSizeMethodContext differentiates from other interfaces. + IsDataSizeMethodContext() +} + +type DataSizeMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyDataSizeMethodContext() *DataSizeMethodContext { + var p = new(DataSizeMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_dataSizeMethod + return p +} + +func InitEmptyDataSizeMethodContext(p *DataSizeMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_dataSizeMethod +} + +func (*DataSizeMethodContext) IsDataSizeMethodContext() {} + +func NewDataSizeMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DataSizeMethodContext { + var p = new(DataSizeMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_dataSizeMethod + + return p +} + +func (s *DataSizeMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *DataSizeMethodContext) DATA_SIZE() antlr.TerminalNode { + return s.GetToken(MongoShellParserDATA_SIZE, 0) +} + +func (s *DataSizeMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *DataSizeMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *DataSizeMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *DataSizeMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *DataSizeMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterDataSizeMethod(s) + } +} + +func (s *DataSizeMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitDataSizeMethod(s) + } +} + +func (s *DataSizeMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitDataSizeMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) DataSizeMethod() (localctx IDataSizeMethodContext) { + localctx = NewDataSizeMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 96, MongoShellParserRULE_dataSizeMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(901) + p.Match(MongoShellParserDATA_SIZE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(902) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(903) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IIsCappedMethodContext is an interface to support dynamic dispatch. +type IIsCappedMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + IS_CAPPED() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + + // IsIsCappedMethodContext differentiates from other interfaces. + IsIsCappedMethodContext() +} + +type IsCappedMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyIsCappedMethodContext() *IsCappedMethodContext { + var p = new(IsCappedMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_isCappedMethod + return p +} + +func InitEmptyIsCappedMethodContext(p *IsCappedMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_isCappedMethod +} + +func (*IsCappedMethodContext) IsIsCappedMethodContext() {} + +func NewIsCappedMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IsCappedMethodContext { + var p = new(IsCappedMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_isCappedMethod + + return p +} + +func (s *IsCappedMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *IsCappedMethodContext) IS_CAPPED() antlr.TerminalNode { + return s.GetToken(MongoShellParserIS_CAPPED, 0) +} + +func (s *IsCappedMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *IsCappedMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *IsCappedMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *IsCappedMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *IsCappedMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterIsCappedMethod(s) + } +} + +func (s *IsCappedMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitIsCappedMethod(s) + } +} + +func (s *IsCappedMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitIsCappedMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) IsCappedMethod() (localctx IIsCappedMethodContext) { + localctx = NewIsCappedMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 98, MongoShellParserRULE_isCappedMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(905) + p.Match(MongoShellParserIS_CAPPED) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(906) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(907) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IValidateMethodContext is an interface to support dynamic dispatch. +type IValidateMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + VALIDATE() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + Argument() IArgumentContext + + // IsValidateMethodContext differentiates from other interfaces. + IsValidateMethodContext() +} + +type ValidateMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyValidateMethodContext() *ValidateMethodContext { + var p = new(ValidateMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_validateMethod + return p +} + +func InitEmptyValidateMethodContext(p *ValidateMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_validateMethod +} + +func (*ValidateMethodContext) IsValidateMethodContext() {} + +func NewValidateMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ValidateMethodContext { + var p = new(ValidateMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_validateMethod + + return p +} + +func (s *ValidateMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *ValidateMethodContext) VALIDATE() antlr.TerminalNode { + return s.GetToken(MongoShellParserVALIDATE, 0) +} + +func (s *ValidateMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ValidateMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ValidateMethodContext) Argument() IArgumentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentContext) +} + +func (s *ValidateMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ValidateMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ValidateMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterValidateMethod(s) + } +} + +func (s *ValidateMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitValidateMethod(s) + } +} + +func (s *ValidateMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitValidateMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) ValidateMethod() (localctx IValidateMethodContext) { + localctx = NewValidateMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 100, MongoShellParserRULE_validateMethod) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(909) + p.Match(MongoShellParserVALIDATE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(910) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(912) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(911) + p.Argument() + } + + } + { + p.SetState(914) + p.Match(MongoShellParserRPAREN) + 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 +} + +// ILatencyStatsMethodContext is an interface to support dynamic dispatch. +type ILatencyStatsMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + LATENCY_STATS() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + Argument() IArgumentContext + + // IsLatencyStatsMethodContext differentiates from other interfaces. + IsLatencyStatsMethodContext() +} + +type LatencyStatsMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyLatencyStatsMethodContext() *LatencyStatsMethodContext { + var p = new(LatencyStatsMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_latencyStatsMethod + return p +} + +func InitEmptyLatencyStatsMethodContext(p *LatencyStatsMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_latencyStatsMethod +} + +func (*LatencyStatsMethodContext) IsLatencyStatsMethodContext() {} + +func NewLatencyStatsMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LatencyStatsMethodContext { + var p = new(LatencyStatsMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_latencyStatsMethod + + return p +} + +func (s *LatencyStatsMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *LatencyStatsMethodContext) LATENCY_STATS() antlr.TerminalNode { + return s.GetToken(MongoShellParserLATENCY_STATS, 0) +} + +func (s *LatencyStatsMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *LatencyStatsMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *LatencyStatsMethodContext) Argument() IArgumentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentContext) +} + +func (s *LatencyStatsMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *LatencyStatsMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *LatencyStatsMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterLatencyStatsMethod(s) + } +} + +func (s *LatencyStatsMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitLatencyStatsMethod(s) + } +} + +func (s *LatencyStatsMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitLatencyStatsMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) LatencyStatsMethod() (localctx ILatencyStatsMethodContext) { + localctx = NewLatencyStatsMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 102, MongoShellParserRULE_latencyStatsMethod) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(916) + p.Match(MongoShellParserLATENCY_STATS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(917) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(919) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(918) + p.Argument() + } + + } + { + p.SetState(921) + p.Match(MongoShellParserRPAREN) + 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 +} + +// ISortMethodContext is an interface to support dynamic dispatch. +type ISortMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + SORT() antlr.TerminalNode + LPAREN() antlr.TerminalNode + Document() IDocumentContext + RPAREN() antlr.TerminalNode + + // IsSortMethodContext differentiates from other interfaces. + IsSortMethodContext() +} + +type SortMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptySortMethodContext() *SortMethodContext { + var p = new(SortMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_sortMethod + return p +} + +func InitEmptySortMethodContext(p *SortMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_sortMethod +} + +func (*SortMethodContext) IsSortMethodContext() {} + +func NewSortMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SortMethodContext { + var p = new(SortMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_sortMethod + + return p +} + +func (s *SortMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *SortMethodContext) SORT() antlr.TerminalNode { + return s.GetToken(MongoShellParserSORT, 0) +} + +func (s *SortMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *SortMethodContext) Document() IDocumentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDocumentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IDocumentContext) +} + +func (s *SortMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *SortMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *SortMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *SortMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterSortMethod(s) + } +} + +func (s *SortMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitSortMethod(s) + } +} + +func (s *SortMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitSortMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) SortMethod() (localctx ISortMethodContext) { + localctx = NewSortMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 104, MongoShellParserRULE_sortMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(923) + p.Match(MongoShellParserSORT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(924) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(925) + p.Document() + } + { + p.SetState(926) + p.Match(MongoShellParserRPAREN) + 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 +} + +// ILimitMethodContext is an interface to support dynamic dispatch. +type ILimitMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + LIMIT() antlr.TerminalNode + LPAREN() antlr.TerminalNode + NUMBER() antlr.TerminalNode + RPAREN() antlr.TerminalNode + + // IsLimitMethodContext differentiates from other interfaces. + IsLimitMethodContext() +} + +type LimitMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyLimitMethodContext() *LimitMethodContext { + var p = new(LimitMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_limitMethod + return p +} + +func InitEmptyLimitMethodContext(p *LimitMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_limitMethod +} + +func (*LimitMethodContext) IsLimitMethodContext() {} + +func NewLimitMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LimitMethodContext { + var p = new(LimitMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_limitMethod + + return p +} + +func (s *LimitMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *LimitMethodContext) LIMIT() antlr.TerminalNode { + return s.GetToken(MongoShellParserLIMIT, 0) +} + +func (s *LimitMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *LimitMethodContext) NUMBER() antlr.TerminalNode { + return s.GetToken(MongoShellParserNUMBER, 0) +} + +func (s *LimitMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *LimitMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *LimitMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *LimitMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterLimitMethod(s) + } +} + +func (s *LimitMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitLimitMethod(s) + } +} + +func (s *LimitMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitLimitMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) LimitMethod() (localctx ILimitMethodContext) { + localctx = NewLimitMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 106, MongoShellParserRULE_limitMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(928) + p.Match(MongoShellParserLIMIT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(929) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(930) + p.Match(MongoShellParserNUMBER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(931) + p.Match(MongoShellParserRPAREN) + 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 +} + +// ISkipMethodContext is an interface to support dynamic dispatch. +type ISkipMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + SKIP_() antlr.TerminalNode + LPAREN() antlr.TerminalNode + NUMBER() antlr.TerminalNode + RPAREN() antlr.TerminalNode + + // IsSkipMethodContext differentiates from other interfaces. + IsSkipMethodContext() +} + +type SkipMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptySkipMethodContext() *SkipMethodContext { + var p = new(SkipMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_skipMethod + return p +} + +func InitEmptySkipMethodContext(p *SkipMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_skipMethod +} + +func (*SkipMethodContext) IsSkipMethodContext() {} + +func NewSkipMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SkipMethodContext { + var p = new(SkipMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_skipMethod + + return p +} + +func (s *SkipMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *SkipMethodContext) SKIP_() antlr.TerminalNode { + return s.GetToken(MongoShellParserSKIP_, 0) +} + +func (s *SkipMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *SkipMethodContext) NUMBER() antlr.TerminalNode { + return s.GetToken(MongoShellParserNUMBER, 0) +} + +func (s *SkipMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *SkipMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *SkipMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *SkipMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterSkipMethod(s) + } +} + +func (s *SkipMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitSkipMethod(s) + } +} + +func (s *SkipMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitSkipMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) SkipMethod() (localctx ISkipMethodContext) { + localctx = NewSkipMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 108, MongoShellParserRULE_skipMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(933) + p.Match(MongoShellParserSKIP_) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(934) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(935) + p.Match(MongoShellParserNUMBER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(936) + p.Match(MongoShellParserRPAREN) + 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 +} + +// ICountMethodContext is an interface to support dynamic dispatch. +type ICountMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + COUNT() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + + // IsCountMethodContext differentiates from other interfaces. + IsCountMethodContext() +} + +type CountMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyCountMethodContext() *CountMethodContext { + var p = new(CountMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_countMethod + return p +} + +func InitEmptyCountMethodContext(p *CountMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_countMethod +} + +func (*CountMethodContext) IsCountMethodContext() {} + +func NewCountMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CountMethodContext { + var p = new(CountMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_countMethod + + return p +} + +func (s *CountMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *CountMethodContext) COUNT() antlr.TerminalNode { + return s.GetToken(MongoShellParserCOUNT, 0) +} + +func (s *CountMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *CountMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *CountMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *CountMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *CountMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterCountMethod(s) + } +} + +func (s *CountMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitCountMethod(s) + } +} + +func (s *CountMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitCountMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) CountMethod() (localctx ICountMethodContext) { + localctx = NewCountMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 110, MongoShellParserRULE_countMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(938) + p.Match(MongoShellParserCOUNT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(939) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(940) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IProjectionMethodContext is an interface to support dynamic dispatch. +type IProjectionMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + LPAREN() antlr.TerminalNode + Document() IDocumentContext + RPAREN() antlr.TerminalNode + PROJECTION() antlr.TerminalNode + PROJECT() antlr.TerminalNode + + // IsProjectionMethodContext differentiates from other interfaces. + IsProjectionMethodContext() +} + +type ProjectionMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyProjectionMethodContext() *ProjectionMethodContext { + var p = new(ProjectionMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_projectionMethod + return p +} + +func InitEmptyProjectionMethodContext(p *ProjectionMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_projectionMethod +} + +func (*ProjectionMethodContext) IsProjectionMethodContext() {} + +func NewProjectionMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ProjectionMethodContext { + var p = new(ProjectionMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_projectionMethod + + return p +} + +func (s *ProjectionMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *ProjectionMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ProjectionMethodContext) Document() IDocumentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDocumentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IDocumentContext) +} + +func (s *ProjectionMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ProjectionMethodContext) PROJECTION() antlr.TerminalNode { + return s.GetToken(MongoShellParserPROJECTION, 0) +} + +func (s *ProjectionMethodContext) PROJECT() antlr.TerminalNode { + return s.GetToken(MongoShellParserPROJECT, 0) +} + +func (s *ProjectionMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ProjectionMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ProjectionMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterProjectionMethod(s) + } +} + +func (s *ProjectionMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitProjectionMethod(s) + } +} + +func (s *ProjectionMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitProjectionMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) ProjectionMethod() (localctx IProjectionMethodContext) { + localctx = NewProjectionMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 112, MongoShellParserRULE_projectionMethod) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(942) + _la = p.GetTokenStream().LA(1) + + if !(_la == MongoShellParserPROJECTION || _la == MongoShellParserPROJECT) { + p.GetErrorHandler().RecoverInline(p) + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + { + p.SetState(943) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(944) + p.Document() + } + { + p.SetState(945) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IBatchSizeMethodContext is an interface to support dynamic dispatch. +type IBatchSizeMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + BATCH_SIZE() antlr.TerminalNode + LPAREN() antlr.TerminalNode + NUMBER() antlr.TerminalNode + RPAREN() antlr.TerminalNode + + // IsBatchSizeMethodContext differentiates from other interfaces. + IsBatchSizeMethodContext() +} + +type BatchSizeMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyBatchSizeMethodContext() *BatchSizeMethodContext { + var p = new(BatchSizeMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_batchSizeMethod + return p +} + +func InitEmptyBatchSizeMethodContext(p *BatchSizeMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_batchSizeMethod +} + +func (*BatchSizeMethodContext) IsBatchSizeMethodContext() {} + +func NewBatchSizeMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BatchSizeMethodContext { + var p = new(BatchSizeMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_batchSizeMethod + + return p +} + +func (s *BatchSizeMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *BatchSizeMethodContext) BATCH_SIZE() antlr.TerminalNode { + return s.GetToken(MongoShellParserBATCH_SIZE, 0) +} + +func (s *BatchSizeMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *BatchSizeMethodContext) NUMBER() antlr.TerminalNode { + return s.GetToken(MongoShellParserNUMBER, 0) +} + +func (s *BatchSizeMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *BatchSizeMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *BatchSizeMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *BatchSizeMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterBatchSizeMethod(s) + } +} + +func (s *BatchSizeMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitBatchSizeMethod(s) + } +} + +func (s *BatchSizeMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitBatchSizeMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) BatchSizeMethod() (localctx IBatchSizeMethodContext) { + localctx = NewBatchSizeMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 114, MongoShellParserRULE_batchSizeMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(947) + p.Match(MongoShellParserBATCH_SIZE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(948) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(949) + p.Match(MongoShellParserNUMBER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(950) + p.Match(MongoShellParserRPAREN) + 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 +} + +// ICloseMethodContext is an interface to support dynamic dispatch. +type ICloseMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + CLOSE() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + + // IsCloseMethodContext differentiates from other interfaces. + IsCloseMethodContext() +} + +type CloseMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyCloseMethodContext() *CloseMethodContext { + var p = new(CloseMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_closeMethod + return p +} + +func InitEmptyCloseMethodContext(p *CloseMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_closeMethod +} + +func (*CloseMethodContext) IsCloseMethodContext() {} + +func NewCloseMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CloseMethodContext { + var p = new(CloseMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_closeMethod + + return p +} + +func (s *CloseMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *CloseMethodContext) CLOSE() antlr.TerminalNode { + return s.GetToken(MongoShellParserCLOSE, 0) +} + +func (s *CloseMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *CloseMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *CloseMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *CloseMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *CloseMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterCloseMethod(s) + } +} + +func (s *CloseMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitCloseMethod(s) + } +} + +func (s *CloseMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitCloseMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) CloseMethod() (localctx ICloseMethodContext) { + localctx = NewCloseMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 116, MongoShellParserRULE_closeMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(952) + p.Match(MongoShellParserCLOSE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(953) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(954) + p.Match(MongoShellParserRPAREN) + 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 +} + +// ICollationMethodContext is an interface to support dynamic dispatch. +type ICollationMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + COLLATION() antlr.TerminalNode + LPAREN() antlr.TerminalNode + Document() IDocumentContext + RPAREN() antlr.TerminalNode + + // IsCollationMethodContext differentiates from other interfaces. + IsCollationMethodContext() +} + +type CollationMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyCollationMethodContext() *CollationMethodContext { + var p = new(CollationMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_collationMethod + return p +} + +func InitEmptyCollationMethodContext(p *CollationMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_collationMethod +} + +func (*CollationMethodContext) IsCollationMethodContext() {} + +func NewCollationMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CollationMethodContext { + var p = new(CollationMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_collationMethod + + return p +} + +func (s *CollationMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *CollationMethodContext) COLLATION() antlr.TerminalNode { + return s.GetToken(MongoShellParserCOLLATION, 0) +} + +func (s *CollationMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *CollationMethodContext) Document() IDocumentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDocumentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IDocumentContext) +} + +func (s *CollationMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *CollationMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *CollationMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *CollationMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterCollationMethod(s) + } +} + +func (s *CollationMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitCollationMethod(s) + } +} + +func (s *CollationMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitCollationMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) CollationMethod() (localctx ICollationMethodContext) { + localctx = NewCollationMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 118, MongoShellParserRULE_collationMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(956) + p.Match(MongoShellParserCOLLATION) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(957) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(958) + p.Document() + } + { + p.SetState(959) + p.Match(MongoShellParserRPAREN) + 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 +} + +// ICommentMethodContext is an interface to support dynamic dispatch. +type ICommentMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + COMMENT() antlr.TerminalNode + LPAREN() antlr.TerminalNode + StringLiteral() IStringLiteralContext + RPAREN() antlr.TerminalNode + + // IsCommentMethodContext differentiates from other interfaces. + IsCommentMethodContext() +} + +type CommentMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyCommentMethodContext() *CommentMethodContext { + var p = new(CommentMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_commentMethod + return p +} + +func InitEmptyCommentMethodContext(p *CommentMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_commentMethod +} + +func (*CommentMethodContext) IsCommentMethodContext() {} + +func NewCommentMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CommentMethodContext { + var p = new(CommentMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_commentMethod + + return p +} + +func (s *CommentMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *CommentMethodContext) COMMENT() antlr.TerminalNode { + return s.GetToken(MongoShellParserCOMMENT, 0) +} + +func (s *CommentMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *CommentMethodContext) StringLiteral() IStringLiteralContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IStringLiteralContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IStringLiteralContext) +} + +func (s *CommentMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *CommentMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *CommentMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *CommentMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterCommentMethod(s) + } +} + +func (s *CommentMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitCommentMethod(s) + } +} + +func (s *CommentMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitCommentMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) CommentMethod() (localctx ICommentMethodContext) { + localctx = NewCommentMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 120, MongoShellParserRULE_commentMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(961) + p.Match(MongoShellParserCOMMENT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(962) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(963) + p.StringLiteral() + } + { + p.SetState(964) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IExplainMethodContext is an interface to support dynamic dispatch. +type IExplainMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + EXPLAIN() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + StringLiteral() IStringLiteralContext + + // IsExplainMethodContext differentiates from other interfaces. + IsExplainMethodContext() +} + +type ExplainMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyExplainMethodContext() *ExplainMethodContext { + var p = new(ExplainMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_explainMethod + return p +} + +func InitEmptyExplainMethodContext(p *ExplainMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_explainMethod +} + +func (*ExplainMethodContext) IsExplainMethodContext() {} + +func NewExplainMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExplainMethodContext { + var p = new(ExplainMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_explainMethod + + return p +} + +func (s *ExplainMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *ExplainMethodContext) EXPLAIN() antlr.TerminalNode { + return s.GetToken(MongoShellParserEXPLAIN, 0) +} + +func (s *ExplainMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ExplainMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ExplainMethodContext) StringLiteral() IStringLiteralContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IStringLiteralContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IStringLiteralContext) +} + +func (s *ExplainMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ExplainMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ExplainMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterExplainMethod(s) + } +} + +func (s *ExplainMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitExplainMethod(s) + } +} + +func (s *ExplainMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitExplainMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) ExplainMethod() (localctx IExplainMethodContext) { + localctx = NewExplainMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 122, MongoShellParserRULE_explainMethod) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(966) + p.Match(MongoShellParserEXPLAIN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(967) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(969) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == MongoShellParserDOUBLE_QUOTED_STRING || _la == MongoShellParserSINGLE_QUOTED_STRING { + { + p.SetState(968) + p.StringLiteral() + } + + } + { + p.SetState(971) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IForEachMethodContext is an interface to support dynamic dispatch. +type IForEachMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + FOR_EACH() antlr.TerminalNode + LPAREN() antlr.TerminalNode + Argument() IArgumentContext + RPAREN() antlr.TerminalNode + + // IsForEachMethodContext differentiates from other interfaces. + IsForEachMethodContext() +} + +type ForEachMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyForEachMethodContext() *ForEachMethodContext { + var p = new(ForEachMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_forEachMethod + return p +} + +func InitEmptyForEachMethodContext(p *ForEachMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_forEachMethod +} + +func (*ForEachMethodContext) IsForEachMethodContext() {} + +func NewForEachMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ForEachMethodContext { + var p = new(ForEachMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_forEachMethod + + return p +} + +func (s *ForEachMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *ForEachMethodContext) FOR_EACH() antlr.TerminalNode { + return s.GetToken(MongoShellParserFOR_EACH, 0) +} + +func (s *ForEachMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ForEachMethodContext) Argument() IArgumentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentContext) +} + +func (s *ForEachMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ForEachMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ForEachMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ForEachMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterForEachMethod(s) + } +} + +func (s *ForEachMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitForEachMethod(s) + } +} + +func (s *ForEachMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitForEachMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) ForEachMethod() (localctx IForEachMethodContext) { + localctx = NewForEachMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 124, MongoShellParserRULE_forEachMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(973) + p.Match(MongoShellParserFOR_EACH) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(974) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(975) + p.Argument() + } + { + p.SetState(976) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IHasNextMethodContext is an interface to support dynamic dispatch. +type IHasNextMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + HAS_NEXT() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + + // IsHasNextMethodContext differentiates from other interfaces. + IsHasNextMethodContext() +} + +type HasNextMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyHasNextMethodContext() *HasNextMethodContext { + var p = new(HasNextMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_hasNextMethod + return p +} + +func InitEmptyHasNextMethodContext(p *HasNextMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_hasNextMethod +} + +func (*HasNextMethodContext) IsHasNextMethodContext() {} + +func NewHasNextMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *HasNextMethodContext { + var p = new(HasNextMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_hasNextMethod + + return p +} + +func (s *HasNextMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *HasNextMethodContext) HAS_NEXT() antlr.TerminalNode { + return s.GetToken(MongoShellParserHAS_NEXT, 0) +} + +func (s *HasNextMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *HasNextMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *HasNextMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *HasNextMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *HasNextMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterHasNextMethod(s) + } +} + +func (s *HasNextMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitHasNextMethod(s) + } +} + +func (s *HasNextMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitHasNextMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) HasNextMethod() (localctx IHasNextMethodContext) { + localctx = NewHasNextMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 126, MongoShellParserRULE_hasNextMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(978) + p.Match(MongoShellParserHAS_NEXT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(979) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(980) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IHintMethodContext is an interface to support dynamic dispatch. +type IHintMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + HINT() antlr.TerminalNode + LPAREN() antlr.TerminalNode + Argument() IArgumentContext + RPAREN() antlr.TerminalNode + + // IsHintMethodContext differentiates from other interfaces. + IsHintMethodContext() +} + +type HintMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyHintMethodContext() *HintMethodContext { + var p = new(HintMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_hintMethod + return p +} + +func InitEmptyHintMethodContext(p *HintMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_hintMethod +} + +func (*HintMethodContext) IsHintMethodContext() {} + +func NewHintMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *HintMethodContext { + var p = new(HintMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_hintMethod + + return p +} + +func (s *HintMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *HintMethodContext) HINT() antlr.TerminalNode { + return s.GetToken(MongoShellParserHINT, 0) +} + +func (s *HintMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *HintMethodContext) Argument() IArgumentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentContext) +} + +func (s *HintMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *HintMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *HintMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *HintMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterHintMethod(s) + } +} + +func (s *HintMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitHintMethod(s) + } +} + +func (s *HintMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitHintMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) HintMethod() (localctx IHintMethodContext) { + localctx = NewHintMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 128, MongoShellParserRULE_hintMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(982) + p.Match(MongoShellParserHINT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(983) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(984) + p.Argument() + } + { + p.SetState(985) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IIsClosedMethodContext is an interface to support dynamic dispatch. +type IIsClosedMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + IS_CLOSED() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + + // IsIsClosedMethodContext differentiates from other interfaces. + IsIsClosedMethodContext() +} + +type IsClosedMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyIsClosedMethodContext() *IsClosedMethodContext { + var p = new(IsClosedMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_isClosedMethod + return p +} + +func InitEmptyIsClosedMethodContext(p *IsClosedMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_isClosedMethod +} + +func (*IsClosedMethodContext) IsIsClosedMethodContext() {} + +func NewIsClosedMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IsClosedMethodContext { + var p = new(IsClosedMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_isClosedMethod + + return p +} + +func (s *IsClosedMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *IsClosedMethodContext) IS_CLOSED() antlr.TerminalNode { + return s.GetToken(MongoShellParserIS_CLOSED, 0) +} + +func (s *IsClosedMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *IsClosedMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *IsClosedMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *IsClosedMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *IsClosedMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterIsClosedMethod(s) + } +} + +func (s *IsClosedMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitIsClosedMethod(s) + } +} + +func (s *IsClosedMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitIsClosedMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) IsClosedMethod() (localctx IIsClosedMethodContext) { + localctx = NewIsClosedMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 130, MongoShellParserRULE_isClosedMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(987) + p.Match(MongoShellParserIS_CLOSED) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(988) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(989) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IIsExhaustedMethodContext is an interface to support dynamic dispatch. +type IIsExhaustedMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + IS_EXHAUSTED() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + + // IsIsExhaustedMethodContext differentiates from other interfaces. + IsIsExhaustedMethodContext() +} + +type IsExhaustedMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyIsExhaustedMethodContext() *IsExhaustedMethodContext { + var p = new(IsExhaustedMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_isExhaustedMethod + return p +} + +func InitEmptyIsExhaustedMethodContext(p *IsExhaustedMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_isExhaustedMethod +} + +func (*IsExhaustedMethodContext) IsIsExhaustedMethodContext() {} + +func NewIsExhaustedMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IsExhaustedMethodContext { + var p = new(IsExhaustedMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_isExhaustedMethod + + return p +} + +func (s *IsExhaustedMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *IsExhaustedMethodContext) IS_EXHAUSTED() antlr.TerminalNode { + return s.GetToken(MongoShellParserIS_EXHAUSTED, 0) +} + +func (s *IsExhaustedMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *IsExhaustedMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *IsExhaustedMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *IsExhaustedMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *IsExhaustedMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterIsExhaustedMethod(s) + } +} + +func (s *IsExhaustedMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitIsExhaustedMethod(s) + } +} + +func (s *IsExhaustedMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitIsExhaustedMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) IsExhaustedMethod() (localctx IIsExhaustedMethodContext) { + localctx = NewIsExhaustedMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 132, MongoShellParserRULE_isExhaustedMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(991) + p.Match(MongoShellParserIS_EXHAUSTED) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(992) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(993) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IItcountMethodContext is an interface to support dynamic dispatch. +type IItcountMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + IT_COUNT() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + + // IsItcountMethodContext differentiates from other interfaces. + IsItcountMethodContext() +} + +type ItcountMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyItcountMethodContext() *ItcountMethodContext { + var p = new(ItcountMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_itcountMethod + return p +} + +func InitEmptyItcountMethodContext(p *ItcountMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_itcountMethod +} + +func (*ItcountMethodContext) IsItcountMethodContext() {} + +func NewItcountMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ItcountMethodContext { + var p = new(ItcountMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_itcountMethod + + return p +} + +func (s *ItcountMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *ItcountMethodContext) IT_COUNT() antlr.TerminalNode { + return s.GetToken(MongoShellParserIT_COUNT, 0) +} + +func (s *ItcountMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ItcountMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ItcountMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ItcountMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ItcountMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterItcountMethod(s) + } +} + +func (s *ItcountMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitItcountMethod(s) + } +} + +func (s *ItcountMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitItcountMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) ItcountMethod() (localctx IItcountMethodContext) { + localctx = NewItcountMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 134, MongoShellParserRULE_itcountMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(995) + p.Match(MongoShellParserIT_COUNT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(996) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(997) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IMapMethodContext is an interface to support dynamic dispatch. +type IMapMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + MAP() antlr.TerminalNode + LPAREN() antlr.TerminalNode + Argument() IArgumentContext + RPAREN() antlr.TerminalNode + + // IsMapMethodContext differentiates from other interfaces. + IsMapMethodContext() +} + +type MapMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyMapMethodContext() *MapMethodContext { + var p = new(MapMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_mapMethod + return p +} + +func InitEmptyMapMethodContext(p *MapMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_mapMethod +} + +func (*MapMethodContext) IsMapMethodContext() {} + +func NewMapMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MapMethodContext { + var p = new(MapMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_mapMethod + + return p +} + +func (s *MapMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *MapMethodContext) MAP() antlr.TerminalNode { + return s.GetToken(MongoShellParserMAP, 0) +} + +func (s *MapMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *MapMethodContext) Argument() IArgumentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentContext) +} + +func (s *MapMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *MapMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *MapMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *MapMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterMapMethod(s) + } +} + +func (s *MapMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitMapMethod(s) + } +} + +func (s *MapMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitMapMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) MapMethod() (localctx IMapMethodContext) { + localctx = NewMapMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 136, MongoShellParserRULE_mapMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(999) + p.Match(MongoShellParserMAP) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1000) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1001) + p.Argument() + } + { + p.SetState(1002) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IMaxMethodContext is an interface to support dynamic dispatch. +type IMaxMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + MAX() antlr.TerminalNode + LPAREN() antlr.TerminalNode + Document() IDocumentContext + RPAREN() antlr.TerminalNode + + // IsMaxMethodContext differentiates from other interfaces. + IsMaxMethodContext() +} + +type MaxMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyMaxMethodContext() *MaxMethodContext { + var p = new(MaxMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_maxMethod + return p +} + +func InitEmptyMaxMethodContext(p *MaxMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_maxMethod +} + +func (*MaxMethodContext) IsMaxMethodContext() {} + +func NewMaxMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MaxMethodContext { + var p = new(MaxMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_maxMethod + + return p +} + +func (s *MaxMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *MaxMethodContext) MAX() antlr.TerminalNode { + return s.GetToken(MongoShellParserMAX, 0) +} + +func (s *MaxMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *MaxMethodContext) Document() IDocumentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDocumentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IDocumentContext) +} + +func (s *MaxMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *MaxMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *MaxMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *MaxMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterMaxMethod(s) + } +} + +func (s *MaxMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitMaxMethod(s) + } +} + +func (s *MaxMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitMaxMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) MaxMethod() (localctx IMaxMethodContext) { + localctx = NewMaxMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 138, MongoShellParserRULE_maxMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1004) + p.Match(MongoShellParserMAX) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1005) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1006) + p.Document() + } + { + p.SetState(1007) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IMaxAwaitTimeMSMethodContext is an interface to support dynamic dispatch. +type IMaxAwaitTimeMSMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + MAX_AWAIT_TIME_MS() antlr.TerminalNode + LPAREN() antlr.TerminalNode + NUMBER() antlr.TerminalNode + RPAREN() antlr.TerminalNode + + // IsMaxAwaitTimeMSMethodContext differentiates from other interfaces. + IsMaxAwaitTimeMSMethodContext() +} + +type MaxAwaitTimeMSMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyMaxAwaitTimeMSMethodContext() *MaxAwaitTimeMSMethodContext { + var p = new(MaxAwaitTimeMSMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_maxAwaitTimeMSMethod + return p +} + +func InitEmptyMaxAwaitTimeMSMethodContext(p *MaxAwaitTimeMSMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_maxAwaitTimeMSMethod +} + +func (*MaxAwaitTimeMSMethodContext) IsMaxAwaitTimeMSMethodContext() {} + +func NewMaxAwaitTimeMSMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MaxAwaitTimeMSMethodContext { + var p = new(MaxAwaitTimeMSMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_maxAwaitTimeMSMethod + + return p +} + +func (s *MaxAwaitTimeMSMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *MaxAwaitTimeMSMethodContext) MAX_AWAIT_TIME_MS() antlr.TerminalNode { + return s.GetToken(MongoShellParserMAX_AWAIT_TIME_MS, 0) +} + +func (s *MaxAwaitTimeMSMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *MaxAwaitTimeMSMethodContext) NUMBER() antlr.TerminalNode { + return s.GetToken(MongoShellParserNUMBER, 0) +} + +func (s *MaxAwaitTimeMSMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *MaxAwaitTimeMSMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *MaxAwaitTimeMSMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *MaxAwaitTimeMSMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterMaxAwaitTimeMSMethod(s) + } +} + +func (s *MaxAwaitTimeMSMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitMaxAwaitTimeMSMethod(s) + } +} + +func (s *MaxAwaitTimeMSMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitMaxAwaitTimeMSMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) MaxAwaitTimeMSMethod() (localctx IMaxAwaitTimeMSMethodContext) { + localctx = NewMaxAwaitTimeMSMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 140, MongoShellParserRULE_maxAwaitTimeMSMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1009) + p.Match(MongoShellParserMAX_AWAIT_TIME_MS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1010) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1011) + p.Match(MongoShellParserNUMBER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1012) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IMaxTimeMSMethodContext is an interface to support dynamic dispatch. +type IMaxTimeMSMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + MAX_TIME_MS() antlr.TerminalNode + LPAREN() antlr.TerminalNode + NUMBER() antlr.TerminalNode + RPAREN() antlr.TerminalNode + + // IsMaxTimeMSMethodContext differentiates from other interfaces. + IsMaxTimeMSMethodContext() +} + +type MaxTimeMSMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyMaxTimeMSMethodContext() *MaxTimeMSMethodContext { + var p = new(MaxTimeMSMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_maxTimeMSMethod + return p +} + +func InitEmptyMaxTimeMSMethodContext(p *MaxTimeMSMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_maxTimeMSMethod +} + +func (*MaxTimeMSMethodContext) IsMaxTimeMSMethodContext() {} + +func NewMaxTimeMSMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MaxTimeMSMethodContext { + var p = new(MaxTimeMSMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_maxTimeMSMethod + + return p +} + +func (s *MaxTimeMSMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *MaxTimeMSMethodContext) MAX_TIME_MS() antlr.TerminalNode { + return s.GetToken(MongoShellParserMAX_TIME_MS, 0) +} + +func (s *MaxTimeMSMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *MaxTimeMSMethodContext) NUMBER() antlr.TerminalNode { + return s.GetToken(MongoShellParserNUMBER, 0) +} + +func (s *MaxTimeMSMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *MaxTimeMSMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *MaxTimeMSMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *MaxTimeMSMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterMaxTimeMSMethod(s) + } +} + +func (s *MaxTimeMSMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitMaxTimeMSMethod(s) + } +} + +func (s *MaxTimeMSMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitMaxTimeMSMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) MaxTimeMSMethod() (localctx IMaxTimeMSMethodContext) { + localctx = NewMaxTimeMSMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 142, MongoShellParserRULE_maxTimeMSMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1014) + p.Match(MongoShellParserMAX_TIME_MS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1015) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1016) + p.Match(MongoShellParserNUMBER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1017) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IMinMethodContext is an interface to support dynamic dispatch. +type IMinMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + MIN() antlr.TerminalNode + LPAREN() antlr.TerminalNode + Document() IDocumentContext + RPAREN() antlr.TerminalNode + + // IsMinMethodContext differentiates from other interfaces. + IsMinMethodContext() +} + +type MinMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyMinMethodContext() *MinMethodContext { + var p = new(MinMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_minMethod + return p +} + +func InitEmptyMinMethodContext(p *MinMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_minMethod +} + +func (*MinMethodContext) IsMinMethodContext() {} + +func NewMinMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MinMethodContext { + var p = new(MinMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_minMethod + + return p +} + +func (s *MinMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *MinMethodContext) MIN() antlr.TerminalNode { + return s.GetToken(MongoShellParserMIN, 0) +} + +func (s *MinMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *MinMethodContext) Document() IDocumentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDocumentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IDocumentContext) +} + +func (s *MinMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *MinMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *MinMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *MinMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterMinMethod(s) + } +} + +func (s *MinMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitMinMethod(s) + } +} + +func (s *MinMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitMinMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) MinMethod() (localctx IMinMethodContext) { + localctx = NewMinMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 144, MongoShellParserRULE_minMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1019) + p.Match(MongoShellParserMIN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1020) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1021) + p.Document() + } + { + p.SetState(1022) + p.Match(MongoShellParserRPAREN) + 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 +} + +// INextMethodContext is an interface to support dynamic dispatch. +type INextMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + NEXT() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + + // IsNextMethodContext differentiates from other interfaces. + IsNextMethodContext() +} + +type NextMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyNextMethodContext() *NextMethodContext { + var p = new(NextMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_nextMethod + return p +} + +func InitEmptyNextMethodContext(p *NextMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_nextMethod +} + +func (*NextMethodContext) IsNextMethodContext() {} + +func NewNextMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *NextMethodContext { + var p = new(NextMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_nextMethod + + return p +} + +func (s *NextMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *NextMethodContext) NEXT() antlr.TerminalNode { + return s.GetToken(MongoShellParserNEXT, 0) +} + +func (s *NextMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *NextMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *NextMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *NextMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *NextMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterNextMethod(s) + } +} + +func (s *NextMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitNextMethod(s) + } +} + +func (s *NextMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitNextMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) NextMethod() (localctx INextMethodContext) { + localctx = NewNextMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 146, MongoShellParserRULE_nextMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1024) + p.Match(MongoShellParserNEXT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1025) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1026) + p.Match(MongoShellParserRPAREN) + 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 +} + +// INoCursorTimeoutMethodContext is an interface to support dynamic dispatch. +type INoCursorTimeoutMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + NO_CURSOR_TIMEOUT() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + + // IsNoCursorTimeoutMethodContext differentiates from other interfaces. + IsNoCursorTimeoutMethodContext() +} + +type NoCursorTimeoutMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyNoCursorTimeoutMethodContext() *NoCursorTimeoutMethodContext { + var p = new(NoCursorTimeoutMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_noCursorTimeoutMethod + return p +} + +func InitEmptyNoCursorTimeoutMethodContext(p *NoCursorTimeoutMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_noCursorTimeoutMethod +} + +func (*NoCursorTimeoutMethodContext) IsNoCursorTimeoutMethodContext() {} + +func NewNoCursorTimeoutMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *NoCursorTimeoutMethodContext { + var p = new(NoCursorTimeoutMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_noCursorTimeoutMethod + + return p +} + +func (s *NoCursorTimeoutMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *NoCursorTimeoutMethodContext) NO_CURSOR_TIMEOUT() antlr.TerminalNode { + return s.GetToken(MongoShellParserNO_CURSOR_TIMEOUT, 0) +} + +func (s *NoCursorTimeoutMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *NoCursorTimeoutMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *NoCursorTimeoutMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *NoCursorTimeoutMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *NoCursorTimeoutMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterNoCursorTimeoutMethod(s) + } +} + +func (s *NoCursorTimeoutMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitNoCursorTimeoutMethod(s) + } +} + +func (s *NoCursorTimeoutMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitNoCursorTimeoutMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) NoCursorTimeoutMethod() (localctx INoCursorTimeoutMethodContext) { + localctx = NewNoCursorTimeoutMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 148, MongoShellParserRULE_noCursorTimeoutMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1028) + p.Match(MongoShellParserNO_CURSOR_TIMEOUT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1029) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1030) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IObjsLeftInBatchMethodContext is an interface to support dynamic dispatch. +type IObjsLeftInBatchMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + OBJS_LEFT_IN_BATCH() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + + // IsObjsLeftInBatchMethodContext differentiates from other interfaces. + IsObjsLeftInBatchMethodContext() +} + +type ObjsLeftInBatchMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyObjsLeftInBatchMethodContext() *ObjsLeftInBatchMethodContext { + var p = new(ObjsLeftInBatchMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_objsLeftInBatchMethod + return p +} + +func InitEmptyObjsLeftInBatchMethodContext(p *ObjsLeftInBatchMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_objsLeftInBatchMethod +} + +func (*ObjsLeftInBatchMethodContext) IsObjsLeftInBatchMethodContext() {} + +func NewObjsLeftInBatchMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ObjsLeftInBatchMethodContext { + var p = new(ObjsLeftInBatchMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_objsLeftInBatchMethod + + return p +} + +func (s *ObjsLeftInBatchMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *ObjsLeftInBatchMethodContext) OBJS_LEFT_IN_BATCH() antlr.TerminalNode { + return s.GetToken(MongoShellParserOBJS_LEFT_IN_BATCH, 0) +} + +func (s *ObjsLeftInBatchMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ObjsLeftInBatchMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ObjsLeftInBatchMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ObjsLeftInBatchMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ObjsLeftInBatchMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterObjsLeftInBatchMethod(s) + } +} + +func (s *ObjsLeftInBatchMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitObjsLeftInBatchMethod(s) + } +} + +func (s *ObjsLeftInBatchMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitObjsLeftInBatchMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) ObjsLeftInBatchMethod() (localctx IObjsLeftInBatchMethodContext) { + localctx = NewObjsLeftInBatchMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 150, MongoShellParserRULE_objsLeftInBatchMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1032) + p.Match(MongoShellParserOBJS_LEFT_IN_BATCH) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1033) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1034) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IPrettyMethodContext is an interface to support dynamic dispatch. +type IPrettyMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + PRETTY() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + + // IsPrettyMethodContext differentiates from other interfaces. + IsPrettyMethodContext() +} + +type PrettyMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyPrettyMethodContext() *PrettyMethodContext { + var p = new(PrettyMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_prettyMethod + return p +} + +func InitEmptyPrettyMethodContext(p *PrettyMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_prettyMethod +} + +func (*PrettyMethodContext) IsPrettyMethodContext() {} + +func NewPrettyMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PrettyMethodContext { + var p = new(PrettyMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_prettyMethod + + return p +} + +func (s *PrettyMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *PrettyMethodContext) PRETTY() antlr.TerminalNode { + return s.GetToken(MongoShellParserPRETTY, 0) +} + +func (s *PrettyMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *PrettyMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *PrettyMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *PrettyMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *PrettyMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterPrettyMethod(s) + } +} + +func (s *PrettyMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitPrettyMethod(s) + } +} + +func (s *PrettyMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitPrettyMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) PrettyMethod() (localctx IPrettyMethodContext) { + localctx = NewPrettyMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 152, MongoShellParserRULE_prettyMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1036) + p.Match(MongoShellParserPRETTY) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1037) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1038) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IReadConcernMethodContext is an interface to support dynamic dispatch. +type IReadConcernMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + READ_CONCERN() antlr.TerminalNode + LPAREN() antlr.TerminalNode + Document() IDocumentContext + RPAREN() antlr.TerminalNode + + // IsReadConcernMethodContext differentiates from other interfaces. + IsReadConcernMethodContext() +} + +type ReadConcernMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyReadConcernMethodContext() *ReadConcernMethodContext { + var p = new(ReadConcernMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_readConcernMethod + return p +} + +func InitEmptyReadConcernMethodContext(p *ReadConcernMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_readConcernMethod +} + +func (*ReadConcernMethodContext) IsReadConcernMethodContext() {} + +func NewReadConcernMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ReadConcernMethodContext { + var p = new(ReadConcernMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_readConcernMethod + + return p +} + +func (s *ReadConcernMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *ReadConcernMethodContext) READ_CONCERN() antlr.TerminalNode { + return s.GetToken(MongoShellParserREAD_CONCERN, 0) +} + +func (s *ReadConcernMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ReadConcernMethodContext) Document() IDocumentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDocumentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IDocumentContext) +} + +func (s *ReadConcernMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ReadConcernMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ReadConcernMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ReadConcernMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterReadConcernMethod(s) + } +} + +func (s *ReadConcernMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitReadConcernMethod(s) + } +} + +func (s *ReadConcernMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitReadConcernMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) ReadConcernMethod() (localctx IReadConcernMethodContext) { + localctx = NewReadConcernMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 154, MongoShellParserRULE_readConcernMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1040) + p.Match(MongoShellParserREAD_CONCERN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1041) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1042) + p.Document() + } + { + p.SetState(1043) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IReadPrefMethodContext is an interface to support dynamic dispatch. +type IReadPrefMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + READ_PREF() antlr.TerminalNode + LPAREN() antlr.TerminalNode + Arguments() IArgumentsContext + RPAREN() antlr.TerminalNode + + // IsReadPrefMethodContext differentiates from other interfaces. + IsReadPrefMethodContext() +} + +type ReadPrefMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyReadPrefMethodContext() *ReadPrefMethodContext { + var p = new(ReadPrefMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_readPrefMethod + return p +} + +func InitEmptyReadPrefMethodContext(p *ReadPrefMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_readPrefMethod +} + +func (*ReadPrefMethodContext) IsReadPrefMethodContext() {} + +func NewReadPrefMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ReadPrefMethodContext { + var p = new(ReadPrefMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_readPrefMethod + + return p +} + +func (s *ReadPrefMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *ReadPrefMethodContext) READ_PREF() antlr.TerminalNode { + return s.GetToken(MongoShellParserREAD_PREF, 0) +} + +func (s *ReadPrefMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ReadPrefMethodContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *ReadPrefMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ReadPrefMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ReadPrefMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ReadPrefMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterReadPrefMethod(s) + } +} + +func (s *ReadPrefMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitReadPrefMethod(s) + } +} + +func (s *ReadPrefMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitReadPrefMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) ReadPrefMethod() (localctx IReadPrefMethodContext) { + localctx = NewReadPrefMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 156, MongoShellParserRULE_readPrefMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1045) + p.Match(MongoShellParserREAD_PREF) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1046) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1047) + p.Arguments() + } + { + p.SetState(1048) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IReturnKeyMethodContext is an interface to support dynamic dispatch. +type IReturnKeyMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + RETURN_KEY() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + TRUE() antlr.TerminalNode + FALSE() antlr.TerminalNode + + // IsReturnKeyMethodContext differentiates from other interfaces. + IsReturnKeyMethodContext() +} + +type ReturnKeyMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyReturnKeyMethodContext() *ReturnKeyMethodContext { + var p = new(ReturnKeyMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_returnKeyMethod + return p +} + +func InitEmptyReturnKeyMethodContext(p *ReturnKeyMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_returnKeyMethod +} + +func (*ReturnKeyMethodContext) IsReturnKeyMethodContext() {} + +func NewReturnKeyMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ReturnKeyMethodContext { + var p = new(ReturnKeyMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_returnKeyMethod + + return p +} + +func (s *ReturnKeyMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *ReturnKeyMethodContext) RETURN_KEY() antlr.TerminalNode { + return s.GetToken(MongoShellParserRETURN_KEY, 0) +} + +func (s *ReturnKeyMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ReturnKeyMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ReturnKeyMethodContext) TRUE() antlr.TerminalNode { + return s.GetToken(MongoShellParserTRUE, 0) +} + +func (s *ReturnKeyMethodContext) FALSE() antlr.TerminalNode { + return s.GetToken(MongoShellParserFALSE, 0) +} + +func (s *ReturnKeyMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ReturnKeyMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ReturnKeyMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterReturnKeyMethod(s) + } +} + +func (s *ReturnKeyMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitReturnKeyMethod(s) + } +} + +func (s *ReturnKeyMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitReturnKeyMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) ReturnKeyMethod() (localctx IReturnKeyMethodContext) { + localctx = NewReturnKeyMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 158, MongoShellParserRULE_returnKeyMethod) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1050) + p.Match(MongoShellParserRETURN_KEY) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1051) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1052) + _la = p.GetTokenStream().LA(1) + + if !(_la == MongoShellParserTRUE || _la == MongoShellParserFALSE) { + p.GetErrorHandler().RecoverInline(p) + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + { + p.SetState(1053) + p.Match(MongoShellParserRPAREN) + 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 +} + +// IShowRecordIdMethodContext is an interface to support dynamic dispatch. +type IShowRecordIdMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + SHOW_RECORD_ID() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + TRUE() antlr.TerminalNode + FALSE() antlr.TerminalNode + + // IsShowRecordIdMethodContext differentiates from other interfaces. + IsShowRecordIdMethodContext() +} + +type ShowRecordIdMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyShowRecordIdMethodContext() *ShowRecordIdMethodContext { + var p = new(ShowRecordIdMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_showRecordIdMethod + return p +} + +func InitEmptyShowRecordIdMethodContext(p *ShowRecordIdMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_showRecordIdMethod +} + +func (*ShowRecordIdMethodContext) IsShowRecordIdMethodContext() {} + +func NewShowRecordIdMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ShowRecordIdMethodContext { + var p = new(ShowRecordIdMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_showRecordIdMethod + + return p +} + +func (s *ShowRecordIdMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *ShowRecordIdMethodContext) SHOW_RECORD_ID() antlr.TerminalNode { + return s.GetToken(MongoShellParserSHOW_RECORD_ID, 0) +} + +func (s *ShowRecordIdMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ShowRecordIdMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ShowRecordIdMethodContext) TRUE() antlr.TerminalNode { + return s.GetToken(MongoShellParserTRUE, 0) +} + +func (s *ShowRecordIdMethodContext) FALSE() antlr.TerminalNode { + return s.GetToken(MongoShellParserFALSE, 0) +} + +func (s *ShowRecordIdMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ShowRecordIdMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *ShowRecordIdMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterShowRecordIdMethod(s) + } +} + +func (s *ShowRecordIdMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitShowRecordIdMethod(s) + } +} + +func (s *ShowRecordIdMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitShowRecordIdMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) ShowRecordIdMethod() (localctx IShowRecordIdMethodContext) { + localctx = NewShowRecordIdMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 160, MongoShellParserRULE_showRecordIdMethod) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1055) + p.Match(MongoShellParserSHOW_RECORD_ID) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1056) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1057) + _la = p.GetTokenStream().LA(1) + + if !(_la == MongoShellParserTRUE || _la == MongoShellParserFALSE) { + p.GetErrorHandler().RecoverInline(p) + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + { + p.SetState(1058) + p.Match(MongoShellParserRPAREN) + 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 +} + +// ISizeMethodContext is an interface to support dynamic dispatch. +type ISizeMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + SIZE() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + + // IsSizeMethodContext differentiates from other interfaces. + IsSizeMethodContext() +} + +type SizeMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptySizeMethodContext() *SizeMethodContext { + var p = new(SizeMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_sizeMethod + return p +} + +func InitEmptySizeMethodContext(p *SizeMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_sizeMethod +} + +func (*SizeMethodContext) IsSizeMethodContext() {} + +func NewSizeMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SizeMethodContext { + var p = new(SizeMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_sizeMethod + + return p +} + +func (s *SizeMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *SizeMethodContext) SIZE() antlr.TerminalNode { + return s.GetToken(MongoShellParserSIZE, 0) +} + +func (s *SizeMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *SizeMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *SizeMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *SizeMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *SizeMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterSizeMethod(s) + } +} + +func (s *SizeMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitSizeMethod(s) + } +} + +func (s *SizeMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitSizeMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) SizeMethod() (localctx ISizeMethodContext) { + localctx = NewSizeMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 162, MongoShellParserRULE_sizeMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1060) + p.Match(MongoShellParserSIZE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1061) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1062) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + +errorExit: + if p.HasError() { v := p.GetError() localctx.SetException(v) p.GetErrorHandler().ReportError(p, v) @@ -2446,151 +20952,415 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IFindMethodContext is an interface to support dynamic dispatch. -type IFindMethodContext interface { +// ITailableMethodContext is an interface to support dynamic dispatch. +type ITailableMethodContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - FIND() antlr.TerminalNode + TAILABLE() antlr.TerminalNode LPAREN() antlr.TerminalNode RPAREN() antlr.TerminalNode - Argument() IArgumentContext + TRUE() antlr.TerminalNode + FALSE() antlr.TerminalNode - // IsFindMethodContext differentiates from other interfaces. - IsFindMethodContext() + // IsTailableMethodContext differentiates from other interfaces. + IsTailableMethodContext() } -type FindMethodContext struct { +type TailableMethodContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyFindMethodContext() *FindMethodContext { - var p = new(FindMethodContext) +func NewEmptyTailableMethodContext() *TailableMethodContext { + var p = new(TailableMethodContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_findMethod + p.RuleIndex = MongoShellParserRULE_tailableMethod return p } -func InitEmptyFindMethodContext(p *FindMethodContext) { +func InitEmptyTailableMethodContext(p *TailableMethodContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_findMethod + p.RuleIndex = MongoShellParserRULE_tailableMethod } -func (*FindMethodContext) IsFindMethodContext() {} +func (*TailableMethodContext) IsTailableMethodContext() {} -func NewFindMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *FindMethodContext { - var p = new(FindMethodContext) +func NewTailableMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TailableMethodContext { + var p = new(TailableMethodContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = MongoShellParserRULE_findMethod + p.RuleIndex = MongoShellParserRULE_tailableMethod return p } -func (s *FindMethodContext) GetParser() antlr.Parser { return s.parser } +func (s *TailableMethodContext) GetParser() antlr.Parser { return s.parser } -func (s *FindMethodContext) FIND() antlr.TerminalNode { - return s.GetToken(MongoShellParserFIND, 0) +func (s *TailableMethodContext) TAILABLE() antlr.TerminalNode { + return s.GetToken(MongoShellParserTAILABLE, 0) } -func (s *FindMethodContext) LPAREN() antlr.TerminalNode { +func (s *TailableMethodContext) LPAREN() antlr.TerminalNode { return s.GetToken(MongoShellParserLPAREN, 0) } -func (s *FindMethodContext) RPAREN() antlr.TerminalNode { +func (s *TailableMethodContext) RPAREN() antlr.TerminalNode { return s.GetToken(MongoShellParserRPAREN, 0) } -func (s *FindMethodContext) Argument() IArgumentContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IArgumentContext); ok { - t = ctx.(antlr.RuleContext) - break +func (s *TailableMethodContext) TRUE() antlr.TerminalNode { + return s.GetToken(MongoShellParserTRUE, 0) +} + +func (s *TailableMethodContext) FALSE() antlr.TerminalNode { + return s.GetToken(MongoShellParserFALSE, 0) +} + +func (s *TailableMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TailableMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *TailableMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterTailableMethod(s) + } +} + +func (s *TailableMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitTailableMethod(s) + } +} + +func (s *TailableMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitTailableMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) TailableMethod() (localctx ITailableMethodContext) { + localctx = NewTailableMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 164, MongoShellParserRULE_tailableMethod) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1064) + p.Match(MongoShellParserTAILABLE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1065) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit } } + p.SetState(1067) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) - if t == nil { - return nil + if _la == MongoShellParserTRUE || _la == MongoShellParserFALSE { + { + p.SetState(1066) + _la = p.GetTokenStream().LA(1) + + if !(_la == MongoShellParserTRUE || _la == MongoShellParserFALSE) { + p.GetErrorHandler().RecoverInline(p) + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + + } + { + p.SetState(1069) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - return t.(IArgumentContext) +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 (s *FindMethodContext) GetRuleContext() antlr.RuleContext { +// IToArrayMethodContext is an interface to support dynamic dispatch. +type IToArrayMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + TO_ARRAY() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + + // IsToArrayMethodContext differentiates from other interfaces. + IsToArrayMethodContext() +} + +type ToArrayMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyToArrayMethodContext() *ToArrayMethodContext { + var p = new(ToArrayMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_toArrayMethod + return p +} + +func InitEmptyToArrayMethodContext(p *ToArrayMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_toArrayMethod +} + +func (*ToArrayMethodContext) IsToArrayMethodContext() {} + +func NewToArrayMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ToArrayMethodContext { + var p = new(ToArrayMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_toArrayMethod + + return p +} + +func (s *ToArrayMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *ToArrayMethodContext) TO_ARRAY() antlr.TerminalNode { + return s.GetToken(MongoShellParserTO_ARRAY, 0) +} + +func (s *ToArrayMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *ToArrayMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *ToArrayMethodContext) GetRuleContext() antlr.RuleContext { return s } -func (s *FindMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *ToArrayMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *FindMethodContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *ToArrayMethodContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterToArrayMethod(s) + } +} + +func (s *ToArrayMethodContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitToArrayMethod(s) + } +} + +func (s *ToArrayMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitToArrayMethod(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) ToArrayMethod() (localctx IToArrayMethodContext) { + localctx = NewToArrayMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 166, MongoShellParserRULE_toArrayMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1071) + p.Match(MongoShellParserTO_ARRAY) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1072) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1073) + p.Match(MongoShellParserRPAREN) + 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 +} + +// ITryNextMethodContext is an interface to support dynamic dispatch. +type ITryNextMethodContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + TRY_NEXT() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + + // IsTryNextMethodContext differentiates from other interfaces. + IsTryNextMethodContext() +} + +type TryNextMethodContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyTryNextMethodContext() *TryNextMethodContext { + var p = new(TryNextMethodContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_tryNextMethod + return p +} + +func InitEmptyTryNextMethodContext(p *TryNextMethodContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_tryNextMethod +} + +func (*TryNextMethodContext) IsTryNextMethodContext() {} + +func NewTryNextMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TryNextMethodContext { + var p = new(TryNextMethodContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_tryNextMethod + + return p +} + +func (s *TryNextMethodContext) GetParser() antlr.Parser { return s.parser } + +func (s *TryNextMethodContext) TRY_NEXT() antlr.TerminalNode { + return s.GetToken(MongoShellParserTRY_NEXT, 0) +} + +func (s *TryNextMethodContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *TryNextMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *TryNextMethodContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *TryNextMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *TryNextMethodContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterFindMethod(s) + listenerT.EnterTryNextMethod(s) } } -func (s *FindMethodContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *TryNextMethodContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitFindMethod(s) + listenerT.ExitTryNextMethod(s) } } -func (s *FindMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *TryNextMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitFindMethod(s) + return t.VisitTryNextMethod(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) FindMethod() (localctx IFindMethodContext) { - localctx = NewFindMethodContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 14, MongoShellParserRULE_findMethod) - var _la int - +func (p *MongoShellParser) TryNextMethod() (localctx ITryNextMethodContext) { + localctx = NewTryNextMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 168, MongoShellParserRULE_tryNextMethod) p.EnterOuterAlt(localctx, 1) { - p.SetState(171) - p.Match(MongoShellParserFIND) + p.SetState(1075) + p.Match(MongoShellParserTRY_NEXT) if p.HasError() { // Recognition error - abort rule goto errorExit } } { - p.SetState(172) + p.SetState(1076) p.Match(MongoShellParserLPAREN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(174) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&67564989593936832) != 0 { - { - p.SetState(173) - p.Argument() - } - - } { - p.SetState(176) + p.SetState(1077) p.Match(MongoShellParserRPAREN) if p.HasError() { // Recognition error - abort rule @@ -2611,151 +21381,151 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IFindOneMethodContext is an interface to support dynamic dispatch. -type IFindOneMethodContext interface { +// IAllowDiskUseMethodContext is an interface to support dynamic dispatch. +type IAllowDiskUseMethodContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - FIND_ONE() antlr.TerminalNode + ALLOW_DISK_USE() antlr.TerminalNode LPAREN() antlr.TerminalNode RPAREN() antlr.TerminalNode - Argument() IArgumentContext + TRUE() antlr.TerminalNode + FALSE() antlr.TerminalNode - // IsFindOneMethodContext differentiates from other interfaces. - IsFindOneMethodContext() + // IsAllowDiskUseMethodContext differentiates from other interfaces. + IsAllowDiskUseMethodContext() } -type FindOneMethodContext struct { +type AllowDiskUseMethodContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyFindOneMethodContext() *FindOneMethodContext { - var p = new(FindOneMethodContext) +func NewEmptyAllowDiskUseMethodContext() *AllowDiskUseMethodContext { + var p = new(AllowDiskUseMethodContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_findOneMethod + p.RuleIndex = MongoShellParserRULE_allowDiskUseMethod return p } -func InitEmptyFindOneMethodContext(p *FindOneMethodContext) { +func InitEmptyAllowDiskUseMethodContext(p *AllowDiskUseMethodContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_findOneMethod + p.RuleIndex = MongoShellParserRULE_allowDiskUseMethod } -func (*FindOneMethodContext) IsFindOneMethodContext() {} +func (*AllowDiskUseMethodContext) IsAllowDiskUseMethodContext() {} -func NewFindOneMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *FindOneMethodContext { - var p = new(FindOneMethodContext) +func NewAllowDiskUseMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AllowDiskUseMethodContext { + var p = new(AllowDiskUseMethodContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = MongoShellParserRULE_findOneMethod + p.RuleIndex = MongoShellParserRULE_allowDiskUseMethod return p } -func (s *FindOneMethodContext) GetParser() antlr.Parser { return s.parser } +func (s *AllowDiskUseMethodContext) GetParser() antlr.Parser { return s.parser } -func (s *FindOneMethodContext) FIND_ONE() antlr.TerminalNode { - return s.GetToken(MongoShellParserFIND_ONE, 0) +func (s *AllowDiskUseMethodContext) ALLOW_DISK_USE() antlr.TerminalNode { + return s.GetToken(MongoShellParserALLOW_DISK_USE, 0) } -func (s *FindOneMethodContext) LPAREN() antlr.TerminalNode { +func (s *AllowDiskUseMethodContext) LPAREN() antlr.TerminalNode { return s.GetToken(MongoShellParserLPAREN, 0) } -func (s *FindOneMethodContext) RPAREN() antlr.TerminalNode { +func (s *AllowDiskUseMethodContext) RPAREN() antlr.TerminalNode { return s.GetToken(MongoShellParserRPAREN, 0) } -func (s *FindOneMethodContext) Argument() IArgumentContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IArgumentContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } +func (s *AllowDiskUseMethodContext) TRUE() antlr.TerminalNode { + return s.GetToken(MongoShellParserTRUE, 0) +} - return t.(IArgumentContext) +func (s *AllowDiskUseMethodContext) FALSE() antlr.TerminalNode { + return s.GetToken(MongoShellParserFALSE, 0) } -func (s *FindOneMethodContext) GetRuleContext() antlr.RuleContext { +func (s *AllowDiskUseMethodContext) GetRuleContext() antlr.RuleContext { return s } -func (s *FindOneMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *AllowDiskUseMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *FindOneMethodContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *AllowDiskUseMethodContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterFindOneMethod(s) + listenerT.EnterAllowDiskUseMethod(s) } } -func (s *FindOneMethodContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *AllowDiskUseMethodContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitFindOneMethod(s) + listenerT.ExitAllowDiskUseMethod(s) } } -func (s *FindOneMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *AllowDiskUseMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitFindOneMethod(s) + return t.VisitAllowDiskUseMethod(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) FindOneMethod() (localctx IFindOneMethodContext) { - localctx = NewFindOneMethodContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 16, MongoShellParserRULE_findOneMethod) +func (p *MongoShellParser) AllowDiskUseMethod() (localctx IAllowDiskUseMethodContext) { + localctx = NewAllowDiskUseMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 170, MongoShellParserRULE_allowDiskUseMethod) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(178) - p.Match(MongoShellParserFIND_ONE) + p.SetState(1079) + p.Match(MongoShellParserALLOW_DISK_USE) if p.HasError() { // Recognition error - abort rule goto errorExit } } { - p.SetState(179) + p.SetState(1080) p.Match(MongoShellParserLPAREN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(181) + p.SetState(1082) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&67564989593936832) != 0 { + if _la == MongoShellParserTRUE || _la == MongoShellParserFALSE { { - p.SetState(180) - p.Argument() + p.SetState(1081) + _la = p.GetTokenStream().LA(1) + + if !(_la == MongoShellParserTRUE || _la == MongoShellParserFALSE) { + p.GetErrorHandler().RecoverInline(p) + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } } } { - p.SetState(183) + p.SetState(1084) p.Match(MongoShellParserRPAREN) if p.HasError() { // Recognition error - abort rule @@ -2776,151 +21546,131 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// ICountDocumentsMethodContext is an interface to support dynamic dispatch. -type ICountDocumentsMethodContext interface { +// IAddOptionMethodContext is an interface to support dynamic dispatch. +type IAddOptionMethodContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - COUNT_DOCUMENTS() antlr.TerminalNode + ADD_OPTION() antlr.TerminalNode LPAREN() antlr.TerminalNode + NUMBER() antlr.TerminalNode RPAREN() antlr.TerminalNode - Arguments() IArgumentsContext - // IsCountDocumentsMethodContext differentiates from other interfaces. - IsCountDocumentsMethodContext() + // IsAddOptionMethodContext differentiates from other interfaces. + IsAddOptionMethodContext() } -type CountDocumentsMethodContext struct { +type AddOptionMethodContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyCountDocumentsMethodContext() *CountDocumentsMethodContext { - var p = new(CountDocumentsMethodContext) +func NewEmptyAddOptionMethodContext() *AddOptionMethodContext { + var p = new(AddOptionMethodContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_countDocumentsMethod + p.RuleIndex = MongoShellParserRULE_addOptionMethod return p } -func InitEmptyCountDocumentsMethodContext(p *CountDocumentsMethodContext) { +func InitEmptyAddOptionMethodContext(p *AddOptionMethodContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_countDocumentsMethod + p.RuleIndex = MongoShellParserRULE_addOptionMethod } -func (*CountDocumentsMethodContext) IsCountDocumentsMethodContext() {} +func (*AddOptionMethodContext) IsAddOptionMethodContext() {} -func NewCountDocumentsMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CountDocumentsMethodContext { - var p = new(CountDocumentsMethodContext) +func NewAddOptionMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AddOptionMethodContext { + var p = new(AddOptionMethodContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = MongoShellParserRULE_countDocumentsMethod + p.RuleIndex = MongoShellParserRULE_addOptionMethod return p } -func (s *CountDocumentsMethodContext) GetParser() antlr.Parser { return s.parser } +func (s *AddOptionMethodContext) GetParser() antlr.Parser { return s.parser } -func (s *CountDocumentsMethodContext) COUNT_DOCUMENTS() antlr.TerminalNode { - return s.GetToken(MongoShellParserCOUNT_DOCUMENTS, 0) +func (s *AddOptionMethodContext) ADD_OPTION() antlr.TerminalNode { + return s.GetToken(MongoShellParserADD_OPTION, 0) } -func (s *CountDocumentsMethodContext) LPAREN() antlr.TerminalNode { +func (s *AddOptionMethodContext) LPAREN() antlr.TerminalNode { return s.GetToken(MongoShellParserLPAREN, 0) } -func (s *CountDocumentsMethodContext) RPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserRPAREN, 0) +func (s *AddOptionMethodContext) NUMBER() antlr.TerminalNode { + return s.GetToken(MongoShellParserNUMBER, 0) } -func (s *CountDocumentsMethodContext) Arguments() IArgumentsContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IArgumentsContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IArgumentsContext) +func (s *AddOptionMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) } -func (s *CountDocumentsMethodContext) GetRuleContext() antlr.RuleContext { +func (s *AddOptionMethodContext) GetRuleContext() antlr.RuleContext { return s } -func (s *CountDocumentsMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *AddOptionMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *CountDocumentsMethodContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *AddOptionMethodContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterCountDocumentsMethod(s) + listenerT.EnterAddOptionMethod(s) } } -func (s *CountDocumentsMethodContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *AddOptionMethodContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitCountDocumentsMethod(s) + listenerT.ExitAddOptionMethod(s) } } -func (s *CountDocumentsMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *AddOptionMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitCountDocumentsMethod(s) + return t.VisitAddOptionMethod(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) CountDocumentsMethod() (localctx ICountDocumentsMethodContext) { - localctx = NewCountDocumentsMethodContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 18, MongoShellParserRULE_countDocumentsMethod) - var _la int - +func (p *MongoShellParser) AddOptionMethod() (localctx IAddOptionMethodContext) { + localctx = NewAddOptionMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 172, MongoShellParserRULE_addOptionMethod) p.EnterOuterAlt(localctx, 1) { - p.SetState(185) - p.Match(MongoShellParserCOUNT_DOCUMENTS) + p.SetState(1086) + p.Match(MongoShellParserADD_OPTION) if p.HasError() { // Recognition error - abort rule goto errorExit } } { - p.SetState(186) + p.SetState(1087) p.Match(MongoShellParserLPAREN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(188) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&67564989593936832) != 0 { - { - p.SetState(187) - p.Arguments() + { + p.SetState(1088) + p.Match(MongoShellParserNUMBER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit } - } { - p.SetState(190) + p.SetState(1089) p.Match(MongoShellParserRPAREN) if p.HasError() { // Recognition error - abort rule @@ -2941,71 +21691,83 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IEstimatedDocumentCountMethodContext is an interface to support dynamic dispatch. -type IEstimatedDocumentCountMethodContext interface { +// IGenericMethodContext is an interface to support dynamic dispatch. +type IGenericMethodContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - ESTIMATED_DOCUMENT_COUNT() antlr.TerminalNode + Identifier() IIdentifierContext LPAREN() antlr.TerminalNode RPAREN() antlr.TerminalNode - Argument() IArgumentContext + Arguments() IArgumentsContext - // IsEstimatedDocumentCountMethodContext differentiates from other interfaces. - IsEstimatedDocumentCountMethodContext() + // IsGenericMethodContext differentiates from other interfaces. + IsGenericMethodContext() } -type EstimatedDocumentCountMethodContext struct { +type GenericMethodContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyEstimatedDocumentCountMethodContext() *EstimatedDocumentCountMethodContext { - var p = new(EstimatedDocumentCountMethodContext) +func NewEmptyGenericMethodContext() *GenericMethodContext { + var p = new(GenericMethodContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_estimatedDocumentCountMethod + p.RuleIndex = MongoShellParserRULE_genericMethod return p } -func InitEmptyEstimatedDocumentCountMethodContext(p *EstimatedDocumentCountMethodContext) { +func InitEmptyGenericMethodContext(p *GenericMethodContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_estimatedDocumentCountMethod + p.RuleIndex = MongoShellParserRULE_genericMethod } -func (*EstimatedDocumentCountMethodContext) IsEstimatedDocumentCountMethodContext() {} +func (*GenericMethodContext) IsGenericMethodContext() {} -func NewEstimatedDocumentCountMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *EstimatedDocumentCountMethodContext { - var p = new(EstimatedDocumentCountMethodContext) +func NewGenericMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *GenericMethodContext { + var p = new(GenericMethodContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = MongoShellParserRULE_estimatedDocumentCountMethod + p.RuleIndex = MongoShellParserRULE_genericMethod return p } -func (s *EstimatedDocumentCountMethodContext) GetParser() antlr.Parser { return s.parser } +func (s *GenericMethodContext) GetParser() antlr.Parser { return s.parser } -func (s *EstimatedDocumentCountMethodContext) ESTIMATED_DOCUMENT_COUNT() antlr.TerminalNode { - return s.GetToken(MongoShellParserESTIMATED_DOCUMENT_COUNT, 0) +func (s *GenericMethodContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IIdentifierContext) } -func (s *EstimatedDocumentCountMethodContext) LPAREN() antlr.TerminalNode { +func (s *GenericMethodContext) LPAREN() antlr.TerminalNode { return s.GetToken(MongoShellParserLPAREN, 0) } -func (s *EstimatedDocumentCountMethodContext) RPAREN() antlr.TerminalNode { +func (s *GenericMethodContext) RPAREN() antlr.TerminalNode { return s.GetToken(MongoShellParserRPAREN, 0) } -func (s *EstimatedDocumentCountMethodContext) Argument() IArgumentContext { +func (s *GenericMethodContext) Arguments() IArgumentsContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IArgumentContext); ok { + if _, ok := ctx.(IArgumentsContext); ok { t = ctx.(antlr.RuleContext) break } @@ -3015,77 +21777,73 @@ func (s *EstimatedDocumentCountMethodContext) Argument() IArgumentContext { return nil } - return t.(IArgumentContext) + return t.(IArgumentsContext) } -func (s *EstimatedDocumentCountMethodContext) GetRuleContext() antlr.RuleContext { +func (s *GenericMethodContext) GetRuleContext() antlr.RuleContext { return s } -func (s *EstimatedDocumentCountMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *GenericMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *EstimatedDocumentCountMethodContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *GenericMethodContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterEstimatedDocumentCountMethod(s) + listenerT.EnterGenericMethod(s) } } -func (s *EstimatedDocumentCountMethodContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *GenericMethodContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitEstimatedDocumentCountMethod(s) + listenerT.ExitGenericMethod(s) } } -func (s *EstimatedDocumentCountMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *GenericMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitEstimatedDocumentCountMethod(s) + return t.VisitGenericMethod(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) EstimatedDocumentCountMethod() (localctx IEstimatedDocumentCountMethodContext) { - localctx = NewEstimatedDocumentCountMethodContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 20, MongoShellParserRULE_estimatedDocumentCountMethod) +func (p *MongoShellParser) GenericMethod() (localctx IGenericMethodContext) { + localctx = NewGenericMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 174, MongoShellParserRULE_genericMethod) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(192) - p.Match(MongoShellParserESTIMATED_DOCUMENT_COUNT) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } + p.SetState(1091) + p.Identifier() } { - p.SetState(193) + p.SetState(1092) p.Match(MongoShellParserLPAREN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(195) + p.SetState(1094) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&67564989593936832) != 0 { + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { { - p.SetState(194) - p.Argument() + p.SetState(1093) + p.Arguments() } } { - p.SetState(197) + p.SetState(1096) p.Match(MongoShellParserRPAREN) if p.HasError() { // Recognition error - abort rule @@ -3106,69 +21864,86 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IDistinctMethodContext is an interface to support dynamic dispatch. -type IDistinctMethodContext interface { +// IArgumentsContext is an interface to support dynamic dispatch. +type IArgumentsContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - DISTINCT() antlr.TerminalNode - LPAREN() antlr.TerminalNode - Arguments() IArgumentsContext - RPAREN() antlr.TerminalNode + AllArgument() []IArgumentContext + Argument(i int) IArgumentContext + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode - // IsDistinctMethodContext differentiates from other interfaces. - IsDistinctMethodContext() + // IsArgumentsContext differentiates from other interfaces. + IsArgumentsContext() } -type DistinctMethodContext struct { +type ArgumentsContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyDistinctMethodContext() *DistinctMethodContext { - var p = new(DistinctMethodContext) +func NewEmptyArgumentsContext() *ArgumentsContext { + var p = new(ArgumentsContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_distinctMethod + p.RuleIndex = MongoShellParserRULE_arguments return p } -func InitEmptyDistinctMethodContext(p *DistinctMethodContext) { +func InitEmptyArgumentsContext(p *ArgumentsContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_distinctMethod + p.RuleIndex = MongoShellParserRULE_arguments } -func (*DistinctMethodContext) IsDistinctMethodContext() {} +func (*ArgumentsContext) IsArgumentsContext() {} -func NewDistinctMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DistinctMethodContext { - var p = new(DistinctMethodContext) +func NewArgumentsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ArgumentsContext { + var p = new(ArgumentsContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = MongoShellParserRULE_distinctMethod + p.RuleIndex = MongoShellParserRULE_arguments return p } -func (s *DistinctMethodContext) GetParser() antlr.Parser { return s.parser } +func (s *ArgumentsContext) GetParser() antlr.Parser { return s.parser } -func (s *DistinctMethodContext) DISTINCT() antlr.TerminalNode { - return s.GetToken(MongoShellParserDISTINCT, 0) -} +func (s *ArgumentsContext) AllArgument() []IArgumentContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IArgumentContext); ok { + len++ + } + } -func (s *DistinctMethodContext) LPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserLPAREN, 0) + tst := make([]IArgumentContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IArgumentContext); ok { + tst[i] = t.(IArgumentContext) + i++ + } + } + + return tst } -func (s *DistinctMethodContext) Arguments() IArgumentsContext { +func (s *ArgumentsContext) Argument(i int) IArgumentContext { var t antlr.RuleContext + j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IArgumentsContext); ok { - t = ctx.(antlr.RuleContext) - break + if _, ok := ctx.(IArgumentContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ } } @@ -3176,74 +21951,111 @@ func (s *DistinctMethodContext) Arguments() IArgumentsContext { return nil } - return t.(IArgumentsContext) + return t.(IArgumentContext) } -func (s *DistinctMethodContext) RPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserRPAREN, 0) +func (s *ArgumentsContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(MongoShellParserCOMMA) } -func (s *DistinctMethodContext) GetRuleContext() antlr.RuleContext { +func (s *ArgumentsContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(MongoShellParserCOMMA, i) +} + +func (s *ArgumentsContext) GetRuleContext() antlr.RuleContext { return s } -func (s *DistinctMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *ArgumentsContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *DistinctMethodContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *ArgumentsContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterDistinctMethod(s) + listenerT.EnterArguments(s) } } -func (s *DistinctMethodContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *ArgumentsContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitDistinctMethod(s) + listenerT.ExitArguments(s) } } -func (s *DistinctMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *ArgumentsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitDistinctMethod(s) + return t.VisitArguments(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) DistinctMethod() (localctx IDistinctMethodContext) { - localctx = NewDistinctMethodContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 22, MongoShellParserRULE_distinctMethod) +func (p *MongoShellParser) Arguments() (localctx IArgumentsContext) { + localctx = NewArgumentsContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 176, MongoShellParserRULE_arguments) + var _la int + + var _alt int + p.EnterOuterAlt(localctx, 1) { - p.SetState(199) - p.Match(MongoShellParserDISTINCT) + p.SetState(1098) + p.Argument() + } + p.SetState(1103) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 65, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { + { + p.SetState(1099) + p.Match(MongoShellParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1100) + p.Argument() + } + + } + p.SetState(1105) + p.GetErrorHandler().Sync(p) if p.HasError() { - // Recognition error - abort rule goto errorExit } - } - { - p.SetState(200) - p.Match(MongoShellParserLPAREN) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 65, p.GetParserRuleContext()) if p.HasError() { - // Recognition error - abort rule goto errorExit } } - { - p.SetState(201) - p.Arguments() + p.SetState(1107) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit } - { - p.SetState(202) - p.Match(MongoShellParserRPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit + _la = p.GetTokenStream().LA(1) + + if _la == MongoShellParserCOMMA { + { + p.SetState(1106) + p.Match(MongoShellParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } + } errorExit: @@ -3259,67 +22071,56 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IAggregateMethodContext is an interface to support dynamic dispatch. -type IAggregateMethodContext interface { +// IArgumentContext is an interface to support dynamic dispatch. +type IArgumentContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - AGGREGATE() antlr.TerminalNode - LPAREN() antlr.TerminalNode - Arguments() IArgumentsContext - RPAREN() antlr.TerminalNode + Value() IValueContext - // IsAggregateMethodContext differentiates from other interfaces. - IsAggregateMethodContext() + // IsArgumentContext differentiates from other interfaces. + IsArgumentContext() } -type AggregateMethodContext struct { +type ArgumentContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyAggregateMethodContext() *AggregateMethodContext { - var p = new(AggregateMethodContext) +func NewEmptyArgumentContext() *ArgumentContext { + var p = new(ArgumentContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_aggregateMethod + p.RuleIndex = MongoShellParserRULE_argument return p } -func InitEmptyAggregateMethodContext(p *AggregateMethodContext) { +func InitEmptyArgumentContext(p *ArgumentContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_aggregateMethod + p.RuleIndex = MongoShellParserRULE_argument } -func (*AggregateMethodContext) IsAggregateMethodContext() {} +func (*ArgumentContext) IsArgumentContext() {} -func NewAggregateMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AggregateMethodContext { - var p = new(AggregateMethodContext) +func NewArgumentContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ArgumentContext { + var p = new(ArgumentContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = MongoShellParserRULE_aggregateMethod + p.RuleIndex = MongoShellParserRULE_argument return p } -func (s *AggregateMethodContext) GetParser() antlr.Parser { return s.parser } - -func (s *AggregateMethodContext) AGGREGATE() antlr.TerminalNode { - return s.GetToken(MongoShellParserAGGREGATE, 0) -} - -func (s *AggregateMethodContext) LPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserLPAREN, 0) -} +func (s *ArgumentContext) GetParser() antlr.Parser { return s.parser } -func (s *AggregateMethodContext) Arguments() IArgumentsContext { +func (s *ArgumentContext) Value() IValueContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IArgumentsContext); ok { + if _, ok := ctx.(IValueContext); ok { t = ctx.(antlr.RuleContext) break } @@ -3329,74 +22130,46 @@ func (s *AggregateMethodContext) Arguments() IArgumentsContext { return nil } - return t.(IArgumentsContext) -} - -func (s *AggregateMethodContext) RPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserRPAREN, 0) + return t.(IValueContext) } -func (s *AggregateMethodContext) GetRuleContext() antlr.RuleContext { +func (s *ArgumentContext) GetRuleContext() antlr.RuleContext { return s } -func (s *AggregateMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *ArgumentContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *AggregateMethodContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *ArgumentContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterAggregateMethod(s) + listenerT.EnterArgument(s) } } -func (s *AggregateMethodContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *ArgumentContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitAggregateMethod(s) + listenerT.ExitArgument(s) } } -func (s *AggregateMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *ArgumentContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitAggregateMethod(s) + return t.VisitArgument(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) AggregateMethod() (localctx IAggregateMethodContext) { - localctx = NewAggregateMethodContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 24, MongoShellParserRULE_aggregateMethod) +func (p *MongoShellParser) Argument() (localctx IArgumentContext) { + localctx = NewArgumentContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 178, MongoShellParserRULE_argument) p.EnterOuterAlt(localctx, 1) { - p.SetState(204) - p.Match(MongoShellParserAGGREGATE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(205) - p.Match(MongoShellParserLPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(206) - p.Arguments() - } - { - p.SetState(207) - p.Match(MongoShellParserRPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } + p.SetState(1109) + p.Value() } errorExit: @@ -3412,119 +22185,230 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IGetIndexesMethodContext is an interface to support dynamic dispatch. -type IGetIndexesMethodContext interface { +// IDocumentContext is an interface to support dynamic dispatch. +type IDocumentContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - GET_INDEXES() antlr.TerminalNode - LPAREN() antlr.TerminalNode - RPAREN() antlr.TerminalNode + LBRACE() antlr.TerminalNode + RBRACE() antlr.TerminalNode + AllPair() []IPairContext + Pair(i int) IPairContext + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode - // IsGetIndexesMethodContext differentiates from other interfaces. - IsGetIndexesMethodContext() + // IsDocumentContext differentiates from other interfaces. + IsDocumentContext() } -type GetIndexesMethodContext struct { +type DocumentContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyGetIndexesMethodContext() *GetIndexesMethodContext { - var p = new(GetIndexesMethodContext) +func NewEmptyDocumentContext() *DocumentContext { + var p = new(DocumentContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_getIndexesMethod + p.RuleIndex = MongoShellParserRULE_document return p } -func InitEmptyGetIndexesMethodContext(p *GetIndexesMethodContext) { +func InitEmptyDocumentContext(p *DocumentContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_getIndexesMethod + p.RuleIndex = MongoShellParserRULE_document } -func (*GetIndexesMethodContext) IsGetIndexesMethodContext() {} +func (*DocumentContext) IsDocumentContext() {} -func NewGetIndexesMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *GetIndexesMethodContext { - var p = new(GetIndexesMethodContext) +func NewDocumentContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DocumentContext { + var p = new(DocumentContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = MongoShellParserRULE_getIndexesMethod + p.RuleIndex = MongoShellParserRULE_document return p } -func (s *GetIndexesMethodContext) GetParser() antlr.Parser { return s.parser } +func (s *DocumentContext) GetParser() antlr.Parser { return s.parser } -func (s *GetIndexesMethodContext) GET_INDEXES() antlr.TerminalNode { - return s.GetToken(MongoShellParserGET_INDEXES, 0) +func (s *DocumentContext) LBRACE() antlr.TerminalNode { + return s.GetToken(MongoShellParserLBRACE, 0) } -func (s *GetIndexesMethodContext) LPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserLPAREN, 0) +func (s *DocumentContext) RBRACE() antlr.TerminalNode { + return s.GetToken(MongoShellParserRBRACE, 0) } -func (s *GetIndexesMethodContext) RPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserRPAREN, 0) +func (s *DocumentContext) AllPair() []IPairContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IPairContext); ok { + len++ + } + } + + tst := make([]IPairContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IPairContext); ok { + tst[i] = t.(IPairContext) + i++ + } + } + + return tst } -func (s *GetIndexesMethodContext) GetRuleContext() antlr.RuleContext { +func (s *DocumentContext) Pair(i int) IPairContext { + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPairContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } + + if t == nil { + return nil + } + + return t.(IPairContext) +} + +func (s *DocumentContext) AllCOMMA() []antlr.TerminalNode { + return s.GetTokens(MongoShellParserCOMMA) +} + +func (s *DocumentContext) COMMA(i int) antlr.TerminalNode { + return s.GetToken(MongoShellParserCOMMA, i) +} + +func (s *DocumentContext) GetRuleContext() antlr.RuleContext { return s } -func (s *GetIndexesMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *DocumentContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *GetIndexesMethodContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *DocumentContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterGetIndexesMethod(s) + listenerT.EnterDocument(s) } } -func (s *GetIndexesMethodContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *DocumentContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitGetIndexesMethod(s) + listenerT.ExitDocument(s) } } -func (s *GetIndexesMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *DocumentContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitGetIndexesMethod(s) + return t.VisitDocument(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) GetIndexesMethod() (localctx IGetIndexesMethodContext) { - localctx = NewGetIndexesMethodContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 26, MongoShellParserRULE_getIndexesMethod) +func (p *MongoShellParser) Document() (localctx IDocumentContext) { + localctx = NewDocumentContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 180, MongoShellParserRULE_document) + var _la int + + var _alt int + p.EnterOuterAlt(localctx, 1) { - p.SetState(209) - p.Match(MongoShellParserGET_INDEXES) + p.SetState(1111) + p.Match(MongoShellParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - { - p.SetState(210) - p.Match(MongoShellParserLPAREN) + p.SetState(1123) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&-2) != 0) || ((int64((_la-64)) & ^0x3f) == 0 && ((int64(1)<<(_la-64))&-1) != 0) || ((int64((_la-128)) & ^0x3f) == 0 && ((int64(1)<<(_la-128))&58982655) != 0) { + { + p.SetState(1112) + p.Pair() + } + p.SetState(1117) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 67, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { + { + p.SetState(1113) + p.Match(MongoShellParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1114) + p.Pair() + } + + } + p.SetState(1119) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 67, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + } + p.SetState(1121) + p.GetErrorHandler().Sync(p) if p.HasError() { - // Recognition error - abort rule goto errorExit } + _la = p.GetTokenStream().LA(1) + + if _la == MongoShellParserCOMMA { + { + p.SetState(1120) + p.Match(MongoShellParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } + } { - p.SetState(211) - p.Match(MongoShellParserRPAREN) + p.SetState(1125) + p.Match(MongoShellParserRBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit @@ -3544,67 +22428,78 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// ISortMethodContext is an interface to support dynamic dispatch. -type ISortMethodContext interface { +// IPairContext is an interface to support dynamic dispatch. +type IPairContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - SORT() antlr.TerminalNode - LPAREN() antlr.TerminalNode - Document() IDocumentContext - RPAREN() antlr.TerminalNode + Key() IKeyContext + COLON() antlr.TerminalNode + Value() IValueContext - // IsSortMethodContext differentiates from other interfaces. - IsSortMethodContext() + // IsPairContext differentiates from other interfaces. + IsPairContext() } -type SortMethodContext struct { +type PairContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptySortMethodContext() *SortMethodContext { - var p = new(SortMethodContext) +func NewEmptyPairContext() *PairContext { + var p = new(PairContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_sortMethod + p.RuleIndex = MongoShellParserRULE_pair return p } -func InitEmptySortMethodContext(p *SortMethodContext) { +func InitEmptyPairContext(p *PairContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_sortMethod + p.RuleIndex = MongoShellParserRULE_pair } -func (*SortMethodContext) IsSortMethodContext() {} +func (*PairContext) IsPairContext() {} -func NewSortMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SortMethodContext { - var p = new(SortMethodContext) +func NewPairContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PairContext { + var p = new(PairContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = MongoShellParserRULE_sortMethod + p.RuleIndex = MongoShellParserRULE_pair return p } -func (s *SortMethodContext) GetParser() antlr.Parser { return s.parser } +func (s *PairContext) GetParser() antlr.Parser { return s.parser } -func (s *SortMethodContext) SORT() antlr.TerminalNode { - return s.GetToken(MongoShellParserSORT, 0) +func (s *PairContext) Key() IKeyContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IKeyContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IKeyContext) } -func (s *SortMethodContext) LPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserLPAREN, 0) +func (s *PairContext) COLON() antlr.TerminalNode { + return s.GetToken(MongoShellParserCOLON, 0) } -func (s *SortMethodContext) Document() IDocumentContext { +func (s *PairContext) Value() IValueContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IDocumentContext); ok { + if _, ok := ctx.(IValueContext); ok { t = ctx.(antlr.RuleContext) break } @@ -3614,75 +22509,59 @@ func (s *SortMethodContext) Document() IDocumentContext { return nil } - return t.(IDocumentContext) -} - -func (s *SortMethodContext) RPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserRPAREN, 0) + return t.(IValueContext) } -func (s *SortMethodContext) GetRuleContext() antlr.RuleContext { +func (s *PairContext) GetRuleContext() antlr.RuleContext { return s } -func (s *SortMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *PairContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *SortMethodContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *PairContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterSortMethod(s) + listenerT.EnterPair(s) } } -func (s *SortMethodContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *PairContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitSortMethod(s) + listenerT.ExitPair(s) } } -func (s *SortMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *PairContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitSortMethod(s) + return t.VisitPair(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) SortMethod() (localctx ISortMethodContext) { - localctx = NewSortMethodContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 28, MongoShellParserRULE_sortMethod) +func (p *MongoShellParser) Pair() (localctx IPairContext) { + localctx = NewPairContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 182, MongoShellParserRULE_pair) p.EnterOuterAlt(localctx, 1) { - p.SetState(213) - p.Match(MongoShellParserSORT) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(214) - p.Match(MongoShellParserLPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(215) - p.Document() + p.SetState(1127) + p.Key() } { - p.SetState(216) - p.Match(MongoShellParserRPAREN) + p.SetState(1128) + p.Match(MongoShellParserCOLON) if p.HasError() { // Recognition error - abort rule goto errorExit } } + { + p.SetState(1129) + p.Value() + } errorExit: if p.HasError() { @@ -3697,136 +22576,201 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// ILimitMethodContext is an interface to support dynamic dispatch. -type ILimitMethodContext interface { +// IKeyContext is an interface to support dynamic dispatch. +type IKeyContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser - - // Getter signatures - LIMIT() antlr.TerminalNode - LPAREN() antlr.TerminalNode - NUMBER() antlr.TerminalNode - RPAREN() antlr.TerminalNode - - // IsLimitMethodContext differentiates from other interfaces. - IsLimitMethodContext() + // IsKeyContext differentiates from other interfaces. + IsKeyContext() } -type LimitMethodContext struct { +type KeyContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyLimitMethodContext() *LimitMethodContext { - var p = new(LimitMethodContext) +func NewEmptyKeyContext() *KeyContext { + var p = new(KeyContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_limitMethod + p.RuleIndex = MongoShellParserRULE_key return p } -func InitEmptyLimitMethodContext(p *LimitMethodContext) { +func InitEmptyKeyContext(p *KeyContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_limitMethod + p.RuleIndex = MongoShellParserRULE_key } -func (*LimitMethodContext) IsLimitMethodContext() {} +func (*KeyContext) IsKeyContext() {} -func NewLimitMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LimitMethodContext { - var p = new(LimitMethodContext) +func NewKeyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *KeyContext { + var p = new(KeyContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = MongoShellParserRULE_limitMethod + p.RuleIndex = MongoShellParserRULE_key return p } -func (s *LimitMethodContext) GetParser() antlr.Parser { return s.parser } +func (s *KeyContext) GetParser() antlr.Parser { return s.parser } -func (s *LimitMethodContext) LIMIT() antlr.TerminalNode { - return s.GetToken(MongoShellParserLIMIT, 0) +func (s *KeyContext) CopyAll(ctx *KeyContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) } -func (s *LimitMethodContext) LPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserLPAREN, 0) +func (s *KeyContext) GetRuleContext() antlr.RuleContext { + return s } -func (s *LimitMethodContext) NUMBER() antlr.TerminalNode { - return s.GetToken(MongoShellParserNUMBER, 0) +func (s *KeyContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *LimitMethodContext) RPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserRPAREN, 0) +type QuotedKeyContext struct { + KeyContext } -func (s *LimitMethodContext) GetRuleContext() antlr.RuleContext { +func NewQuotedKeyContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *QuotedKeyContext { + var p = new(QuotedKeyContext) + + InitEmptyKeyContext(&p.KeyContext) + p.parser = parser + p.CopyAll(ctx.(*KeyContext)) + + return p +} + +func (s *QuotedKeyContext) GetRuleContext() antlr.RuleContext { return s } -func (s *LimitMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) +func (s *QuotedKeyContext) StringLiteral() IStringLiteralContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IStringLiteralContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IStringLiteralContext) } -func (s *LimitMethodContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *QuotedKeyContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterLimitMethod(s) + listenerT.EnterQuotedKey(s) } } -func (s *LimitMethodContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *QuotedKeyContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitLimitMethod(s) + listenerT.ExitQuotedKey(s) } } -func (s *LimitMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *QuotedKeyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitLimitMethod(s) + return t.VisitQuotedKey(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) LimitMethod() (localctx ILimitMethodContext) { - localctx = NewLimitMethodContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 30, MongoShellParserRULE_limitMethod) - p.EnterOuterAlt(localctx, 1) - { - p.SetState(218) - p.Match(MongoShellParserLIMIT) - if p.HasError() { - // Recognition error - abort rule - goto errorExit +type UnquotedKeyContext struct { + KeyContext +} + +func NewUnquotedKeyContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *UnquotedKeyContext { + var p = new(UnquotedKeyContext) + + InitEmptyKeyContext(&p.KeyContext) + p.parser = parser + p.CopyAll(ctx.(*KeyContext)) + + return p +} + +func (s *UnquotedKeyContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *UnquotedKeyContext) Identifier() IIdentifierContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIdentifierContext); ok { + t = ctx.(antlr.RuleContext) + break } } - { - p.SetState(219) - p.Match(MongoShellParserLPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } + + if t == nil { + return nil } - { - p.SetState(220) - p.Match(MongoShellParserNUMBER) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } + + return t.(IIdentifierContext) +} + +func (s *UnquotedKeyContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterUnquotedKey(s) } - { - p.SetState(221) - p.Match(MongoShellParserRPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit +} + +func (s *UnquotedKeyContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitUnquotedKey(s) + } +} + +func (s *UnquotedKeyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitUnquotedKey(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) Key() (localctx IKeyContext) { + localctx = NewKeyContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 184, MongoShellParserRULE_key) + p.SetState(1133) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + + switch p.GetTokenStream().LA(1) { + case MongoShellParserSHOW, MongoShellParserDBS, MongoShellParserDATABASES, MongoShellParserCOLLECTIONS, MongoShellParserDB, MongoShellParserNEW, MongoShellParserTRUE, MongoShellParserFALSE, MongoShellParserNULL, MongoShellParserGET_COLLECTION, MongoShellParserGET_COLLECTION_NAMES, MongoShellParserGET_COLLECTION_INFOS, MongoShellParserOBJECT_ID, MongoShellParserISO_DATE, MongoShellParserDATE, MongoShellParserUUID, MongoShellParserLONG, MongoShellParserNUMBER_LONG, MongoShellParserINT32, MongoShellParserNUMBER_INT, MongoShellParserDOUBLE, MongoShellParserDECIMAL128, MongoShellParserNUMBER_DECIMAL, MongoShellParserTIMESTAMP, MongoShellParserREG_EXP, MongoShellParserBIN_DATA, MongoShellParserBINARY, MongoShellParserBSON_REG_EXP, MongoShellParserHEX_DATA, MongoShellParserFIND, MongoShellParserFIND_ONE, MongoShellParserCOUNT_DOCUMENTS, MongoShellParserESTIMATED_DOCUMENT_COUNT, MongoShellParserDISTINCT, MongoShellParserAGGREGATE, MongoShellParserGET_INDEXES, MongoShellParserINSERT_ONE, MongoShellParserINSERT_MANY, MongoShellParserUPDATE_ONE, MongoShellParserUPDATE_MANY, MongoShellParserDELETE_ONE, MongoShellParserDELETE_MANY, MongoShellParserREPLACE_ONE, MongoShellParserFIND_ONE_AND_UPDATE, MongoShellParserFIND_ONE_AND_REPLACE, MongoShellParserFIND_ONE_AND_DELETE, MongoShellParserCREATE_INDEX, MongoShellParserCREATE_INDEXES, MongoShellParserDROP_INDEX, MongoShellParserDROP_INDEXES, MongoShellParserDROP, MongoShellParserRENAME_COLLECTION, MongoShellParserSTATS, MongoShellParserSTORAGE_SIZE, MongoShellParserTOTAL_INDEX_SIZE, MongoShellParserTOTAL_SIZE, MongoShellParserDATA_SIZE, MongoShellParserIS_CAPPED, MongoShellParserVALIDATE, MongoShellParserLATENCY_STATS, MongoShellParserCREATE_COLLECTION, MongoShellParserDROP_DATABASE, MongoShellParserHOST_INFO, MongoShellParserLIST_COMMANDS, MongoShellParserSERVER_BUILD_INFO, MongoShellParserSERVER_STATUS, MongoShellParserVERSION, MongoShellParserRUN_COMMAND, MongoShellParserADMIN_COMMAND, MongoShellParserGET_NAME, MongoShellParserGET_MONGO, MongoShellParserGET_SIBLING_DB, MongoShellParserMONGO, MongoShellParserCONNECT, MongoShellParserRS, MongoShellParserSH, MongoShellParserSP, MongoShellParserGET_DB, MongoShellParserGET_READ_CONCERN, MongoShellParserGET_READ_PREF, MongoShellParserGET_READ_PREF_MODE, MongoShellParserGET_READ_PREF_TAG_SET, MongoShellParserGET_WRITE_CONCERN, MongoShellParserSET_READ_PREF, MongoShellParserSET_READ_CONCERN, MongoShellParserSET_WRITE_CONCERN, MongoShellParserSTART_SESSION, MongoShellParserWATCH, MongoShellParserGET_DB_NAMES, MongoShellParserGET_KEY_VAULT, MongoShellParserGET_CLIENT_ENCRYPTION, MongoShellParserGET_PLAN_CACHE, MongoShellParserSORT, MongoShellParserLIMIT, MongoShellParserSKIP_, MongoShellParserPROJECTION, MongoShellParserPROJECT, MongoShellParserCOUNT, MongoShellParserINITIALIZE_ORDERED_BULK_OP, MongoShellParserINITIALIZE_UNORDERED_BULK_OP, MongoShellParserEXECUTE, MongoShellParserGET_OPERATIONS, MongoShellParserTO_STRING, MongoShellParserINSERT, MongoShellParserREMOVE, MongoShellParserBATCH_SIZE, MongoShellParserCLOSE, MongoShellParserCOLLATION, MongoShellParserCOMMENT, MongoShellParserEXPLAIN, MongoShellParserFOR_EACH, MongoShellParserHAS_NEXT, MongoShellParserHINT, MongoShellParserIS_CLOSED, MongoShellParserIS_EXHAUSTED, MongoShellParserIT_COUNT, MongoShellParserMAP, MongoShellParserMAX, MongoShellParserMAX_AWAIT_TIME_MS, MongoShellParserMAX_TIME_MS, MongoShellParserMIN, MongoShellParserNEXT, MongoShellParserNO_CURSOR_TIMEOUT, MongoShellParserOBJS_LEFT_IN_BATCH, MongoShellParserPRETTY, MongoShellParserREAD_CONCERN, MongoShellParserREAD_PREF, MongoShellParserRETURN_KEY, MongoShellParserSHOW_RECORD_ID, MongoShellParserSIZE, MongoShellParserTAILABLE, MongoShellParserTO_ARRAY, MongoShellParserTRY_NEXT, MongoShellParserALLOW_DISK_USE, MongoShellParserADD_OPTION, MongoShellParserDOLLAR, MongoShellParserIDENTIFIER: + localctx = NewUnquotedKeyContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1131) + p.Identifier() + } + + case MongoShellParserDOUBLE_QUOTED_STRING, MongoShellParserSINGLE_QUOTED_STRING: + localctx = NewQuotedKeyContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(1132) + p.StringLiteral() } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit } errorExit: @@ -3842,341 +22786,406 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// ISkipMethodContext is an interface to support dynamic dispatch. -type ISkipMethodContext interface { +// IValueContext is an interface to support dynamic dispatch. +type IValueContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser + // IsValueContext differentiates from other interfaces. + IsValueContext() +} - // Getter signatures - SKIP_() antlr.TerminalNode - LPAREN() antlr.TerminalNode - NUMBER() antlr.TerminalNode - RPAREN() antlr.TerminalNode +type ValueContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} - // IsSkipMethodContext differentiates from other interfaces. - IsSkipMethodContext() +func NewEmptyValueContext() *ValueContext { + var p = new(ValueContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_value + return p +} + +func InitEmptyValueContext(p *ValueContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_value +} + +func (*ValueContext) IsValueContext() {} + +func NewValueContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ValueContext { + var p = new(ValueContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + + p.parser = parser + p.RuleIndex = MongoShellParserRULE_value + + return p +} + +func (s *ValueContext) GetParser() antlr.Parser { return s.parser } + +func (s *ValueContext) CopyAll(ctx *ValueContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} + +func (s *ValueContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ValueContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +type RegexpConstructorValueContext struct { + ValueContext } -type SkipMethodContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser -} +func NewRegexpConstructorValueContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *RegexpConstructorValueContext { + var p = new(RegexpConstructorValueContext) + + InitEmptyValueContext(&p.ValueContext) + p.parser = parser + p.CopyAll(ctx.(*ValueContext)) -func NewEmptySkipMethodContext() *SkipMethodContext { - var p = new(SkipMethodContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_skipMethod return p } -func InitEmptySkipMethodContext(p *SkipMethodContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_skipMethod +func (s *RegexpConstructorValueContext) GetRuleContext() antlr.RuleContext { + return s } -func (*SkipMethodContext) IsSkipMethodContext() {} +func (s *RegexpConstructorValueContext) RegExpConstructor() IRegExpConstructorContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IRegExpConstructorContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } -func NewSkipMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SkipMethodContext { - var p = new(SkipMethodContext) + if t == nil { + return nil + } - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + return t.(IRegExpConstructorContext) +} - p.parser = parser - p.RuleIndex = MongoShellParserRULE_skipMethod +func (s *RegexpConstructorValueContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterRegexpConstructorValue(s) + } +} - return p +func (s *RegexpConstructorValueContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitRegexpConstructorValue(s) + } } -func (s *SkipMethodContext) GetParser() antlr.Parser { return s.parser } +func (s *RegexpConstructorValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitRegexpConstructorValue(s) -func (s *SkipMethodContext) SKIP_() antlr.TerminalNode { - return s.GetToken(MongoShellParserSKIP_, 0) + default: + return t.VisitChildren(s) + } } -func (s *SkipMethodContext) LPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserLPAREN, 0) +type RegexLiteralValueContext struct { + ValueContext } -func (s *SkipMethodContext) NUMBER() antlr.TerminalNode { - return s.GetToken(MongoShellParserNUMBER, 0) -} +func NewRegexLiteralValueContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *RegexLiteralValueContext { + var p = new(RegexLiteralValueContext) -func (s *SkipMethodContext) RPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserRPAREN, 0) + InitEmptyValueContext(&p.ValueContext) + p.parser = parser + p.CopyAll(ctx.(*ValueContext)) + + return p } -func (s *SkipMethodContext) GetRuleContext() antlr.RuleContext { +func (s *RegexLiteralValueContext) GetRuleContext() antlr.RuleContext { return s } -func (s *SkipMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) +func (s *RegexLiteralValueContext) REGEX_LITERAL() antlr.TerminalNode { + return s.GetToken(MongoShellParserREGEX_LITERAL, 0) } -func (s *SkipMethodContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *RegexLiteralValueContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterSkipMethod(s) + listenerT.EnterRegexLiteralValue(s) } } -func (s *SkipMethodContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *RegexLiteralValueContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitSkipMethod(s) + listenerT.ExitRegexLiteralValue(s) } } -func (s *SkipMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *RegexLiteralValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitSkipMethod(s) + return t.VisitRegexLiteralValue(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) SkipMethod() (localctx ISkipMethodContext) { - localctx = NewSkipMethodContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 32, MongoShellParserRULE_skipMethod) - p.EnterOuterAlt(localctx, 1) - { - p.SetState(223) - p.Match(MongoShellParserSKIP_) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(224) - p.Match(MongoShellParserLPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(225) - p.Match(MongoShellParserNUMBER) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(226) - p.Match(MongoShellParserRPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit +type ArrayValueContext struct { + ValueContext +} + +func NewArrayValueContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ArrayValueContext { + var p = new(ArrayValueContext) + + InitEmptyValueContext(&p.ValueContext) + p.parser = parser + p.CopyAll(ctx.(*ValueContext)) + + return p +} + +func (s *ArrayValueContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ArrayValueContext) Array() IArrayContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArrayContext); ok { + t = ctx.(antlr.RuleContext) + break } } -errorExit: - if p.HasError() { - v := p.GetError() - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - p.SetError(nil) + if t == nil { + return nil } - p.ExitRule() - return localctx - goto errorExit // Trick to prevent compiler error if the label is not used + + return t.(IArrayContext) } -// ICountMethodContext is an interface to support dynamic dispatch. -type ICountMethodContext interface { - antlr.ParserRuleContext +func (s *ArrayValueContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterArrayValue(s) + } +} - // GetParser returns the parser. - GetParser() antlr.Parser +func (s *ArrayValueContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitArrayValue(s) + } +} - // Getter signatures - COUNT() antlr.TerminalNode - LPAREN() antlr.TerminalNode - RPAREN() antlr.TerminalNode +func (s *ArrayValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitArrayValue(s) - // IsCountMethodContext differentiates from other interfaces. - IsCountMethodContext() + default: + return t.VisitChildren(s) + } } -type CountMethodContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser +type NewKeywordValueContext struct { + ValueContext } -func NewEmptyCountMethodContext() *CountMethodContext { - var p = new(CountMethodContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_countMethod +func NewNewKeywordValueContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NewKeywordValueContext { + var p = new(NewKeywordValueContext) + + InitEmptyValueContext(&p.ValueContext) + p.parser = parser + p.CopyAll(ctx.(*ValueContext)) + return p } -func InitEmptyCountMethodContext(p *CountMethodContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_countMethod +func (s *NewKeywordValueContext) GetRuleContext() antlr.RuleContext { + return s } -func (*CountMethodContext) IsCountMethodContext() {} +func (s *NewKeywordValueContext) NewKeywordError() INewKeywordErrorContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(INewKeywordErrorContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } -func NewCountMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CountMethodContext { - var p = new(CountMethodContext) + if t == nil { + return nil + } - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + return t.(INewKeywordErrorContext) +} - p.parser = parser - p.RuleIndex = MongoShellParserRULE_countMethod +func (s *NewKeywordValueContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterNewKeywordValue(s) + } +} - return p +func (s *NewKeywordValueContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitNewKeywordValue(s) + } } -func (s *CountMethodContext) GetParser() antlr.Parser { return s.parser } +func (s *NewKeywordValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitNewKeywordValue(s) -func (s *CountMethodContext) COUNT() antlr.TerminalNode { - return s.GetToken(MongoShellParserCOUNT, 0) + default: + return t.VisitChildren(s) + } } -func (s *CountMethodContext) LPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserLPAREN, 0) +type DocumentValueContext struct { + ValueContext } -func (s *CountMethodContext) RPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserRPAREN, 0) +func NewDocumentValueContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DocumentValueContext { + var p = new(DocumentValueContext) + + InitEmptyValueContext(&p.ValueContext) + p.parser = parser + p.CopyAll(ctx.(*ValueContext)) + + return p } -func (s *CountMethodContext) GetRuleContext() antlr.RuleContext { +func (s *DocumentValueContext) GetRuleContext() antlr.RuleContext { return s } -func (s *CountMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) +func (s *DocumentValueContext) Document() IDocumentContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDocumentContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IDocumentContext) } -func (s *CountMethodContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *DocumentValueContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterCountMethod(s) + listenerT.EnterDocumentValue(s) } } -func (s *CountMethodContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *DocumentValueContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitCountMethod(s) + listenerT.ExitDocumentValue(s) } } -func (s *CountMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *DocumentValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitCountMethod(s) + return t.VisitDocumentValue(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) CountMethod() (localctx ICountMethodContext) { - localctx = NewCountMethodContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 34, MongoShellParserRULE_countMethod) - p.EnterOuterAlt(localctx, 1) - { - p.SetState(228) - p.Match(MongoShellParserCOUNT) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(229) - p.Match(MongoShellParserLPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(230) - p.Match(MongoShellParserRPAREN) - 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 +type HelperValueContext struct { + ValueContext } -// IProjectionMethodContext is an interface to support dynamic dispatch. -type IProjectionMethodContext interface { - antlr.ParserRuleContext +func NewHelperValueContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *HelperValueContext { + var p = new(HelperValueContext) - // GetParser returns the parser. - GetParser() antlr.Parser + InitEmptyValueContext(&p.ValueContext) + p.parser = parser + p.CopyAll(ctx.(*ValueContext)) - // Getter signatures - LPAREN() antlr.TerminalNode - Document() IDocumentContext - RPAREN() antlr.TerminalNode - PROJECTION() antlr.TerminalNode - PROJECT() antlr.TerminalNode + return p +} - // IsProjectionMethodContext differentiates from other interfaces. - IsProjectionMethodContext() +func (s *HelperValueContext) GetRuleContext() antlr.RuleContext { + return s } -type ProjectionMethodContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser +func (s *HelperValueContext) HelperFunction() IHelperFunctionContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IHelperFunctionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IHelperFunctionContext) } -func NewEmptyProjectionMethodContext() *ProjectionMethodContext { - var p = new(ProjectionMethodContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_projectionMethod - return p +func (s *HelperValueContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterHelperValue(s) + } } -func InitEmptyProjectionMethodContext(p *ProjectionMethodContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_projectionMethod +func (s *HelperValueContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitHelperValue(s) + } } -func (*ProjectionMethodContext) IsProjectionMethodContext() {} +func (s *HelperValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitHelperValue(s) -func NewProjectionMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ProjectionMethodContext { - var p = new(ProjectionMethodContext) + default: + return t.VisitChildren(s) + } +} - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) +type LiteralValueContext struct { + ValueContext +} +func NewLiteralValueContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LiteralValueContext { + var p = new(LiteralValueContext) + + InitEmptyValueContext(&p.ValueContext) p.parser = parser - p.RuleIndex = MongoShellParserRULE_projectionMethod + p.CopyAll(ctx.(*ValueContext)) return p } -func (s *ProjectionMethodContext) GetParser() antlr.Parser { return s.parser } - -func (s *ProjectionMethodContext) LPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserLPAREN, 0) +func (s *LiteralValueContext) GetRuleContext() antlr.RuleContext { + return s } -func (s *ProjectionMethodContext) Document() IDocumentContext { +func (s *LiteralValueContext) Literal() ILiteralContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IDocumentContext); ok { + if _, ok := ctx.(ILiteralContext); ok { t = ctx.(antlr.RuleContext) break } @@ -4186,87 +23195,104 @@ func (s *ProjectionMethodContext) Document() IDocumentContext { return nil } - return t.(IDocumentContext) -} - -func (s *ProjectionMethodContext) RPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserRPAREN, 0) -} - -func (s *ProjectionMethodContext) PROJECTION() antlr.TerminalNode { - return s.GetToken(MongoShellParserPROJECTION, 0) -} - -func (s *ProjectionMethodContext) PROJECT() antlr.TerminalNode { - return s.GetToken(MongoShellParserPROJECT, 0) -} - -func (s *ProjectionMethodContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *ProjectionMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) + return t.(ILiteralContext) } -func (s *ProjectionMethodContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *LiteralValueContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterProjectionMethod(s) + listenerT.EnterLiteralValue(s) } } -func (s *ProjectionMethodContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *LiteralValueContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitProjectionMethod(s) + listenerT.ExitLiteralValue(s) } } -func (s *ProjectionMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *LiteralValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitProjectionMethod(s) + return t.VisitLiteralValue(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) ProjectionMethod() (localctx IProjectionMethodContext) { - localctx = NewProjectionMethodContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 36, MongoShellParserRULE_projectionMethod) - var _la int +func (p *MongoShellParser) Value() (localctx IValueContext) { + localctx = NewValueContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 186, MongoShellParserRULE_value) + p.SetState(1142) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } - p.EnterOuterAlt(localctx, 1) - { - p.SetState(232) - _la = p.GetTokenStream().LA(1) + switch p.GetTokenStream().LA(1) { + case MongoShellParserLBRACE: + localctx = NewDocumentValueContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1135) + p.Document() + } - if !(_la == MongoShellParserPROJECTION || _la == MongoShellParserPROJECT) { - p.GetErrorHandler().RecoverInline(p) - } else { - p.GetErrorHandler().ReportMatch(p) - p.Consume() + case MongoShellParserLBRACKET: + localctx = NewArrayValueContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(1136) + p.Array() } - } - { - p.SetState(233) - p.Match(MongoShellParserLPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit + + case MongoShellParserOBJECT_ID, MongoShellParserISO_DATE, MongoShellParserDATE, MongoShellParserUUID, MongoShellParserLONG, MongoShellParserNUMBER_LONG, MongoShellParserINT32, MongoShellParserNUMBER_INT, MongoShellParserDOUBLE, MongoShellParserDECIMAL128, MongoShellParserNUMBER_DECIMAL, MongoShellParserTIMESTAMP, MongoShellParserBIN_DATA, MongoShellParserBINARY, MongoShellParserBSON_REG_EXP, MongoShellParserHEX_DATA: + localctx = NewHelperValueContext(p, localctx) + p.EnterOuterAlt(localctx, 3) + { + p.SetState(1137) + p.HelperFunction() + } + + case MongoShellParserREGEX_LITERAL: + localctx = NewRegexLiteralValueContext(p, localctx) + p.EnterOuterAlt(localctx, 4) + { + p.SetState(1138) + p.Match(MongoShellParserREGEX_LITERAL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case MongoShellParserREG_EXP: + localctx = NewRegexpConstructorValueContext(p, localctx) + p.EnterOuterAlt(localctx, 5) + { + p.SetState(1139) + p.RegExpConstructor() + } + + case MongoShellParserTRUE, MongoShellParserFALSE, MongoShellParserNULL, MongoShellParserNUMBER, MongoShellParserDOUBLE_QUOTED_STRING, MongoShellParserSINGLE_QUOTED_STRING: + localctx = NewLiteralValueContext(p, localctx) + p.EnterOuterAlt(localctx, 6) + { + p.SetState(1140) + p.Literal() } - } - { - p.SetState(234) - p.Document() - } - { - p.SetState(235) - p.Match(MongoShellParserRPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit + + case MongoShellParserNEW: + localctx = NewNewKeywordValueContext(p, localctx) + p.EnterOuterAlt(localctx, 7) + { + p.SetState(1141) + p.NewKeywordError() } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit } errorExit: @@ -4282,80 +23308,153 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IGenericMethodContext is an interface to support dynamic dispatch. -type IGenericMethodContext interface { +// INewKeywordErrorContext is an interface to support dynamic dispatch. +type INewKeywordErrorContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - Identifier() IIdentifierContext + NEW() antlr.TerminalNode LPAREN() antlr.TerminalNode RPAREN() antlr.TerminalNode + OBJECT_ID() antlr.TerminalNode + ISO_DATE() antlr.TerminalNode + DATE() antlr.TerminalNode + UUID() antlr.TerminalNode + LONG() antlr.TerminalNode + NUMBER_LONG() antlr.TerminalNode + INT32() antlr.TerminalNode + NUMBER_INT() antlr.TerminalNode + DOUBLE() antlr.TerminalNode + DECIMAL128() antlr.TerminalNode + NUMBER_DECIMAL() antlr.TerminalNode + TIMESTAMP() antlr.TerminalNode + REG_EXP() antlr.TerminalNode + BIN_DATA() antlr.TerminalNode + BINARY() antlr.TerminalNode + BSON_REG_EXP() antlr.TerminalNode + HEX_DATA() antlr.TerminalNode Arguments() IArgumentsContext - // IsGenericMethodContext differentiates from other interfaces. - IsGenericMethodContext() + // IsNewKeywordErrorContext differentiates from other interfaces. + IsNewKeywordErrorContext() } -type GenericMethodContext struct { +type NewKeywordErrorContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyGenericMethodContext() *GenericMethodContext { - var p = new(GenericMethodContext) +func NewEmptyNewKeywordErrorContext() *NewKeywordErrorContext { + var p = new(NewKeywordErrorContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_genericMethod + p.RuleIndex = MongoShellParserRULE_newKeywordError return p } -func InitEmptyGenericMethodContext(p *GenericMethodContext) { +func InitEmptyNewKeywordErrorContext(p *NewKeywordErrorContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_genericMethod + p.RuleIndex = MongoShellParserRULE_newKeywordError } -func (*GenericMethodContext) IsGenericMethodContext() {} +func (*NewKeywordErrorContext) IsNewKeywordErrorContext() {} -func NewGenericMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *GenericMethodContext { - var p = new(GenericMethodContext) +func NewNewKeywordErrorContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *NewKeywordErrorContext { + var p = new(NewKeywordErrorContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = MongoShellParserRULE_genericMethod + p.RuleIndex = MongoShellParserRULE_newKeywordError return p } -func (s *GenericMethodContext) GetParser() antlr.Parser { return s.parser } - -func (s *GenericMethodContext) Identifier() IIdentifierContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IIdentifierContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } +func (s *NewKeywordErrorContext) GetParser() antlr.Parser { return s.parser } - return t.(IIdentifierContext) +func (s *NewKeywordErrorContext) NEW() antlr.TerminalNode { + return s.GetToken(MongoShellParserNEW, 0) } -func (s *GenericMethodContext) LPAREN() antlr.TerminalNode { +func (s *NewKeywordErrorContext) LPAREN() antlr.TerminalNode { return s.GetToken(MongoShellParserLPAREN, 0) } -func (s *GenericMethodContext) RPAREN() antlr.TerminalNode { +func (s *NewKeywordErrorContext) RPAREN() antlr.TerminalNode { return s.GetToken(MongoShellParserRPAREN, 0) } -func (s *GenericMethodContext) Arguments() IArgumentsContext { +func (s *NewKeywordErrorContext) OBJECT_ID() antlr.TerminalNode { + return s.GetToken(MongoShellParserOBJECT_ID, 0) +} + +func (s *NewKeywordErrorContext) ISO_DATE() antlr.TerminalNode { + return s.GetToken(MongoShellParserISO_DATE, 0) +} + +func (s *NewKeywordErrorContext) DATE() antlr.TerminalNode { + return s.GetToken(MongoShellParserDATE, 0) +} + +func (s *NewKeywordErrorContext) UUID() antlr.TerminalNode { + return s.GetToken(MongoShellParserUUID, 0) +} + +func (s *NewKeywordErrorContext) LONG() antlr.TerminalNode { + return s.GetToken(MongoShellParserLONG, 0) +} + +func (s *NewKeywordErrorContext) NUMBER_LONG() antlr.TerminalNode { + return s.GetToken(MongoShellParserNUMBER_LONG, 0) +} + +func (s *NewKeywordErrorContext) INT32() antlr.TerminalNode { + return s.GetToken(MongoShellParserINT32, 0) +} + +func (s *NewKeywordErrorContext) NUMBER_INT() antlr.TerminalNode { + return s.GetToken(MongoShellParserNUMBER_INT, 0) +} + +func (s *NewKeywordErrorContext) DOUBLE() antlr.TerminalNode { + return s.GetToken(MongoShellParserDOUBLE, 0) +} + +func (s *NewKeywordErrorContext) DECIMAL128() antlr.TerminalNode { + return s.GetToken(MongoShellParserDECIMAL128, 0) +} + +func (s *NewKeywordErrorContext) NUMBER_DECIMAL() antlr.TerminalNode { + return s.GetToken(MongoShellParserNUMBER_DECIMAL, 0) +} + +func (s *NewKeywordErrorContext) TIMESTAMP() antlr.TerminalNode { + return s.GetToken(MongoShellParserTIMESTAMP, 0) +} + +func (s *NewKeywordErrorContext) REG_EXP() antlr.TerminalNode { + return s.GetToken(MongoShellParserREG_EXP, 0) +} + +func (s *NewKeywordErrorContext) BIN_DATA() antlr.TerminalNode { + return s.GetToken(MongoShellParserBIN_DATA, 0) +} + +func (s *NewKeywordErrorContext) BINARY() antlr.TerminalNode { + return s.GetToken(MongoShellParserBINARY, 0) +} + +func (s *NewKeywordErrorContext) BSON_REG_EXP() antlr.TerminalNode { + return s.GetToken(MongoShellParserBSON_REG_EXP, 0) +} + +func (s *NewKeywordErrorContext) HEX_DATA() antlr.TerminalNode { + return s.GetToken(MongoShellParserHEX_DATA, 0) +} + +func (s *NewKeywordErrorContext) Arguments() IArgumentsContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { if _, ok := ctx.(IArgumentsContext); ok { @@ -4371,70 +23470,86 @@ func (s *GenericMethodContext) Arguments() IArgumentsContext { return t.(IArgumentsContext) } -func (s *GenericMethodContext) GetRuleContext() antlr.RuleContext { +func (s *NewKeywordErrorContext) GetRuleContext() antlr.RuleContext { return s } -func (s *GenericMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *NewKeywordErrorContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *GenericMethodContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *NewKeywordErrorContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterGenericMethod(s) + listenerT.EnterNewKeywordError(s) } } -func (s *GenericMethodContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *NewKeywordErrorContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitGenericMethod(s) + listenerT.ExitNewKeywordError(s) } } -func (s *GenericMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *NewKeywordErrorContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitGenericMethod(s) + return t.VisitNewKeywordError(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) GenericMethod() (localctx IGenericMethodContext) { - localctx = NewGenericMethodContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 38, MongoShellParserRULE_genericMethod) +func (p *MongoShellParser) NewKeywordError() (localctx INewKeywordErrorContext) { + localctx = NewNewKeywordErrorContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 188, MongoShellParserRULE_newKeywordError) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(237) - p.Identifier() + p.SetState(1144) + p.Match(MongoShellParserNEW) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { - p.SetState(238) + p.SetState(1145) + _la = p.GetTokenStream().LA(1) + + if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073733632) != 0) { + p.GetErrorHandler().RecoverInline(p) + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + p.NotifyErrorListeners("'new' keyword is not supported. Use ObjectId(), ISODate(), UUID(), etc. directly without 'new'", nil, nil) + { + p.SetState(1147) p.Match(MongoShellParserLPAREN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(240) + p.SetState(1149) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&67564989593936832) != 0 { + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { { - p.SetState(239) + p.SetState(1148) p.Arguments() } } { - p.SetState(242) + p.SetState(1151) p.Match(MongoShellParserRPAREN) if p.HasError() { // Recognition error - abort rule @@ -4455,69 +23570,79 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IArgumentsContext is an interface to support dynamic dispatch. -type IArgumentsContext interface { +// IArrayContext is an interface to support dynamic dispatch. +type IArrayContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - AllArgument() []IArgumentContext - Argument(i int) IArgumentContext + LBRACKET() antlr.TerminalNode + RBRACKET() antlr.TerminalNode + AllValue() []IValueContext + Value(i int) IValueContext AllCOMMA() []antlr.TerminalNode COMMA(i int) antlr.TerminalNode - // IsArgumentsContext differentiates from other interfaces. - IsArgumentsContext() + // IsArrayContext differentiates from other interfaces. + IsArrayContext() } -type ArgumentsContext struct { +type ArrayContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyArgumentsContext() *ArgumentsContext { - var p = new(ArgumentsContext) +func NewEmptyArrayContext() *ArrayContext { + var p = new(ArrayContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_arguments + p.RuleIndex = MongoShellParserRULE_array return p } -func InitEmptyArgumentsContext(p *ArgumentsContext) { +func InitEmptyArrayContext(p *ArrayContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_arguments + p.RuleIndex = MongoShellParserRULE_array } -func (*ArgumentsContext) IsArgumentsContext() {} +func (*ArrayContext) IsArrayContext() {} -func NewArgumentsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ArgumentsContext { - var p = new(ArgumentsContext) +func NewArrayContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ArrayContext { + var p = new(ArrayContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = MongoShellParserRULE_arguments + p.RuleIndex = MongoShellParserRULE_array return p } -func (s *ArgumentsContext) GetParser() antlr.Parser { return s.parser } +func (s *ArrayContext) GetParser() antlr.Parser { return s.parser } -func (s *ArgumentsContext) AllArgument() []IArgumentContext { +func (s *ArrayContext) LBRACKET() antlr.TerminalNode { + return s.GetToken(MongoShellParserLBRACKET, 0) +} + +func (s *ArrayContext) RBRACKET() antlr.TerminalNode { + return s.GetToken(MongoShellParserRBRACKET, 0) +} + +func (s *ArrayContext) AllValue() []IValueContext { children := s.GetChildren() len := 0 for _, ctx := range children { - if _, ok := ctx.(IArgumentContext); ok { + if _, ok := ctx.(IValueContext); ok { len++ } } - tst := make([]IArgumentContext, len) + tst := make([]IValueContext, len) i := 0 for _, ctx := range children { - if t, ok := ctx.(IArgumentContext); ok { - tst[i] = t.(IArgumentContext) + if t, ok := ctx.(IValueContext); ok { + tst[i] = t.(IValueContext) i++ } } @@ -4525,11 +23650,11 @@ func (s *ArgumentsContext) AllArgument() []IArgumentContext { return tst } -func (s *ArgumentsContext) Argument(i int) IArgumentContext { +func (s *ArrayContext) Value(i int) IValueContext { var t antlr.RuleContext j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IArgumentContext); ok { + if _, ok := ctx.(IValueContext); ok { if j == i { t = ctx.(antlr.RuleContext) break @@ -4542,112 +23667,138 @@ func (s *ArgumentsContext) Argument(i int) IArgumentContext { return nil } - return t.(IArgumentContext) + return t.(IValueContext) } -func (s *ArgumentsContext) AllCOMMA() []antlr.TerminalNode { +func (s *ArrayContext) AllCOMMA() []antlr.TerminalNode { return s.GetTokens(MongoShellParserCOMMA) } -func (s *ArgumentsContext) COMMA(i int) antlr.TerminalNode { +func (s *ArrayContext) COMMA(i int) antlr.TerminalNode { return s.GetToken(MongoShellParserCOMMA, i) } -func (s *ArgumentsContext) GetRuleContext() antlr.RuleContext { +func (s *ArrayContext) GetRuleContext() antlr.RuleContext { return s } -func (s *ArgumentsContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *ArrayContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *ArgumentsContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *ArrayContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterArguments(s) + listenerT.EnterArray(s) } } -func (s *ArgumentsContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *ArrayContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitArguments(s) + listenerT.ExitArray(s) } } -func (s *ArgumentsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *ArrayContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitArguments(s) + return t.VisitArray(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) Arguments() (localctx IArgumentsContext) { - localctx = NewArgumentsContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 40, MongoShellParserRULE_arguments) +func (p *MongoShellParser) Array() (localctx IArrayContext) { + localctx = NewArrayContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 190, MongoShellParserRULE_array) var _la int var _alt int p.EnterOuterAlt(localctx, 1) { - p.SetState(244) - p.Argument() + p.SetState(1153) + p.Match(MongoShellParserLBRACKET) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - p.SetState(249) + p.SetState(1165) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 17, p.GetParserRuleContext()) - if p.HasError() { - goto errorExit - } - for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { - if _alt == 1 { - { - p.SetState(245) - p.Match(MongoShellParserCOMMA) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(246) - p.Argument() - } + _la = p.GetTokenStream().LA(1) + if ((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1073734592) != 0) || ((int64((_la-138)) & ^0x3f) == 0 && ((int64(1)<<(_la-138))&30725) != 0) { + { + p.SetState(1154) + p.Value() } - p.SetState(251) + p.SetState(1159) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 17, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 73, p.GetParserRuleContext()) if p.HasError() { goto errorExit } - } - p.SetState(253) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) + for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { + if _alt == 1 { + { + p.SetState(1155) + p.Match(MongoShellParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1156) + p.Value() + } - if _la == MongoShellParserCOMMA { - { - p.SetState(252) - p.Match(MongoShellParserCOMMA) + } + p.SetState(1161) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 73, p.GetParserRuleContext()) if p.HasError() { - // Recognition error - abort rule goto errorExit } } + p.SetState(1163) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == MongoShellParserCOMMA { + { + p.SetState(1162) + p.Match(MongoShellParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + } } + { + p.SetState(1167) + p.Match(MongoShellParserRBRACKET) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } errorExit: if p.HasError() { @@ -4662,56 +23813,68 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IArgumentContext is an interface to support dynamic dispatch. -type IArgumentContext interface { +// IHelperFunctionContext is an interface to support dynamic dispatch. +type IHelperFunctionContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - Value() IValueContext + ObjectIdHelper() IObjectIdHelperContext + IsoDateHelper() IIsoDateHelperContext + DateHelper() IDateHelperContext + UuidHelper() IUuidHelperContext + LongHelper() ILongHelperContext + Int32Helper() IInt32HelperContext + DoubleHelper() IDoubleHelperContext + Decimal128Helper() IDecimal128HelperContext + TimestampHelper() ITimestampHelperContext + BinDataHelper() IBinDataHelperContext + BinaryHelper() IBinaryHelperContext + BsonRegExpHelper() IBsonRegExpHelperContext + HexDataHelper() IHexDataHelperContext - // IsArgumentContext differentiates from other interfaces. - IsArgumentContext() + // IsHelperFunctionContext differentiates from other interfaces. + IsHelperFunctionContext() } -type ArgumentContext struct { +type HelperFunctionContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyArgumentContext() *ArgumentContext { - var p = new(ArgumentContext) +func NewEmptyHelperFunctionContext() *HelperFunctionContext { + var p = new(HelperFunctionContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_argument + p.RuleIndex = MongoShellParserRULE_helperFunction return p } -func InitEmptyArgumentContext(p *ArgumentContext) { +func InitEmptyHelperFunctionContext(p *HelperFunctionContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_argument + p.RuleIndex = MongoShellParserRULE_helperFunction } -func (*ArgumentContext) IsArgumentContext() {} +func (*HelperFunctionContext) IsHelperFunctionContext() {} -func NewArgumentContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ArgumentContext { - var p = new(ArgumentContext) +func NewHelperFunctionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *HelperFunctionContext { + var p = new(HelperFunctionContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = MongoShellParserRULE_argument + p.RuleIndex = MongoShellParserRULE_helperFunction return p } -func (s *ArgumentContext) GetParser() antlr.Parser { return s.parser } +func (s *HelperFunctionContext) GetParser() antlr.Parser { return s.parser } -func (s *ArgumentContext) Value() IValueContext { +func (s *HelperFunctionContext) ObjectIdHelper() IObjectIdHelperContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IValueContext); ok { + if _, ok := ctx.(IObjectIdHelperContext); ok { t = ctx.(antlr.RuleContext) break } @@ -4721,151 +23884,175 @@ func (s *ArgumentContext) Value() IValueContext { return nil } - return t.(IValueContext) + return t.(IObjectIdHelperContext) } -func (s *ArgumentContext) GetRuleContext() antlr.RuleContext { - return s -} +func (s *HelperFunctionContext) IsoDateHelper() IIsoDateHelperContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIsoDateHelperContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } -func (s *ArgumentContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) + if t == nil { + return nil + } + + return t.(IIsoDateHelperContext) } -func (s *ArgumentContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterArgument(s) +func (s *HelperFunctionContext) DateHelper() IDateHelperContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDateHelperContext); ok { + t = ctx.(antlr.RuleContext) + break + } } -} -func (s *ArgumentContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitArgument(s) + if t == nil { + return nil } + + return t.(IDateHelperContext) } -func (s *ArgumentContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case MongoShellParserVisitor: - return t.VisitArgument(s) +func (s *HelperFunctionContext) UuidHelper() IUuidHelperContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IUuidHelperContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } - default: - return t.VisitChildren(s) + if t == nil { + return nil } + + return t.(IUuidHelperContext) } -func (p *MongoShellParser) Argument() (localctx IArgumentContext) { - localctx = NewArgumentContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 42, MongoShellParserRULE_argument) - p.EnterOuterAlt(localctx, 1) - { - p.SetState(255) - p.Value() +func (s *HelperFunctionContext) LongHelper() ILongHelperContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ILongHelperContext); ok { + t = ctx.(antlr.RuleContext) + break + } } -errorExit: - if p.HasError() { - v := p.GetError() - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - p.SetError(nil) + if t == nil { + return nil } - p.ExitRule() - return localctx - goto errorExit // Trick to prevent compiler error if the label is not used -} -// IDocumentContext is an interface to support dynamic dispatch. -type IDocumentContext interface { - antlr.ParserRuleContext + return t.(ILongHelperContext) +} - // GetParser returns the parser. - GetParser() antlr.Parser +func (s *HelperFunctionContext) Int32Helper() IInt32HelperContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IInt32HelperContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } - // Getter signatures - LBRACE() antlr.TerminalNode - RBRACE() antlr.TerminalNode - AllPair() []IPairContext - Pair(i int) IPairContext - AllCOMMA() []antlr.TerminalNode - COMMA(i int) antlr.TerminalNode + if t == nil { + return nil + } - // IsDocumentContext differentiates from other interfaces. - IsDocumentContext() + return t.(IInt32HelperContext) } -type DocumentContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser -} +func (s *HelperFunctionContext) DoubleHelper() IDoubleHelperContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDoubleHelperContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } -func NewEmptyDocumentContext() *DocumentContext { - var p = new(DocumentContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_document - return p -} + if t == nil { + return nil + } -func InitEmptyDocumentContext(p *DocumentContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_document + return t.(IDoubleHelperContext) } -func (*DocumentContext) IsDocumentContext() {} +func (s *HelperFunctionContext) Decimal128Helper() IDecimal128HelperContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDecimal128HelperContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } -func NewDocumentContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DocumentContext { - var p = new(DocumentContext) + if t == nil { + return nil + } - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + return t.(IDecimal128HelperContext) +} - p.parser = parser - p.RuleIndex = MongoShellParserRULE_document +func (s *HelperFunctionContext) TimestampHelper() ITimestampHelperContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITimestampHelperContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } - return p + if t == nil { + return nil + } + + return t.(ITimestampHelperContext) } -func (s *DocumentContext) GetParser() antlr.Parser { return s.parser } +func (s *HelperFunctionContext) BinDataHelper() IBinDataHelperContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IBinDataHelperContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } -func (s *DocumentContext) LBRACE() antlr.TerminalNode { - return s.GetToken(MongoShellParserLBRACE, 0) -} + if t == nil { + return nil + } -func (s *DocumentContext) RBRACE() antlr.TerminalNode { - return s.GetToken(MongoShellParserRBRACE, 0) + return t.(IBinDataHelperContext) } -func (s *DocumentContext) AllPair() []IPairContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IPairContext); ok { - len++ +func (s *HelperFunctionContext) BinaryHelper() IBinaryHelperContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IBinaryHelperContext); ok { + t = ctx.(antlr.RuleContext) + break } } - tst := make([]IPairContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IPairContext); ok { - tst[i] = t.(IPairContext) - i++ - } + if t == nil { + return nil } - return tst + return t.(IBinaryHelperContext) } -func (s *DocumentContext) Pair(i int) IPairContext { +func (s *HelperFunctionContext) BsonRegExpHelper() IBsonRegExpHelperContext { var t antlr.RuleContext - j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IPairContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ + if _, ok := ctx.(IBsonRegExpHelperContext); ok { + t = ctx.(antlr.RuleContext) + break } } @@ -4873,137 +24060,159 @@ func (s *DocumentContext) Pair(i int) IPairContext { return nil } - return t.(IPairContext) + return t.(IBsonRegExpHelperContext) } -func (s *DocumentContext) AllCOMMA() []antlr.TerminalNode { - return s.GetTokens(MongoShellParserCOMMA) -} +func (s *HelperFunctionContext) HexDataHelper() IHexDataHelperContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IHexDataHelperContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } -func (s *DocumentContext) COMMA(i int) antlr.TerminalNode { - return s.GetToken(MongoShellParserCOMMA, i) + if t == nil { + return nil + } + + return t.(IHexDataHelperContext) } -func (s *DocumentContext) GetRuleContext() antlr.RuleContext { +func (s *HelperFunctionContext) GetRuleContext() antlr.RuleContext { return s } -func (s *DocumentContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *HelperFunctionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *DocumentContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *HelperFunctionContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterDocument(s) + listenerT.EnterHelperFunction(s) } } -func (s *DocumentContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *HelperFunctionContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitDocument(s) + listenerT.ExitHelperFunction(s) } } -func (s *DocumentContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *HelperFunctionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitDocument(s) + return t.VisitHelperFunction(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) Document() (localctx IDocumentContext) { - localctx = NewDocumentContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 44, MongoShellParserRULE_document) - var _la int - - var _alt int - - p.EnterOuterAlt(localctx, 1) - { - p.SetState(257) - p.Match(MongoShellParserLBRACE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.SetState(269) +func (p *MongoShellParser) HelperFunction() (localctx IHelperFunctionContext) { + localctx = NewHelperFunctionContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 192, MongoShellParserRULE_helperFunction) + p.SetState(1182) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _la = p.GetTokenStream().LA(1) - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&126664289275609086) != 0 { + switch p.GetTokenStream().LA(1) { + case MongoShellParserOBJECT_ID: + p.EnterOuterAlt(localctx, 1) { - p.SetState(258) - p.Pair() + p.SetState(1169) + p.ObjectIdHelper() } - p.SetState(263) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit + + case MongoShellParserISO_DATE: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(1170) + p.IsoDateHelper() } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 19, p.GetParserRuleContext()) - if p.HasError() { - goto errorExit + + case MongoShellParserDATE: + p.EnterOuterAlt(localctx, 3) + { + p.SetState(1171) + p.DateHelper() } - for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { - if _alt == 1 { - { - p.SetState(259) - p.Match(MongoShellParserCOMMA) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(260) - p.Pair() - } - } - p.SetState(265) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 19, p.GetParserRuleContext()) - if p.HasError() { - goto errorExit - } + case MongoShellParserUUID: + p.EnterOuterAlt(localctx, 4) + { + p.SetState(1172) + p.UuidHelper() } - p.SetState(267) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit + + case MongoShellParserLONG, MongoShellParserNUMBER_LONG: + p.EnterOuterAlt(localctx, 5) + { + p.SetState(1173) + p.LongHelper() } - _la = p.GetTokenStream().LA(1) - if _la == MongoShellParserCOMMA { - { - p.SetState(266) - p.Match(MongoShellParserCOMMA) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } + case MongoShellParserINT32, MongoShellParserNUMBER_INT: + p.EnterOuterAlt(localctx, 6) + { + p.SetState(1174) + p.Int32Helper() + } + case MongoShellParserDOUBLE: + p.EnterOuterAlt(localctx, 7) + { + p.SetState(1175) + p.DoubleHelper() } - } - { - p.SetState(271) - p.Match(MongoShellParserRBRACE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit + case MongoShellParserDECIMAL128, MongoShellParserNUMBER_DECIMAL: + p.EnterOuterAlt(localctx, 8) + { + p.SetState(1176) + p.Decimal128Helper() + } + + case MongoShellParserTIMESTAMP: + p.EnterOuterAlt(localctx, 9) + { + p.SetState(1177) + p.TimestampHelper() + } + + case MongoShellParserBIN_DATA: + p.EnterOuterAlt(localctx, 10) + { + p.SetState(1178) + p.BinDataHelper() + } + + case MongoShellParserBINARY: + p.EnterOuterAlt(localctx, 11) + { + p.SetState(1179) + p.BinaryHelper() + } + + case MongoShellParserBSON_REG_EXP: + p.EnterOuterAlt(localctx, 12) + { + p.SetState(1180) + p.BsonRegExpHelper() } + + case MongoShellParserHEX_DATA: + p.EnterOuterAlt(localctx, 13) + { + p.SetState(1181) + p.HexDataHelper() + } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit } errorExit: @@ -5019,78 +24228,71 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IPairContext is an interface to support dynamic dispatch. -type IPairContext interface { +// IObjectIdHelperContext is an interface to support dynamic dispatch. +type IObjectIdHelperContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - Key() IKeyContext - COLON() antlr.TerminalNode - Value() IValueContext + OBJECT_ID() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + StringLiteral() IStringLiteralContext - // IsPairContext differentiates from other interfaces. - IsPairContext() + // IsObjectIdHelperContext differentiates from other interfaces. + IsObjectIdHelperContext() } -type PairContext struct { +type ObjectIdHelperContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyPairContext() *PairContext { - var p = new(PairContext) +func NewEmptyObjectIdHelperContext() *ObjectIdHelperContext { + var p = new(ObjectIdHelperContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_pair + p.RuleIndex = MongoShellParserRULE_objectIdHelper return p } -func InitEmptyPairContext(p *PairContext) { +func InitEmptyObjectIdHelperContext(p *ObjectIdHelperContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_pair + p.RuleIndex = MongoShellParserRULE_objectIdHelper } -func (*PairContext) IsPairContext() {} +func (*ObjectIdHelperContext) IsObjectIdHelperContext() {} -func NewPairContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PairContext { - var p = new(PairContext) +func NewObjectIdHelperContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ObjectIdHelperContext { + var p = new(ObjectIdHelperContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = MongoShellParserRULE_pair + p.RuleIndex = MongoShellParserRULE_objectIdHelper return p } -func (s *PairContext) GetParser() antlr.Parser { return s.parser } - -func (s *PairContext) Key() IKeyContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IKeyContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } +func (s *ObjectIdHelperContext) GetParser() antlr.Parser { return s.parser } - if t == nil { - return nil - } +func (s *ObjectIdHelperContext) OBJECT_ID() antlr.TerminalNode { + return s.GetToken(MongoShellParserOBJECT_ID, 0) +} - return t.(IKeyContext) +func (s *ObjectIdHelperContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) } -func (s *PairContext) COLON() antlr.TerminalNode { - return s.GetToken(MongoShellParserCOLON, 0) +func (s *ObjectIdHelperContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) } -func (s *PairContext) Value() IValueContext { +func (s *ObjectIdHelperContext) StringLiteral() IStringLiteralContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IValueContext); ok { + if _, ok := ctx.(IStringLiteralContext); ok { t = ctx.(antlr.RuleContext) break } @@ -5100,58 +24302,82 @@ func (s *PairContext) Value() IValueContext { return nil } - return t.(IValueContext) + return t.(IStringLiteralContext) } -func (s *PairContext) GetRuleContext() antlr.RuleContext { +func (s *ObjectIdHelperContext) GetRuleContext() antlr.RuleContext { return s } -func (s *PairContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *ObjectIdHelperContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *PairContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *ObjectIdHelperContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterPair(s) + listenerT.EnterObjectIdHelper(s) } } -func (s *PairContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *ObjectIdHelperContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitPair(s) + listenerT.ExitObjectIdHelper(s) } } -func (s *PairContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *ObjectIdHelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitPair(s) + return t.VisitObjectIdHelper(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) Pair() (localctx IPairContext) { - localctx = NewPairContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 46, MongoShellParserRULE_pair) +func (p *MongoShellParser) ObjectIdHelper() (localctx IObjectIdHelperContext) { + localctx = NewObjectIdHelperContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 194, MongoShellParserRULE_objectIdHelper) + var _la int + p.EnterOuterAlt(localctx, 1) { - p.SetState(273) - p.Key() + p.SetState(1184) + p.Match(MongoShellParserOBJECT_ID) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { - p.SetState(274) - p.Match(MongoShellParserCOLON) + p.SetState(1185) + p.Match(MongoShellParserLPAREN) if p.HasError() { // Recognition error - abort rule goto errorExit } } + p.SetState(1187) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + _la = p.GetTokenStream().LA(1) + + if _la == MongoShellParserDOUBLE_QUOTED_STRING || _la == MongoShellParserSINGLE_QUOTED_STRING { + { + p.SetState(1186) + p.StringLiteral() + } + + } { - p.SetState(275) - p.Value() + p.SetState(1189) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } errorExit: @@ -5167,79 +24393,68 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IKeyContext is an interface to support dynamic dispatch. -type IKeyContext interface { +// IIsoDateHelperContext is an interface to support dynamic dispatch. +type IIsoDateHelperContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser - // IsKeyContext differentiates from other interfaces. - IsKeyContext() + + // Getter signatures + ISO_DATE() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + StringLiteral() IStringLiteralContext + + // IsIsoDateHelperContext differentiates from other interfaces. + IsIsoDateHelperContext() } -type KeyContext struct { +type IsoDateHelperContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyKeyContext() *KeyContext { - var p = new(KeyContext) +func NewEmptyIsoDateHelperContext() *IsoDateHelperContext { + var p = new(IsoDateHelperContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_key + p.RuleIndex = MongoShellParserRULE_isoDateHelper return p } -func InitEmptyKeyContext(p *KeyContext) { +func InitEmptyIsoDateHelperContext(p *IsoDateHelperContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_key + p.RuleIndex = MongoShellParserRULE_isoDateHelper } -func (*KeyContext) IsKeyContext() {} +func (*IsoDateHelperContext) IsIsoDateHelperContext() {} -func NewKeyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *KeyContext { - var p = new(KeyContext) +func NewIsoDateHelperContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IsoDateHelperContext { + var p = new(IsoDateHelperContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = MongoShellParserRULE_key + p.RuleIndex = MongoShellParserRULE_isoDateHelper return p } -func (s *KeyContext) GetParser() antlr.Parser { return s.parser } - -func (s *KeyContext) CopyAll(ctx *KeyContext) { - s.CopyFrom(&ctx.BaseParserRuleContext) -} - -func (s *KeyContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *KeyContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) -} +func (s *IsoDateHelperContext) GetParser() antlr.Parser { return s.parser } -type QuotedKeyContext struct { - KeyContext +func (s *IsoDateHelperContext) ISO_DATE() antlr.TerminalNode { + return s.GetToken(MongoShellParserISO_DATE, 0) } -func NewQuotedKeyContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *QuotedKeyContext { - var p = new(QuotedKeyContext) - - InitEmptyKeyContext(&p.KeyContext) - p.parser = parser - p.CopyAll(ctx.(*KeyContext)) - - return p +func (s *IsoDateHelperContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) } -func (s *QuotedKeyContext) GetRuleContext() antlr.RuleContext { - return s +func (s *IsoDateHelperContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) } -func (s *QuotedKeyContext) StringLiteral() IStringLiteralContext { +func (s *IsoDateHelperContext) StringLiteral() IStringLiteralContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { if _, ok := ctx.(IStringLiteralContext); ok { @@ -5255,113 +24470,79 @@ func (s *QuotedKeyContext) StringLiteral() IStringLiteralContext { return t.(IStringLiteralContext) } -func (s *QuotedKeyContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *IsoDateHelperContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *IsoDateHelperContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *IsoDateHelperContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterQuotedKey(s) + listenerT.EnterIsoDateHelper(s) } } -func (s *QuotedKeyContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *IsoDateHelperContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitQuotedKey(s) + listenerT.ExitIsoDateHelper(s) } } -func (s *QuotedKeyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *IsoDateHelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitQuotedKey(s) + return t.VisitIsoDateHelper(s) default: return t.VisitChildren(s) } } -type UnquotedKeyContext struct { - KeyContext -} - -func NewUnquotedKeyContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *UnquotedKeyContext { - var p = new(UnquotedKeyContext) - - InitEmptyKeyContext(&p.KeyContext) - p.parser = parser - p.CopyAll(ctx.(*KeyContext)) - - return p -} - -func (s *UnquotedKeyContext) GetRuleContext() antlr.RuleContext { - return s -} +func (p *MongoShellParser) IsoDateHelper() (localctx IIsoDateHelperContext) { + localctx = NewIsoDateHelperContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 196, MongoShellParserRULE_isoDateHelper) + var _la int -func (s *UnquotedKeyContext) Identifier() IIdentifierContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IIdentifierContext); ok { - t = ctx.(antlr.RuleContext) - break + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1191) + p.Match(MongoShellParserISO_DATE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit } } - - if t == nil { - return nil - } - - return t.(IIdentifierContext) -} - -func (s *UnquotedKeyContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterUnquotedKey(s) - } -} - -func (s *UnquotedKeyContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitUnquotedKey(s) - } -} - -func (s *UnquotedKeyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case MongoShellParserVisitor: - return t.VisitUnquotedKey(s) - - default: - return t.VisitChildren(s) + { + p.SetState(1192) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } -} - -func (p *MongoShellParser) Key() (localctx IKeyContext) { - localctx = NewKeyContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 48, MongoShellParserRULE_key) - p.SetState(279) + p.SetState(1194) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } + _la = p.GetTokenStream().LA(1) - switch p.GetTokenStream().LA(1) { - case MongoShellParserSHOW, MongoShellParserDBS, MongoShellParserDATABASES, MongoShellParserCOLLECTIONS, MongoShellParserDB, MongoShellParserNEW, MongoShellParserTRUE, MongoShellParserFALSE, MongoShellParserNULL, MongoShellParserGET_COLLECTION, MongoShellParserGET_COLLECTION_NAMES, MongoShellParserGET_COLLECTION_INFOS, MongoShellParserOBJECT_ID, MongoShellParserISO_DATE, MongoShellParserDATE, MongoShellParserUUID, MongoShellParserLONG, MongoShellParserNUMBER_LONG, MongoShellParserINT32, MongoShellParserNUMBER_INT, MongoShellParserDOUBLE, MongoShellParserDECIMAL128, MongoShellParserNUMBER_DECIMAL, MongoShellParserTIMESTAMP, MongoShellParserREG_EXP, MongoShellParserFIND, MongoShellParserFIND_ONE, MongoShellParserCOUNT_DOCUMENTS, MongoShellParserESTIMATED_DOCUMENT_COUNT, MongoShellParserDISTINCT, MongoShellParserAGGREGATE, MongoShellParserGET_INDEXES, MongoShellParserSORT, MongoShellParserLIMIT, MongoShellParserSKIP_, MongoShellParserPROJECTION, MongoShellParserPROJECT, MongoShellParserCOUNT, MongoShellParserDOLLAR, MongoShellParserIDENTIFIER: - localctx = NewUnquotedKeyContext(p, localctx) - p.EnterOuterAlt(localctx, 1) - { - p.SetState(277) - p.Identifier() - } - - case MongoShellParserDOUBLE_QUOTED_STRING, MongoShellParserSINGLE_QUOTED_STRING: - localctx = NewQuotedKeyContext(p, localctx) - p.EnterOuterAlt(localctx, 2) + if _la == MongoShellParserDOUBLE_QUOTED_STRING || _la == MongoShellParserSINGLE_QUOTED_STRING { { - p.SetState(278) + p.SetState(1193) p.StringLiteral() } - default: - p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) - goto errorExit + } + { + p.SetState(1196) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } errorExit: @@ -5377,82 +24558,72 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IValueContext is an interface to support dynamic dispatch. -type IValueContext interface { +// IDateHelperContext is an interface to support dynamic dispatch. +type IDateHelperContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser - // IsValueContext differentiates from other interfaces. - IsValueContext() + + // Getter signatures + DATE() antlr.TerminalNode + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + StringLiteral() IStringLiteralContext + NUMBER() antlr.TerminalNode + + // IsDateHelperContext differentiates from other interfaces. + IsDateHelperContext() } -type ValueContext struct { +type DateHelperContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyValueContext() *ValueContext { - var p = new(ValueContext) +func NewEmptyDateHelperContext() *DateHelperContext { + var p = new(DateHelperContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_value + p.RuleIndex = MongoShellParserRULE_dateHelper return p } -func InitEmptyValueContext(p *ValueContext) { +func InitEmptyDateHelperContext(p *DateHelperContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_value + p.RuleIndex = MongoShellParserRULE_dateHelper } -func (*ValueContext) IsValueContext() {} +func (*DateHelperContext) IsDateHelperContext() {} -func NewValueContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ValueContext { - var p = new(ValueContext) +func NewDateHelperContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DateHelperContext { + var p = new(DateHelperContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = MongoShellParserRULE_value + p.RuleIndex = MongoShellParserRULE_dateHelper return p } -func (s *ValueContext) GetParser() antlr.Parser { return s.parser } - -func (s *ValueContext) CopyAll(ctx *ValueContext) { - s.CopyFrom(&ctx.BaseParserRuleContext) -} - -func (s *ValueContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *ValueContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) -} +func (s *DateHelperContext) GetParser() antlr.Parser { return s.parser } -type RegexpConstructorValueContext struct { - ValueContext +func (s *DateHelperContext) DATE() antlr.TerminalNode { + return s.GetToken(MongoShellParserDATE, 0) } -func NewRegexpConstructorValueContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *RegexpConstructorValueContext { - var p = new(RegexpConstructorValueContext) - - InitEmptyValueContext(&p.ValueContext) - p.parser = parser - p.CopyAll(ctx.(*ValueContext)) - - return p +func (s *DateHelperContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) } -func (s *RegexpConstructorValueContext) GetRuleContext() antlr.RuleContext { - return s +func (s *DateHelperContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) } -func (s *RegexpConstructorValueContext) RegExpConstructor() IRegExpConstructorContext { +func (s *DateHelperContext) StringLiteral() IStringLiteralContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IRegExpConstructorContext); ok { + if _, ok := ctx.(IStringLiteralContext); ok { t = ctx.(antlr.RuleContext) break } @@ -5462,153 +24633,172 @@ func (s *RegexpConstructorValueContext) RegExpConstructor() IRegExpConstructorCo return nil } - return t.(IRegExpConstructorContext) -} - -func (s *RegexpConstructorValueContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterRegexpConstructorValue(s) - } -} - -func (s *RegexpConstructorValueContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitRegexpConstructorValue(s) - } -} - -func (s *RegexpConstructorValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case MongoShellParserVisitor: - return t.VisitRegexpConstructorValue(s) - - default: - return t.VisitChildren(s) - } -} - -type RegexLiteralValueContext struct { - ValueContext + return t.(IStringLiteralContext) } -func NewRegexLiteralValueContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *RegexLiteralValueContext { - var p = new(RegexLiteralValueContext) - - InitEmptyValueContext(&p.ValueContext) - p.parser = parser - p.CopyAll(ctx.(*ValueContext)) - - return p +func (s *DateHelperContext) NUMBER() antlr.TerminalNode { + return s.GetToken(MongoShellParserNUMBER, 0) } -func (s *RegexLiteralValueContext) GetRuleContext() antlr.RuleContext { +func (s *DateHelperContext) GetRuleContext() antlr.RuleContext { return s } -func (s *RegexLiteralValueContext) REGEX_LITERAL() antlr.TerminalNode { - return s.GetToken(MongoShellParserREGEX_LITERAL, 0) +func (s *DateHelperContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *RegexLiteralValueContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *DateHelperContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterRegexLiteralValue(s) + listenerT.EnterDateHelper(s) } } -func (s *RegexLiteralValueContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *DateHelperContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitRegexLiteralValue(s) + listenerT.ExitDateHelper(s) } } -func (s *RegexLiteralValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *DateHelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitRegexLiteralValue(s) + return t.VisitDateHelper(s) default: return t.VisitChildren(s) } } -type ArrayValueContext struct { - ValueContext -} - -func NewArrayValueContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ArrayValueContext { - var p = new(ArrayValueContext) - - InitEmptyValueContext(&p.ValueContext) - p.parser = parser - p.CopyAll(ctx.(*ValueContext)) +func (p *MongoShellParser) DateHelper() (localctx IDateHelperContext) { + localctx = NewDateHelperContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 198, MongoShellParserRULE_dateHelper) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1198) + p.Match(MongoShellParserDATE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1199) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(1202) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + switch p.GetTokenStream().LA(1) { + case MongoShellParserDOUBLE_QUOTED_STRING, MongoShellParserSINGLE_QUOTED_STRING: + { + p.SetState(1200) + p.StringLiteral() + } - return p -} + case MongoShellParserNUMBER: + { + p.SetState(1201) + p.Match(MongoShellParserNUMBER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *ArrayValueContext) GetRuleContext() antlr.RuleContext { - return s -} + case MongoShellParserRPAREN: -func (s *ArrayValueContext) Array() IArrayContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IArrayContext); ok { - t = ctx.(antlr.RuleContext) - break + default: + } + { + p.SetState(1204) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit } } - if t == nil { - return nil +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) } - - return t.(IArrayContext) + p.ExitRule() + return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } -func (s *ArrayValueContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterArrayValue(s) - } -} +// IUuidHelperContext is an interface to support dynamic dispatch. +type IUuidHelperContext interface { + antlr.ParserRuleContext -func (s *ArrayValueContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitArrayValue(s) - } + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + UUID() antlr.TerminalNode + LPAREN() antlr.TerminalNode + StringLiteral() IStringLiteralContext + RPAREN() antlr.TerminalNode + + // IsUuidHelperContext differentiates from other interfaces. + IsUuidHelperContext() } -func (s *ArrayValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case MongoShellParserVisitor: - return t.VisitArrayValue(s) +type UuidHelperContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} - default: - return t.VisitChildren(s) - } +func NewEmptyUuidHelperContext() *UuidHelperContext { + var p = new(UuidHelperContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_uuidHelper + return p } -type NewKeywordValueContext struct { - ValueContext +func InitEmptyUuidHelperContext(p *UuidHelperContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_uuidHelper } -func NewNewKeywordValueContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NewKeywordValueContext { - var p = new(NewKeywordValueContext) +func (*UuidHelperContext) IsUuidHelperContext() {} + +func NewUuidHelperContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *UuidHelperContext { + var p = new(UuidHelperContext) + + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) - InitEmptyValueContext(&p.ValueContext) p.parser = parser - p.CopyAll(ctx.(*ValueContext)) + p.RuleIndex = MongoShellParserRULE_uuidHelper return p } -func (s *NewKeywordValueContext) GetRuleContext() antlr.RuleContext { - return s +func (s *UuidHelperContext) GetParser() antlr.Parser { return s.parser } + +func (s *UuidHelperContext) UUID() antlr.TerminalNode { + return s.GetToken(MongoShellParserUUID, 0) } -func (s *NewKeywordValueContext) NewKeywordError() INewKeywordErrorContext { +func (s *UuidHelperContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *UuidHelperContext) StringLiteral() IStringLiteralContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(INewKeywordErrorContext); ok { + if _, ok := ctx.(IStringLiteralContext); ok { t = ctx.(antlr.RuleContext) break } @@ -5618,165 +24808,164 @@ func (s *NewKeywordValueContext) NewKeywordError() INewKeywordErrorContext { return nil } - return t.(INewKeywordErrorContext) + return t.(IStringLiteralContext) } -func (s *NewKeywordValueContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *UuidHelperContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *UuidHelperContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *UuidHelperContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *UuidHelperContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterNewKeywordValue(s) + listenerT.EnterUuidHelper(s) } } -func (s *NewKeywordValueContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *UuidHelperContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitNewKeywordValue(s) + listenerT.ExitUuidHelper(s) } } -func (s *NewKeywordValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *UuidHelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitNewKeywordValue(s) + return t.VisitUuidHelper(s) default: return t.VisitChildren(s) } } -type DocumentValueContext struct { - ValueContext -} - -func NewDocumentValueContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *DocumentValueContext { - var p = new(DocumentValueContext) - - InitEmptyValueContext(&p.ValueContext) - p.parser = parser - p.CopyAll(ctx.(*ValueContext)) - - return p -} - -func (s *DocumentValueContext) GetRuleContext() antlr.RuleContext { - return s -} - -func (s *DocumentValueContext) Document() IDocumentContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IDocumentContext); ok { - t = ctx.(antlr.RuleContext) - break +func (p *MongoShellParser) UuidHelper() (localctx IUuidHelperContext) { + localctx = NewUuidHelperContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 200, MongoShellParserRULE_uuidHelper) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1206) + p.Match(MongoShellParserUUID) + if p.HasError() { + // Recognition error - abort rule + goto errorExit } } - - if t == nil { - return nil + { + p.SetState(1207) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - - return t.(IDocumentContext) -} - -func (s *DocumentValueContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterDocumentValue(s) + { + p.SetState(1208) + p.StringLiteral() + } + { + p.SetState(1209) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } -} -func (s *DocumentValueContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitDocumentValue(s) +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 (s *DocumentValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case MongoShellParserVisitor: - return t.VisitDocumentValue(s) +// ILongHelperContext is an interface to support dynamic dispatch. +type ILongHelperContext interface { + antlr.ParserRuleContext - default: - return t.VisitChildren(s) - } -} + // GetParser returns the parser. + GetParser() antlr.Parser -type HelperValueContext struct { - ValueContext -} + // Getter signatures + LPAREN() antlr.TerminalNode + RPAREN() antlr.TerminalNode + LONG() antlr.TerminalNode + NUMBER_LONG() antlr.TerminalNode + NUMBER() antlr.TerminalNode + StringLiteral() IStringLiteralContext -func NewHelperValueContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *HelperValueContext { - var p = new(HelperValueContext) + // IsLongHelperContext differentiates from other interfaces. + IsLongHelperContext() +} - InitEmptyValueContext(&p.ValueContext) - p.parser = parser - p.CopyAll(ctx.(*ValueContext)) +type LongHelperContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} +func NewEmptyLongHelperContext() *LongHelperContext { + var p = new(LongHelperContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_longHelper return p } -func (s *HelperValueContext) GetRuleContext() antlr.RuleContext { - return s +func InitEmptyLongHelperContext(p *LongHelperContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_longHelper } -func (s *HelperValueContext) HelperFunction() IHelperFunctionContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IHelperFunctionContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } +func (*LongHelperContext) IsLongHelperContext() {} - if t == nil { - return nil - } +func NewLongHelperContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LongHelperContext { + var p = new(LongHelperContext) - return t.(IHelperFunctionContext) -} + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) -func (s *HelperValueContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterHelperValue(s) - } -} + p.parser = parser + p.RuleIndex = MongoShellParserRULE_longHelper -func (s *HelperValueContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitHelperValue(s) - } + return p } -func (s *HelperValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case MongoShellParserVisitor: - return t.VisitHelperValue(s) +func (s *LongHelperContext) GetParser() antlr.Parser { return s.parser } - default: - return t.VisitChildren(s) - } +func (s *LongHelperContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) } -type LiteralValueContext struct { - ValueContext +func (s *LongHelperContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) } -func NewLiteralValueContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LiteralValueContext { - var p = new(LiteralValueContext) - - InitEmptyValueContext(&p.ValueContext) - p.parser = parser - p.CopyAll(ctx.(*ValueContext)) +func (s *LongHelperContext) LONG() antlr.TerminalNode { + return s.GetToken(MongoShellParserLONG, 0) +} - return p +func (s *LongHelperContext) NUMBER_LONG() antlr.TerminalNode { + return s.GetToken(MongoShellParserNUMBER_LONG, 0) } -func (s *LiteralValueContext) GetRuleContext() antlr.RuleContext { - return s +func (s *LongHelperContext) NUMBER() antlr.TerminalNode { + return s.GetToken(MongoShellParserNUMBER, 0) } -func (s *LiteralValueContext) Literal() ILiteralContext { +func (s *LongHelperContext) StringLiteral() IStringLiteralContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ILiteralContext); ok { + if _, ok := ctx.(IStringLiteralContext); ok { t = ctx.(antlr.RuleContext) break } @@ -5786,105 +24975,99 @@ func (s *LiteralValueContext) Literal() ILiteralContext { return nil } - return t.(ILiteralContext) + return t.(IStringLiteralContext) +} + +func (s *LongHelperContext) GetRuleContext() antlr.RuleContext { + return s } -func (s *LiteralValueContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *LongHelperContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *LongHelperContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterLiteralValue(s) + listenerT.EnterLongHelper(s) } } -func (s *LiteralValueContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *LongHelperContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitLiteralValue(s) + listenerT.ExitLongHelper(s) } } -func (s *LiteralValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *LongHelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitLiteralValue(s) + return t.VisitLongHelper(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) Value() (localctx IValueContext) { - localctx = NewValueContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 50, MongoShellParserRULE_value) - p.SetState(288) +func (p *MongoShellParser) LongHelper() (localctx ILongHelperContext) { + localctx = NewLongHelperContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 202, MongoShellParserRULE_longHelper) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1211) + _la = p.GetTokenStream().LA(1) + + if !(_la == MongoShellParserLONG || _la == MongoShellParserNUMBER_LONG) { + p.GetErrorHandler().RecoverInline(p) + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + { + p.SetState(1212) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(1215) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } switch p.GetTokenStream().LA(1) { - case MongoShellParserLBRACE: - localctx = NewDocumentValueContext(p, localctx) - p.EnterOuterAlt(localctx, 1) - { - p.SetState(281) - p.Document() - } - - case MongoShellParserLBRACKET: - localctx = NewArrayValueContext(p, localctx) - p.EnterOuterAlt(localctx, 2) - { - p.SetState(282) - p.Array() - } - - case MongoShellParserOBJECT_ID, MongoShellParserISO_DATE, MongoShellParserDATE, MongoShellParserUUID, MongoShellParserLONG, MongoShellParserNUMBER_LONG, MongoShellParserINT32, MongoShellParserNUMBER_INT, MongoShellParserDOUBLE, MongoShellParserDECIMAL128, MongoShellParserNUMBER_DECIMAL, MongoShellParserTIMESTAMP: - localctx = NewHelperValueContext(p, localctx) - p.EnterOuterAlt(localctx, 3) - { - p.SetState(283) - p.HelperFunction() - } - - case MongoShellParserREGEX_LITERAL: - localctx = NewRegexLiteralValueContext(p, localctx) - p.EnterOuterAlt(localctx, 4) + case MongoShellParserNUMBER: { - p.SetState(284) - p.Match(MongoShellParserREGEX_LITERAL) + p.SetState(1213) + p.Match(MongoShellParserNUMBER) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserREG_EXP: - localctx = NewRegexpConstructorValueContext(p, localctx) - p.EnterOuterAlt(localctx, 5) - { - p.SetState(285) - p.RegExpConstructor() - } - - case MongoShellParserTRUE, MongoShellParserFALSE, MongoShellParserNULL, MongoShellParserNUMBER, MongoShellParserDOUBLE_QUOTED_STRING, MongoShellParserSINGLE_QUOTED_STRING: - localctx = NewLiteralValueContext(p, localctx) - p.EnterOuterAlt(localctx, 6) - { - p.SetState(286) - p.Literal() - } - - case MongoShellParserNEW: - localctx = NewNewKeywordValueContext(p, localctx) - p.EnterOuterAlt(localctx, 7) + case MongoShellParserDOUBLE_QUOTED_STRING, MongoShellParserSINGLE_QUOTED_STRING: { - p.SetState(287) - p.NewKeywordError() + p.SetState(1214) + p.StringLiteral() } default: p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) goto errorExit } + { + p.SetState(1217) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } errorExit: if p.HasError() { @@ -5899,228 +25082,286 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// INewKeywordErrorContext is an interface to support dynamic dispatch. -type INewKeywordErrorContext interface { +// IInt32HelperContext is an interface to support dynamic dispatch. +type IInt32HelperContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - NEW() antlr.TerminalNode LPAREN() antlr.TerminalNode + NUMBER() antlr.TerminalNode RPAREN() antlr.TerminalNode - OBJECT_ID() antlr.TerminalNode - ISO_DATE() antlr.TerminalNode - DATE() antlr.TerminalNode - UUID() antlr.TerminalNode - LONG() antlr.TerminalNode - NUMBER_LONG() antlr.TerminalNode INT32() antlr.TerminalNode NUMBER_INT() antlr.TerminalNode - DOUBLE() antlr.TerminalNode - DECIMAL128() antlr.TerminalNode - NUMBER_DECIMAL() antlr.TerminalNode - TIMESTAMP() antlr.TerminalNode - REG_EXP() antlr.TerminalNode - Arguments() IArgumentsContext - // IsNewKeywordErrorContext differentiates from other interfaces. - IsNewKeywordErrorContext() + // IsInt32HelperContext differentiates from other interfaces. + IsInt32HelperContext() } -type NewKeywordErrorContext struct { +type Int32HelperContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyNewKeywordErrorContext() *NewKeywordErrorContext { - var p = new(NewKeywordErrorContext) +func NewEmptyInt32HelperContext() *Int32HelperContext { + var p = new(Int32HelperContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_newKeywordError + p.RuleIndex = MongoShellParserRULE_int32Helper return p } -func InitEmptyNewKeywordErrorContext(p *NewKeywordErrorContext) { +func InitEmptyInt32HelperContext(p *Int32HelperContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_newKeywordError + p.RuleIndex = MongoShellParserRULE_int32Helper } -func (*NewKeywordErrorContext) IsNewKeywordErrorContext() {} +func (*Int32HelperContext) IsInt32HelperContext() {} -func NewNewKeywordErrorContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *NewKeywordErrorContext { - var p = new(NewKeywordErrorContext) +func NewInt32HelperContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Int32HelperContext { + var p = new(Int32HelperContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = MongoShellParserRULE_newKeywordError + p.RuleIndex = MongoShellParserRULE_int32Helper return p } -func (s *NewKeywordErrorContext) GetParser() antlr.Parser { return s.parser } +func (s *Int32HelperContext) GetParser() antlr.Parser { return s.parser } -func (s *NewKeywordErrorContext) NEW() antlr.TerminalNode { - return s.GetToken(MongoShellParserNEW, 0) +func (s *Int32HelperContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) } -func (s *NewKeywordErrorContext) LPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserLPAREN, 0) +func (s *Int32HelperContext) NUMBER() antlr.TerminalNode { + return s.GetToken(MongoShellParserNUMBER, 0) } -func (s *NewKeywordErrorContext) RPAREN() antlr.TerminalNode { +func (s *Int32HelperContext) RPAREN() antlr.TerminalNode { return s.GetToken(MongoShellParserRPAREN, 0) } -func (s *NewKeywordErrorContext) OBJECT_ID() antlr.TerminalNode { - return s.GetToken(MongoShellParserOBJECT_ID, 0) +func (s *Int32HelperContext) INT32() antlr.TerminalNode { + return s.GetToken(MongoShellParserINT32, 0) +} + +func (s *Int32HelperContext) NUMBER_INT() antlr.TerminalNode { + return s.GetToken(MongoShellParserNUMBER_INT, 0) +} + +func (s *Int32HelperContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *Int32HelperContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *Int32HelperContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterInt32Helper(s) + } +} + +func (s *Int32HelperContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitInt32Helper(s) + } +} + +func (s *Int32HelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitInt32Helper(s) + + default: + return t.VisitChildren(s) + } +} + +func (p *MongoShellParser) Int32Helper() (localctx IInt32HelperContext) { + localctx = NewInt32HelperContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 204, MongoShellParserRULE_int32Helper) + var _la int + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1219) + _la = p.GetTokenStream().LA(1) + + if !(_la == MongoShellParserINT32 || _la == MongoShellParserNUMBER_INT) { + p.GetErrorHandler().RecoverInline(p) + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } + } + { + p.SetState(1220) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1221) + p.Match(MongoShellParserNUMBER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1222) + p.Match(MongoShellParserRPAREN) + 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 (s *NewKeywordErrorContext) ISO_DATE() antlr.TerminalNode { - return s.GetToken(MongoShellParserISO_DATE, 0) +// IDoubleHelperContext is an interface to support dynamic dispatch. +type IDoubleHelperContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + DOUBLE() antlr.TerminalNode + LPAREN() antlr.TerminalNode + NUMBER() antlr.TerminalNode + RPAREN() antlr.TerminalNode + + // IsDoubleHelperContext differentiates from other interfaces. + IsDoubleHelperContext() } -func (s *NewKeywordErrorContext) DATE() antlr.TerminalNode { - return s.GetToken(MongoShellParserDATE, 0) +type DoubleHelperContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser } -func (s *NewKeywordErrorContext) UUID() antlr.TerminalNode { - return s.GetToken(MongoShellParserUUID, 0) +func NewEmptyDoubleHelperContext() *DoubleHelperContext { + var p = new(DoubleHelperContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_doubleHelper + return p } -func (s *NewKeywordErrorContext) LONG() antlr.TerminalNode { - return s.GetToken(MongoShellParserLONG, 0) +func InitEmptyDoubleHelperContext(p *DoubleHelperContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_doubleHelper } -func (s *NewKeywordErrorContext) NUMBER_LONG() antlr.TerminalNode { - return s.GetToken(MongoShellParserNUMBER_LONG, 0) -} +func (*DoubleHelperContext) IsDoubleHelperContext() {} -func (s *NewKeywordErrorContext) INT32() antlr.TerminalNode { - return s.GetToken(MongoShellParserINT32, 0) -} +func NewDoubleHelperContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DoubleHelperContext { + var p = new(DoubleHelperContext) -func (s *NewKeywordErrorContext) NUMBER_INT() antlr.TerminalNode { - return s.GetToken(MongoShellParserNUMBER_INT, 0) -} + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) -func (s *NewKeywordErrorContext) DOUBLE() antlr.TerminalNode { - return s.GetToken(MongoShellParserDOUBLE, 0) -} + p.parser = parser + p.RuleIndex = MongoShellParserRULE_doubleHelper -func (s *NewKeywordErrorContext) DECIMAL128() antlr.TerminalNode { - return s.GetToken(MongoShellParserDECIMAL128, 0) + return p } -func (s *NewKeywordErrorContext) NUMBER_DECIMAL() antlr.TerminalNode { - return s.GetToken(MongoShellParserNUMBER_DECIMAL, 0) -} +func (s *DoubleHelperContext) GetParser() antlr.Parser { return s.parser } -func (s *NewKeywordErrorContext) TIMESTAMP() antlr.TerminalNode { - return s.GetToken(MongoShellParserTIMESTAMP, 0) +func (s *DoubleHelperContext) DOUBLE() antlr.TerminalNode { + return s.GetToken(MongoShellParserDOUBLE, 0) } -func (s *NewKeywordErrorContext) REG_EXP() antlr.TerminalNode { - return s.GetToken(MongoShellParserREG_EXP, 0) +func (s *DoubleHelperContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) } -func (s *NewKeywordErrorContext) Arguments() IArgumentsContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IArgumentsContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } +func (s *DoubleHelperContext) NUMBER() antlr.TerminalNode { + return s.GetToken(MongoShellParserNUMBER, 0) +} - return t.(IArgumentsContext) +func (s *DoubleHelperContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) } -func (s *NewKeywordErrorContext) GetRuleContext() antlr.RuleContext { +func (s *DoubleHelperContext) GetRuleContext() antlr.RuleContext { return s } -func (s *NewKeywordErrorContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *DoubleHelperContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *NewKeywordErrorContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *DoubleHelperContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterNewKeywordError(s) + listenerT.EnterDoubleHelper(s) } } -func (s *NewKeywordErrorContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *DoubleHelperContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitNewKeywordError(s) + listenerT.ExitDoubleHelper(s) } } -func (s *NewKeywordErrorContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *DoubleHelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitNewKeywordError(s) + return t.VisitDoubleHelper(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) NewKeywordError() (localctx INewKeywordErrorContext) { - localctx = NewNewKeywordErrorContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 52, MongoShellParserRULE_newKeywordError) - var _la int - +func (p *MongoShellParser) DoubleHelper() (localctx IDoubleHelperContext) { + localctx = NewDoubleHelperContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 206, MongoShellParserRULE_doubleHelper) p.EnterOuterAlt(localctx, 1) { - p.SetState(290) - p.Match(MongoShellParserNEW) + p.SetState(1224) + p.Match(MongoShellParserDOUBLE) if p.HasError() { // Recognition error - abort rule goto errorExit } } { - p.SetState(291) - _la = p.GetTokenStream().LA(1) - - if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&67100672) != 0) { - p.GetErrorHandler().RecoverInline(p) - } else { - p.GetErrorHandler().ReportMatch(p) - p.Consume() - } - } - p.NotifyErrorListeners("'new' keyword is not supported. Use ObjectId(), ISODate(), UUID(), etc. directly without 'new'", nil, nil) - { - p.SetState(293) + p.SetState(1225) p.Match(MongoShellParserLPAREN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(295) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) - - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&67564989593936832) != 0 { - { - p.SetState(294) - p.Arguments() + { + p.SetState(1226) + p.Match(MongoShellParserNUMBER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit } - } { - p.SetState(297) + p.SetState(1227) p.Match(MongoShellParserRPAREN) if p.HasError() { // Recognition error - abort rule @@ -6141,96 +25382,66 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IArrayContext is an interface to support dynamic dispatch. -type IArrayContext interface { +// IDecimal128HelperContext is an interface to support dynamic dispatch. +type IDecimal128HelperContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - LBRACKET() antlr.TerminalNode - RBRACKET() antlr.TerminalNode - AllValue() []IValueContext - Value(i int) IValueContext - AllCOMMA() []antlr.TerminalNode - COMMA(i int) antlr.TerminalNode + LPAREN() antlr.TerminalNode + StringLiteral() IStringLiteralContext + RPAREN() antlr.TerminalNode + DECIMAL128() antlr.TerminalNode + NUMBER_DECIMAL() antlr.TerminalNode - // IsArrayContext differentiates from other interfaces. - IsArrayContext() + // IsDecimal128HelperContext differentiates from other interfaces. + IsDecimal128HelperContext() } -type ArrayContext struct { +type Decimal128HelperContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyArrayContext() *ArrayContext { - var p = new(ArrayContext) +func NewEmptyDecimal128HelperContext() *Decimal128HelperContext { + var p = new(Decimal128HelperContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_array + p.RuleIndex = MongoShellParserRULE_decimal128Helper return p } -func InitEmptyArrayContext(p *ArrayContext) { +func InitEmptyDecimal128HelperContext(p *Decimal128HelperContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_array + p.RuleIndex = MongoShellParserRULE_decimal128Helper } -func (*ArrayContext) IsArrayContext() {} +func (*Decimal128HelperContext) IsDecimal128HelperContext() {} -func NewArrayContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ArrayContext { - var p = new(ArrayContext) +func NewDecimal128HelperContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Decimal128HelperContext { + var p = new(Decimal128HelperContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = MongoShellParserRULE_array + p.RuleIndex = MongoShellParserRULE_decimal128Helper return p } -func (s *ArrayContext) GetParser() antlr.Parser { return s.parser } - -func (s *ArrayContext) LBRACKET() antlr.TerminalNode { - return s.GetToken(MongoShellParserLBRACKET, 0) -} - -func (s *ArrayContext) RBRACKET() antlr.TerminalNode { - return s.GetToken(MongoShellParserRBRACKET, 0) -} - -func (s *ArrayContext) AllValue() []IValueContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IValueContext); ok { - len++ - } - } - - tst := make([]IValueContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IValueContext); ok { - tst[i] = t.(IValueContext) - i++ - } - } +func (s *Decimal128HelperContext) GetParser() antlr.Parser { return s.parser } - return tst +func (s *Decimal128HelperContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) } -func (s *ArrayContext) Value(i int) IValueContext { +func (s *Decimal128HelperContext) StringLiteral() IStringLiteralContext { var t antlr.RuleContext - j := 0 for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IValueContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ + if _, ok := ctx.(IStringLiteralContext); ok { + t = ctx.(antlr.RuleContext) + break } } @@ -6238,133 +25449,83 @@ func (s *ArrayContext) Value(i int) IValueContext { return nil } - return t.(IValueContext) + return t.(IStringLiteralContext) } -func (s *ArrayContext) AllCOMMA() []antlr.TerminalNode { - return s.GetTokens(MongoShellParserCOMMA) +func (s *Decimal128HelperContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) } -func (s *ArrayContext) COMMA(i int) antlr.TerminalNode { - return s.GetToken(MongoShellParserCOMMA, i) +func (s *Decimal128HelperContext) DECIMAL128() antlr.TerminalNode { + return s.GetToken(MongoShellParserDECIMAL128, 0) } -func (s *ArrayContext) GetRuleContext() antlr.RuleContext { +func (s *Decimal128HelperContext) NUMBER_DECIMAL() antlr.TerminalNode { + return s.GetToken(MongoShellParserNUMBER_DECIMAL, 0) +} + +func (s *Decimal128HelperContext) GetRuleContext() antlr.RuleContext { return s } -func (s *ArrayContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *Decimal128HelperContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *ArrayContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *Decimal128HelperContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterArray(s) + listenerT.EnterDecimal128Helper(s) } } -func (s *ArrayContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *Decimal128HelperContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitArray(s) + listenerT.ExitDecimal128Helper(s) } } -func (s *ArrayContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *Decimal128HelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitArray(s) + return t.VisitDecimal128Helper(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) Array() (localctx IArrayContext) { - localctx = NewArrayContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 54, MongoShellParserRULE_array) - var _la int - - var _alt int - - p.EnterOuterAlt(localctx, 1) - { - p.SetState(299) - p.Match(MongoShellParserLBRACKET) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.SetState(311) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) +func (p *MongoShellParser) Decimal128Helper() (localctx IDecimal128HelperContext) { + localctx = NewDecimal128HelperContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 208, MongoShellParserRULE_decimal128Helper) + var _la int - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&67564989593936832) != 0 { - { - p.SetState(300) - p.Value() - } - p.SetState(305) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 25, p.GetParserRuleContext()) - if p.HasError() { - goto errorExit - } - for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { - if _alt == 1 { - { - p.SetState(301) - p.Match(MongoShellParserCOMMA) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(302) - p.Value() - } + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1229) + _la = p.GetTokenStream().LA(1) - } - p.SetState(307) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 25, p.GetParserRuleContext()) - if p.HasError() { - goto errorExit - } + if !(_la == MongoShellParserDECIMAL128 || _la == MongoShellParserNUMBER_DECIMAL) { + p.GetErrorHandler().RecoverInline(p) + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() } - p.SetState(309) - p.GetErrorHandler().Sync(p) + } + { + p.SetState(1230) + p.Match(MongoShellParserLPAREN) if p.HasError() { + // Recognition error - abort rule goto errorExit } - _la = p.GetTokenStream().LA(1) - - if _la == MongoShellParserCOMMA { - { - p.SetState(308) - p.Match(MongoShellParserCOMMA) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - } - } { - p.SetState(313) - p.Match(MongoShellParserRBRACKET) + p.SetState(1231) + p.StringLiteral() + } + { + p.SetState(1232) + p.Match(MongoShellParserRPAREN) if p.HasError() { // Recognition error - abort rule goto errorExit @@ -6384,192 +25545,154 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IHelperFunctionContext is an interface to support dynamic dispatch. -type IHelperFunctionContext interface { +// ITimestampHelperContext is an interface to support dynamic dispatch. +type ITimestampHelperContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser - - // Getter signatures - ObjectIdHelper() IObjectIdHelperContext - IsoDateHelper() IIsoDateHelperContext - DateHelper() IDateHelperContext - UuidHelper() IUuidHelperContext - LongHelper() ILongHelperContext - Int32Helper() IInt32HelperContext - DoubleHelper() IDoubleHelperContext - Decimal128Helper() IDecimal128HelperContext - TimestampHelper() ITimestampHelperContext - - // IsHelperFunctionContext differentiates from other interfaces. - IsHelperFunctionContext() + // IsTimestampHelperContext differentiates from other interfaces. + IsTimestampHelperContext() } -type HelperFunctionContext struct { +type TimestampHelperContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyHelperFunctionContext() *HelperFunctionContext { - var p = new(HelperFunctionContext) +func NewEmptyTimestampHelperContext() *TimestampHelperContext { + var p = new(TimestampHelperContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_helperFunction + p.RuleIndex = MongoShellParserRULE_timestampHelper return p } -func InitEmptyHelperFunctionContext(p *HelperFunctionContext) { +func InitEmptyTimestampHelperContext(p *TimestampHelperContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_helperFunction + p.RuleIndex = MongoShellParserRULE_timestampHelper } -func (*HelperFunctionContext) IsHelperFunctionContext() {} +func (*TimestampHelperContext) IsTimestampHelperContext() {} -func NewHelperFunctionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *HelperFunctionContext { - var p = new(HelperFunctionContext) +func NewTimestampHelperContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TimestampHelperContext { + var p = new(TimestampHelperContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = MongoShellParserRULE_helperFunction + p.RuleIndex = MongoShellParserRULE_timestampHelper return p } -func (s *HelperFunctionContext) GetParser() antlr.Parser { return s.parser } +func (s *TimestampHelperContext) GetParser() antlr.Parser { return s.parser } -func (s *HelperFunctionContext) ObjectIdHelper() IObjectIdHelperContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IObjectIdHelperContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } +func (s *TimestampHelperContext) CopyAll(ctx *TimestampHelperContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) +} - if t == nil { - return nil - } +func (s *TimestampHelperContext) GetRuleContext() antlr.RuleContext { + return s +} - return t.(IObjectIdHelperContext) +func (s *TimestampHelperContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *HelperFunctionContext) IsoDateHelper() IIsoDateHelperContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IIsoDateHelperContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } +type TimestampArgsHelperContext struct { + TimestampHelperContext +} - if t == nil { - return nil - } +func NewTimestampArgsHelperContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TimestampArgsHelperContext { + var p = new(TimestampArgsHelperContext) - return t.(IIsoDateHelperContext) + InitEmptyTimestampHelperContext(&p.TimestampHelperContext) + p.parser = parser + p.CopyAll(ctx.(*TimestampHelperContext)) + + return p } -func (s *HelperFunctionContext) DateHelper() IDateHelperContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IDateHelperContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } +func (s *TimestampArgsHelperContext) GetRuleContext() antlr.RuleContext { + return s +} - if t == nil { - return nil - } +func (s *TimestampArgsHelperContext) TIMESTAMP() antlr.TerminalNode { + return s.GetToken(MongoShellParserTIMESTAMP, 0) +} - return t.(IDateHelperContext) +func (s *TimestampArgsHelperContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) } -func (s *HelperFunctionContext) UuidHelper() IUuidHelperContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IUuidHelperContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } +func (s *TimestampArgsHelperContext) AllNUMBER() []antlr.TerminalNode { + return s.GetTokens(MongoShellParserNUMBER) +} - if t == nil { - return nil - } +func (s *TimestampArgsHelperContext) NUMBER(i int) antlr.TerminalNode { + return s.GetToken(MongoShellParserNUMBER, i) +} - return t.(IUuidHelperContext) +func (s *TimestampArgsHelperContext) COMMA() antlr.TerminalNode { + return s.GetToken(MongoShellParserCOMMA, 0) } -func (s *HelperFunctionContext) LongHelper() ILongHelperContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ILongHelperContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } +func (s *TimestampArgsHelperContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} - if t == nil { - return nil +func (s *TimestampArgsHelperContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterTimestampArgsHelper(s) } - - return t.(ILongHelperContext) } -func (s *HelperFunctionContext) Int32Helper() IInt32HelperContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IInt32HelperContext); ok { - t = ctx.(antlr.RuleContext) - break - } +func (s *TimestampArgsHelperContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitTimestampArgsHelper(s) } +} - if t == nil { - return nil +func (s *TimestampArgsHelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitTimestampArgsHelper(s) + + default: + return t.VisitChildren(s) } +} - return t.(IInt32HelperContext) +type TimestampDocHelperContext struct { + TimestampHelperContext } -func (s *HelperFunctionContext) DoubleHelper() IDoubleHelperContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IDoubleHelperContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } +func NewTimestampDocHelperContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TimestampDocHelperContext { + var p = new(TimestampDocHelperContext) - if t == nil { - return nil - } + InitEmptyTimestampHelperContext(&p.TimestampHelperContext) + p.parser = parser + p.CopyAll(ctx.(*TimestampHelperContext)) - return t.(IDoubleHelperContext) + return p } -func (s *HelperFunctionContext) Decimal128Helper() IDecimal128HelperContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IDecimal128HelperContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } +func (s *TimestampDocHelperContext) GetRuleContext() antlr.RuleContext { + return s +} - if t == nil { - return nil - } +func (s *TimestampDocHelperContext) TIMESTAMP() antlr.TerminalNode { + return s.GetToken(MongoShellParserTIMESTAMP, 0) +} - return t.(IDecimal128HelperContext) +func (s *TimestampDocHelperContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) } -func (s *HelperFunctionContext) TimestampHelper() ITimestampHelperContext { +func (s *TimestampDocHelperContext) Document() IDocumentContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(ITimestampHelperContext); ok { + if _, ok := ctx.(IDocumentContext); ok { t = ctx.(antlr.RuleContext) break } @@ -6579,114 +25702,130 @@ func (s *HelperFunctionContext) TimestampHelper() ITimestampHelperContext { return nil } - return t.(ITimestampHelperContext) -} - -func (s *HelperFunctionContext) GetRuleContext() antlr.RuleContext { - return s + return t.(IDocumentContext) } -func (s *HelperFunctionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) +func (s *TimestampDocHelperContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) } -func (s *HelperFunctionContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *TimestampDocHelperContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterHelperFunction(s) + listenerT.EnterTimestampDocHelper(s) } } -func (s *HelperFunctionContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *TimestampDocHelperContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitHelperFunction(s) + listenerT.ExitTimestampDocHelper(s) } } -func (s *HelperFunctionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *TimestampDocHelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitHelperFunction(s) + return t.VisitTimestampDocHelper(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) HelperFunction() (localctx IHelperFunctionContext) { - localctx = NewHelperFunctionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 56, MongoShellParserRULE_helperFunction) - p.SetState(324) +func (p *MongoShellParser) TimestampHelper() (localctx ITimestampHelperContext) { + localctx = NewTimestampHelperContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 210, MongoShellParserRULE_timestampHelper) + p.SetState(1245) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetTokenStream().LA(1) { - case MongoShellParserOBJECT_ID: + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 81, p.GetParserRuleContext()) { + case 1: + localctx = NewTimestampDocHelperContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(315) - p.ObjectIdHelper() + p.SetState(1234) + p.Match(MongoShellParserTIMESTAMP) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - - case MongoShellParserISO_DATE: - p.EnterOuterAlt(localctx, 2) { - p.SetState(316) - p.IsoDateHelper() + p.SetState(1235) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - - case MongoShellParserDATE: - p.EnterOuterAlt(localctx, 3) { - p.SetState(317) - p.DateHelper() + p.SetState(1236) + p.Document() } - - case MongoShellParserUUID: - p.EnterOuterAlt(localctx, 4) { - p.SetState(318) - p.UuidHelper() + p.SetState(1237) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - case MongoShellParserLONG, MongoShellParserNUMBER_LONG: - p.EnterOuterAlt(localctx, 5) + case 2: + localctx = NewTimestampArgsHelperContext(p, localctx) + p.EnterOuterAlt(localctx, 2) { - p.SetState(319) - p.LongHelper() + p.SetState(1239) + p.Match(MongoShellParserTIMESTAMP) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - - case MongoShellParserINT32, MongoShellParserNUMBER_INT: - p.EnterOuterAlt(localctx, 6) { - p.SetState(320) - p.Int32Helper() + p.SetState(1240) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - - case MongoShellParserDOUBLE: - p.EnterOuterAlt(localctx, 7) { - p.SetState(321) - p.DoubleHelper() + p.SetState(1241) + p.Match(MongoShellParserNUMBER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - - case MongoShellParserDECIMAL128, MongoShellParserNUMBER_DECIMAL: - p.EnterOuterAlt(localctx, 8) { - p.SetState(322) - p.Decimal128Helper() + p.SetState(1242) + p.Match(MongoShellParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - - case MongoShellParserTIMESTAMP: - p.EnterOuterAlt(localctx, 9) { - p.SetState(323) - p.TimestampHelper() + p.SetState(1243) + p.Match(MongoShellParserNUMBER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1244) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - default: - p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + case antlr.ATNInvalidAltNumber: goto errorExit } @@ -6703,73 +25842,96 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IObjectIdHelperContext is an interface to support dynamic dispatch. -type IObjectIdHelperContext interface { +// IRegExpConstructorContext is an interface to support dynamic dispatch. +type IRegExpConstructorContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - OBJECT_ID() antlr.TerminalNode + REG_EXP() antlr.TerminalNode LPAREN() antlr.TerminalNode + AllStringLiteral() []IStringLiteralContext + StringLiteral(i int) IStringLiteralContext RPAREN() antlr.TerminalNode - StringLiteral() IStringLiteralContext + COMMA() antlr.TerminalNode - // IsObjectIdHelperContext differentiates from other interfaces. - IsObjectIdHelperContext() + // IsRegExpConstructorContext differentiates from other interfaces. + IsRegExpConstructorContext() } -type ObjectIdHelperContext struct { +type RegExpConstructorContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyObjectIdHelperContext() *ObjectIdHelperContext { - var p = new(ObjectIdHelperContext) +func NewEmptyRegExpConstructorContext() *RegExpConstructorContext { + var p = new(RegExpConstructorContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_objectIdHelper + p.RuleIndex = MongoShellParserRULE_regExpConstructor return p } -func InitEmptyObjectIdHelperContext(p *ObjectIdHelperContext) { +func InitEmptyRegExpConstructorContext(p *RegExpConstructorContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_objectIdHelper + p.RuleIndex = MongoShellParserRULE_regExpConstructor } -func (*ObjectIdHelperContext) IsObjectIdHelperContext() {} +func (*RegExpConstructorContext) IsRegExpConstructorContext() {} -func NewObjectIdHelperContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ObjectIdHelperContext { - var p = new(ObjectIdHelperContext) +func NewRegExpConstructorContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *RegExpConstructorContext { + var p = new(RegExpConstructorContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = MongoShellParserRULE_objectIdHelper + p.RuleIndex = MongoShellParserRULE_regExpConstructor return p } -func (s *ObjectIdHelperContext) GetParser() antlr.Parser { return s.parser } +func (s *RegExpConstructorContext) GetParser() antlr.Parser { return s.parser } -func (s *ObjectIdHelperContext) OBJECT_ID() antlr.TerminalNode { - return s.GetToken(MongoShellParserOBJECT_ID, 0) +func (s *RegExpConstructorContext) REG_EXP() antlr.TerminalNode { + return s.GetToken(MongoShellParserREG_EXP, 0) } -func (s *ObjectIdHelperContext) LPAREN() antlr.TerminalNode { +func (s *RegExpConstructorContext) LPAREN() antlr.TerminalNode { return s.GetToken(MongoShellParserLPAREN, 0) } -func (s *ObjectIdHelperContext) RPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserRPAREN, 0) +func (s *RegExpConstructorContext) AllStringLiteral() []IStringLiteralContext { + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IStringLiteralContext); ok { + len++ + } + } + + tst := make([]IStringLiteralContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IStringLiteralContext); ok { + tst[i] = t.(IStringLiteralContext) + i++ + } + } + + return tst } -func (s *ObjectIdHelperContext) StringLiteral() IStringLiteralContext { +func (s *RegExpConstructorContext) StringLiteral(i int) IStringLiteralContext { var t antlr.RuleContext + j := 0 for _, ctx := range s.GetChildren() { if _, ok := ctx.(IStringLiteralContext); ok { - t = ctx.(antlr.RuleContext) - break + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ } } @@ -6780,74 +25942,94 @@ func (s *ObjectIdHelperContext) StringLiteral() IStringLiteralContext { return t.(IStringLiteralContext) } -func (s *ObjectIdHelperContext) GetRuleContext() antlr.RuleContext { +func (s *RegExpConstructorContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *RegExpConstructorContext) COMMA() antlr.TerminalNode { + return s.GetToken(MongoShellParserCOMMA, 0) +} + +func (s *RegExpConstructorContext) GetRuleContext() antlr.RuleContext { return s } -func (s *ObjectIdHelperContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *RegExpConstructorContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *ObjectIdHelperContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *RegExpConstructorContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterObjectIdHelper(s) + listenerT.EnterRegExpConstructor(s) } } -func (s *ObjectIdHelperContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *RegExpConstructorContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitObjectIdHelper(s) + listenerT.ExitRegExpConstructor(s) } } -func (s *ObjectIdHelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *RegExpConstructorContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitObjectIdHelper(s) + return t.VisitRegExpConstructor(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) ObjectIdHelper() (localctx IObjectIdHelperContext) { - localctx = NewObjectIdHelperContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 58, MongoShellParserRULE_objectIdHelper) +func (p *MongoShellParser) RegExpConstructor() (localctx IRegExpConstructorContext) { + localctx = NewRegExpConstructorContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 212, MongoShellParserRULE_regExpConstructor) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(326) - p.Match(MongoShellParserOBJECT_ID) + p.SetState(1247) + p.Match(MongoShellParserREG_EXP) if p.HasError() { // Recognition error - abort rule goto errorExit } } { - p.SetState(327) + p.SetState(1248) p.Match(MongoShellParserLPAREN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(329) + { + p.SetState(1249) + p.StringLiteral() + } + p.SetState(1252) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - if _la == MongoShellParserDOUBLE_QUOTED_STRING || _la == MongoShellParserSINGLE_QUOTED_STRING { + if _la == MongoShellParserCOMMA { + { + p.SetState(1250) + p.Match(MongoShellParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } { - p.SetState(328) + p.SetState(1251) p.StringLiteral() } } { - p.SetState(331) + p.SetState(1254) p.Match(MongoShellParserRPAREN) if p.HasError() { // Recognition error - abort rule @@ -6868,68 +26050,74 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IIsoDateHelperContext is an interface to support dynamic dispatch. -type IIsoDateHelperContext interface { +// IBinDataHelperContext is an interface to support dynamic dispatch. +type IBinDataHelperContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - ISO_DATE() antlr.TerminalNode + BIN_DATA() antlr.TerminalNode LPAREN() antlr.TerminalNode - RPAREN() antlr.TerminalNode + NUMBER() antlr.TerminalNode + COMMA() antlr.TerminalNode StringLiteral() IStringLiteralContext + RPAREN() antlr.TerminalNode - // IsIsoDateHelperContext differentiates from other interfaces. - IsIsoDateHelperContext() + // IsBinDataHelperContext differentiates from other interfaces. + IsBinDataHelperContext() } -type IsoDateHelperContext struct { +type BinDataHelperContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyIsoDateHelperContext() *IsoDateHelperContext { - var p = new(IsoDateHelperContext) +func NewEmptyBinDataHelperContext() *BinDataHelperContext { + var p = new(BinDataHelperContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_isoDateHelper + p.RuleIndex = MongoShellParserRULE_binDataHelper return p } -func InitEmptyIsoDateHelperContext(p *IsoDateHelperContext) { +func InitEmptyBinDataHelperContext(p *BinDataHelperContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_isoDateHelper + p.RuleIndex = MongoShellParserRULE_binDataHelper } -func (*IsoDateHelperContext) IsIsoDateHelperContext() {} +func (*BinDataHelperContext) IsBinDataHelperContext() {} -func NewIsoDateHelperContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IsoDateHelperContext { - var p = new(IsoDateHelperContext) +func NewBinDataHelperContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BinDataHelperContext { + var p = new(BinDataHelperContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = MongoShellParserRULE_isoDateHelper + p.RuleIndex = MongoShellParserRULE_binDataHelper return p } -func (s *IsoDateHelperContext) GetParser() antlr.Parser { return s.parser } +func (s *BinDataHelperContext) GetParser() antlr.Parser { return s.parser } -func (s *IsoDateHelperContext) ISO_DATE() antlr.TerminalNode { - return s.GetToken(MongoShellParserISO_DATE, 0) +func (s *BinDataHelperContext) BIN_DATA() antlr.TerminalNode { + return s.GetToken(MongoShellParserBIN_DATA, 0) } -func (s *IsoDateHelperContext) LPAREN() antlr.TerminalNode { +func (s *BinDataHelperContext) LPAREN() antlr.TerminalNode { return s.GetToken(MongoShellParserLPAREN, 0) } -func (s *IsoDateHelperContext) RPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserRPAREN, 0) +func (s *BinDataHelperContext) NUMBER() antlr.TerminalNode { + return s.GetToken(MongoShellParserNUMBER, 0) } -func (s *IsoDateHelperContext) StringLiteral() IStringLiteralContext { +func (s *BinDataHelperContext) COMMA() antlr.TerminalNode { + return s.GetToken(MongoShellParserCOMMA, 0) +} + +func (s *BinDataHelperContext) StringLiteral() IStringLiteralContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { if _, ok := ctx.(IStringLiteralContext); ok { @@ -6945,74 +26133,82 @@ func (s *IsoDateHelperContext) StringLiteral() IStringLiteralContext { return t.(IStringLiteralContext) } -func (s *IsoDateHelperContext) GetRuleContext() antlr.RuleContext { +func (s *BinDataHelperContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *BinDataHelperContext) GetRuleContext() antlr.RuleContext { return s } -func (s *IsoDateHelperContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *BinDataHelperContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *IsoDateHelperContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *BinDataHelperContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterIsoDateHelper(s) + listenerT.EnterBinDataHelper(s) } } -func (s *IsoDateHelperContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *BinDataHelperContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitIsoDateHelper(s) + listenerT.ExitBinDataHelper(s) } } -func (s *IsoDateHelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *BinDataHelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitIsoDateHelper(s) + return t.VisitBinDataHelper(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) IsoDateHelper() (localctx IIsoDateHelperContext) { - localctx = NewIsoDateHelperContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 60, MongoShellParserRULE_isoDateHelper) - var _la int - +func (p *MongoShellParser) BinDataHelper() (localctx IBinDataHelperContext) { + localctx = NewBinDataHelperContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 214, MongoShellParserRULE_binDataHelper) p.EnterOuterAlt(localctx, 1) { - p.SetState(333) - p.Match(MongoShellParserISO_DATE) + p.SetState(1256) + p.Match(MongoShellParserBIN_DATA) if p.HasError() { // Recognition error - abort rule goto errorExit } } { - p.SetState(334) + p.SetState(1257) p.Match(MongoShellParserLPAREN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(336) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit + { + p.SetState(1258) + p.Match(MongoShellParserNUMBER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - _la = p.GetTokenStream().LA(1) - - if _la == MongoShellParserDOUBLE_QUOTED_STRING || _la == MongoShellParserSINGLE_QUOTED_STRING { - { - p.SetState(335) - p.StringLiteral() + { + p.SetState(1259) + p.Match(MongoShellParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit } - } { - p.SetState(338) + p.SetState(1260) + p.StringLiteral() + } + { + p.SetState(1261) p.Match(MongoShellParserRPAREN) if p.HasError() { // Recognition error - abort rule @@ -7033,72 +26229,93 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IDateHelperContext is an interface to support dynamic dispatch. -type IDateHelperContext interface { +// IBinaryHelperContext is an interface to support dynamic dispatch. +type IBinaryHelperContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - DATE() antlr.TerminalNode + BINARY() antlr.TerminalNode LPAREN() antlr.TerminalNode + Arguments() IArgumentsContext RPAREN() antlr.TerminalNode - StringLiteral() IStringLiteralContext - NUMBER() antlr.TerminalNode + DOT() antlr.TerminalNode + Identifier() IIdentifierContext - // IsDateHelperContext differentiates from other interfaces. - IsDateHelperContext() + // IsBinaryHelperContext differentiates from other interfaces. + IsBinaryHelperContext() } -type DateHelperContext struct { +type BinaryHelperContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyDateHelperContext() *DateHelperContext { - var p = new(DateHelperContext) +func NewEmptyBinaryHelperContext() *BinaryHelperContext { + var p = new(BinaryHelperContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_dateHelper + p.RuleIndex = MongoShellParserRULE_binaryHelper return p } -func InitEmptyDateHelperContext(p *DateHelperContext) { +func InitEmptyBinaryHelperContext(p *BinaryHelperContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_dateHelper + p.RuleIndex = MongoShellParserRULE_binaryHelper } -func (*DateHelperContext) IsDateHelperContext() {} +func (*BinaryHelperContext) IsBinaryHelperContext() {} -func NewDateHelperContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DateHelperContext { - var p = new(DateHelperContext) +func NewBinaryHelperContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BinaryHelperContext { + var p = new(BinaryHelperContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = MongoShellParserRULE_dateHelper + p.RuleIndex = MongoShellParserRULE_binaryHelper return p } -func (s *DateHelperContext) GetParser() antlr.Parser { return s.parser } +func (s *BinaryHelperContext) GetParser() antlr.Parser { return s.parser } -func (s *DateHelperContext) DATE() antlr.TerminalNode { - return s.GetToken(MongoShellParserDATE, 0) +func (s *BinaryHelperContext) BINARY() antlr.TerminalNode { + return s.GetToken(MongoShellParserBINARY, 0) } -func (s *DateHelperContext) LPAREN() antlr.TerminalNode { +func (s *BinaryHelperContext) LPAREN() antlr.TerminalNode { return s.GetToken(MongoShellParserLPAREN, 0) } -func (s *DateHelperContext) RPAREN() antlr.TerminalNode { +func (s *BinaryHelperContext) Arguments() IArgumentsContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IArgumentsContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IArgumentsContext) +} + +func (s *BinaryHelperContext) RPAREN() antlr.TerminalNode { return s.GetToken(MongoShellParserRPAREN, 0) } -func (s *DateHelperContext) StringLiteral() IStringLiteralContext { +func (s *BinaryHelperContext) DOT() antlr.TerminalNode { + return s.GetToken(MongoShellParserDOT, 0) +} + +func (s *BinaryHelperContext) Identifier() IIdentifierContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IStringLiteralContext); ok { + if _, ok := ctx.(IIdentifierContext); ok { t = ctx.(antlr.RuleContext) break } @@ -7108,96 +26325,125 @@ func (s *DateHelperContext) StringLiteral() IStringLiteralContext { return nil } - return t.(IStringLiteralContext) -} - -func (s *DateHelperContext) NUMBER() antlr.TerminalNode { - return s.GetToken(MongoShellParserNUMBER, 0) + return t.(IIdentifierContext) } -func (s *DateHelperContext) GetRuleContext() antlr.RuleContext { +func (s *BinaryHelperContext) GetRuleContext() antlr.RuleContext { return s } -func (s *DateHelperContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *BinaryHelperContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *DateHelperContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *BinaryHelperContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterDateHelper(s) + listenerT.EnterBinaryHelper(s) } } -func (s *DateHelperContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *BinaryHelperContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitDateHelper(s) + listenerT.ExitBinaryHelper(s) } } -func (s *DateHelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *BinaryHelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitDateHelper(s) + return t.VisitBinaryHelper(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) DateHelper() (localctx IDateHelperContext) { - localctx = NewDateHelperContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 62, MongoShellParserRULE_dateHelper) - p.EnterOuterAlt(localctx, 1) - { - p.SetState(340) - p.Match(MongoShellParserDATE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(341) - p.Match(MongoShellParserLPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.SetState(344) +func (p *MongoShellParser) BinaryHelper() (localctx IBinaryHelperContext) { + localctx = NewBinaryHelperContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 216, MongoShellParserRULE_binaryHelper) + p.SetState(1275) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetTokenStream().LA(1) { - case MongoShellParserDOUBLE_QUOTED_STRING, MongoShellParserSINGLE_QUOTED_STRING: + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 83, p.GetParserRuleContext()) { + case 1: + p.EnterOuterAlt(localctx, 1) { - p.SetState(342) - p.StringLiteral() + p.SetState(1263) + p.Match(MongoShellParserBINARY) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - - case MongoShellParserNUMBER: { - p.SetState(343) - p.Match(MongoShellParserNUMBER) + p.SetState(1264) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1265) + p.Arguments() + } + { + p.SetState(1266) + p.Match(MongoShellParserRPAREN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserRPAREN: - - default: - } - { - p.SetState(346) - p.Match(MongoShellParserRPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit + case 2: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(1268) + p.Match(MongoShellParserBINARY) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1269) + p.Match(MongoShellParserDOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1270) + p.Identifier() + } + { + p.SetState(1271) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1272) + p.Arguments() + } + { + p.SetState(1273) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } + + case antlr.ATNInvalidAltNumber: + goto errorExit } errorExit: @@ -7213,67 +26459,67 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IUuidHelperContext is an interface to support dynamic dispatch. -type IUuidHelperContext interface { +// IBsonRegExpHelperContext is an interface to support dynamic dispatch. +type IBsonRegExpHelperContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - UUID() antlr.TerminalNode + BSON_REG_EXP() antlr.TerminalNode LPAREN() antlr.TerminalNode - StringLiteral() IStringLiteralContext + Arguments() IArgumentsContext RPAREN() antlr.TerminalNode - // IsUuidHelperContext differentiates from other interfaces. - IsUuidHelperContext() + // IsBsonRegExpHelperContext differentiates from other interfaces. + IsBsonRegExpHelperContext() } -type UuidHelperContext struct { +type BsonRegExpHelperContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyUuidHelperContext() *UuidHelperContext { - var p = new(UuidHelperContext) +func NewEmptyBsonRegExpHelperContext() *BsonRegExpHelperContext { + var p = new(BsonRegExpHelperContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_uuidHelper + p.RuleIndex = MongoShellParserRULE_bsonRegExpHelper return p } -func InitEmptyUuidHelperContext(p *UuidHelperContext) { +func InitEmptyBsonRegExpHelperContext(p *BsonRegExpHelperContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_uuidHelper + p.RuleIndex = MongoShellParserRULE_bsonRegExpHelper } -func (*UuidHelperContext) IsUuidHelperContext() {} +func (*BsonRegExpHelperContext) IsBsonRegExpHelperContext() {} -func NewUuidHelperContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *UuidHelperContext { - var p = new(UuidHelperContext) +func NewBsonRegExpHelperContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BsonRegExpHelperContext { + var p = new(BsonRegExpHelperContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = MongoShellParserRULE_uuidHelper + p.RuleIndex = MongoShellParserRULE_bsonRegExpHelper return p } -func (s *UuidHelperContext) GetParser() antlr.Parser { return s.parser } +func (s *BsonRegExpHelperContext) GetParser() antlr.Parser { return s.parser } -func (s *UuidHelperContext) UUID() antlr.TerminalNode { - return s.GetToken(MongoShellParserUUID, 0) +func (s *BsonRegExpHelperContext) BSON_REG_EXP() antlr.TerminalNode { + return s.GetToken(MongoShellParserBSON_REG_EXP, 0) } -func (s *UuidHelperContext) LPAREN() antlr.TerminalNode { +func (s *BsonRegExpHelperContext) LPAREN() antlr.TerminalNode { return s.GetToken(MongoShellParserLPAREN, 0) } -func (s *UuidHelperContext) StringLiteral() IStringLiteralContext { +func (s *BsonRegExpHelperContext) Arguments() IArgumentsContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IStringLiteralContext); ok { + if _, ok := ctx.(IArgumentsContext); ok { t = ctx.(antlr.RuleContext) break } @@ -7283,57 +26529,57 @@ func (s *UuidHelperContext) StringLiteral() IStringLiteralContext { return nil } - return t.(IStringLiteralContext) + return t.(IArgumentsContext) } -func (s *UuidHelperContext) RPAREN() antlr.TerminalNode { +func (s *BsonRegExpHelperContext) RPAREN() antlr.TerminalNode { return s.GetToken(MongoShellParserRPAREN, 0) } -func (s *UuidHelperContext) GetRuleContext() antlr.RuleContext { +func (s *BsonRegExpHelperContext) GetRuleContext() antlr.RuleContext { return s } -func (s *UuidHelperContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *BsonRegExpHelperContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *UuidHelperContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *BsonRegExpHelperContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterUuidHelper(s) + listenerT.EnterBsonRegExpHelper(s) } } -func (s *UuidHelperContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *BsonRegExpHelperContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitUuidHelper(s) + listenerT.ExitBsonRegExpHelper(s) } } -func (s *UuidHelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *BsonRegExpHelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitUuidHelper(s) + return t.VisitBsonRegExpHelper(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) UuidHelper() (localctx IUuidHelperContext) { - localctx = NewUuidHelperContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 64, MongoShellParserRULE_uuidHelper) +func (p *MongoShellParser) BsonRegExpHelper() (localctx IBsonRegExpHelperContext) { + localctx = NewBsonRegExpHelperContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 218, MongoShellParserRULE_bsonRegExpHelper) p.EnterOuterAlt(localctx, 1) { - p.SetState(348) - p.Match(MongoShellParserUUID) + p.SetState(1277) + p.Match(MongoShellParserBSON_REG_EXP) if p.HasError() { // Recognition error - abort rule goto errorExit } } { - p.SetState(349) + p.SetState(1278) p.Match(MongoShellParserLPAREN) if p.HasError() { // Recognition error - abort rule @@ -7341,11 +26587,11 @@ func (p *MongoShellParser) UuidHelper() (localctx IUuidHelperContext) { } } { - p.SetState(350) - p.StringLiteral() + p.SetState(1279) + p.Arguments() } { - p.SetState(351) + p.SetState(1280) p.Match(MongoShellParserRPAREN) if p.HasError() { // Recognition error - abort rule @@ -7365,79 +26611,75 @@ errorExit: return localctx goto errorExit // Trick to prevent compiler error if the label is not used } - -// ILongHelperContext is an interface to support dynamic dispatch. -type ILongHelperContext interface { + +// IHexDataHelperContext is an interface to support dynamic dispatch. +type IHexDataHelperContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures + HEX_DATA() antlr.TerminalNode LPAREN() antlr.TerminalNode - RPAREN() antlr.TerminalNode - LONG() antlr.TerminalNode - NUMBER_LONG() antlr.TerminalNode NUMBER() antlr.TerminalNode + COMMA() antlr.TerminalNode StringLiteral() IStringLiteralContext + RPAREN() antlr.TerminalNode - // IsLongHelperContext differentiates from other interfaces. - IsLongHelperContext() + // IsHexDataHelperContext differentiates from other interfaces. + IsHexDataHelperContext() } -type LongHelperContext struct { +type HexDataHelperContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyLongHelperContext() *LongHelperContext { - var p = new(LongHelperContext) +func NewEmptyHexDataHelperContext() *HexDataHelperContext { + var p = new(HexDataHelperContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_longHelper + p.RuleIndex = MongoShellParserRULE_hexDataHelper return p } -func InitEmptyLongHelperContext(p *LongHelperContext) { +func InitEmptyHexDataHelperContext(p *HexDataHelperContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_longHelper + p.RuleIndex = MongoShellParserRULE_hexDataHelper } -func (*LongHelperContext) IsLongHelperContext() {} +func (*HexDataHelperContext) IsHexDataHelperContext() {} -func NewLongHelperContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LongHelperContext { - var p = new(LongHelperContext) +func NewHexDataHelperContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *HexDataHelperContext { + var p = new(HexDataHelperContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = MongoShellParserRULE_longHelper + p.RuleIndex = MongoShellParserRULE_hexDataHelper return p } -func (s *LongHelperContext) GetParser() antlr.Parser { return s.parser } - -func (s *LongHelperContext) LPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserLPAREN, 0) -} +func (s *HexDataHelperContext) GetParser() antlr.Parser { return s.parser } -func (s *LongHelperContext) RPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserRPAREN, 0) +func (s *HexDataHelperContext) HEX_DATA() antlr.TerminalNode { + return s.GetToken(MongoShellParserHEX_DATA, 0) } -func (s *LongHelperContext) LONG() antlr.TerminalNode { - return s.GetToken(MongoShellParserLONG, 0) +func (s *HexDataHelperContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) } -func (s *LongHelperContext) NUMBER_LONG() antlr.TerminalNode { - return s.GetToken(MongoShellParserNUMBER_LONG, 0) +func (s *HexDataHelperContext) NUMBER() antlr.TerminalNode { + return s.GetToken(MongoShellParserNUMBER, 0) } -func (s *LongHelperContext) NUMBER() antlr.TerminalNode { - return s.GetToken(MongoShellParserNUMBER, 0) +func (s *HexDataHelperContext) COMMA() antlr.TerminalNode { + return s.GetToken(MongoShellParserCOMMA, 0) } -func (s *LongHelperContext) StringLiteral() IStringLiteralContext { +func (s *HexDataHelperContext) StringLiteral() IStringLiteralContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { if _, ok := ctx.(IStringLiteralContext); ok { @@ -7453,90 +26695,82 @@ func (s *LongHelperContext) StringLiteral() IStringLiteralContext { return t.(IStringLiteralContext) } -func (s *LongHelperContext) GetRuleContext() antlr.RuleContext { +func (s *HexDataHelperContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +func (s *HexDataHelperContext) GetRuleContext() antlr.RuleContext { return s } -func (s *LongHelperContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *HexDataHelperContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *LongHelperContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *HexDataHelperContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterLongHelper(s) + listenerT.EnterHexDataHelper(s) } } -func (s *LongHelperContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *HexDataHelperContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitLongHelper(s) + listenerT.ExitHexDataHelper(s) } } -func (s *LongHelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *HexDataHelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitLongHelper(s) + return t.VisitHexDataHelper(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) LongHelper() (localctx ILongHelperContext) { - localctx = NewLongHelperContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 66, MongoShellParserRULE_longHelper) - var _la int - +func (p *MongoShellParser) HexDataHelper() (localctx IHexDataHelperContext) { + localctx = NewHexDataHelperContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 220, MongoShellParserRULE_hexDataHelper) p.EnterOuterAlt(localctx, 1) { - p.SetState(353) - _la = p.GetTokenStream().LA(1) - - if !(_la == MongoShellParserLONG || _la == MongoShellParserNUMBER_LONG) { - p.GetErrorHandler().RecoverInline(p) - } else { - p.GetErrorHandler().ReportMatch(p) - p.Consume() + p.SetState(1282) + p.Match(MongoShellParserHEX_DATA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit } } { - p.SetState(354) + p.SetState(1283) p.Match(MongoShellParserLPAREN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(357) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - - switch p.GetTokenStream().LA(1) { - case MongoShellParserNUMBER: - { - p.SetState(355) - p.Match(MongoShellParserNUMBER) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } + { + p.SetState(1284) + p.Match(MongoShellParserNUMBER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit } - - case MongoShellParserDOUBLE_QUOTED_STRING, MongoShellParserSINGLE_QUOTED_STRING: - { - p.SetState(356) - p.StringLiteral() + } + { + p.SetState(1285) + p.Match(MongoShellParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit } - - default: - p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) - goto errorExit } { - p.SetState(359) + p.SetState(1286) + p.StringLiteral() + } + { + p.SetState(1287) p.Match(MongoShellParserRPAREN) if p.HasError() { // Recognition error - abort rule @@ -7557,291 +26791,361 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// IInt32HelperContext is an interface to support dynamic dispatch. -type IInt32HelperContext interface { +// ILiteralContext is an interface to support dynamic dispatch. +type ILiteralContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser - - // Getter signatures - LPAREN() antlr.TerminalNode - NUMBER() antlr.TerminalNode - RPAREN() antlr.TerminalNode - INT32() antlr.TerminalNode - NUMBER_INT() antlr.TerminalNode - - // IsInt32HelperContext differentiates from other interfaces. - IsInt32HelperContext() + // IsLiteralContext differentiates from other interfaces. + IsLiteralContext() } -type Int32HelperContext struct { +type LiteralContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyInt32HelperContext() *Int32HelperContext { - var p = new(Int32HelperContext) +func NewEmptyLiteralContext() *LiteralContext { + var p = new(LiteralContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_int32Helper + p.RuleIndex = MongoShellParserRULE_literal return p } -func InitEmptyInt32HelperContext(p *Int32HelperContext) { +func InitEmptyLiteralContext(p *LiteralContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_int32Helper + p.RuleIndex = MongoShellParserRULE_literal } -func (*Int32HelperContext) IsInt32HelperContext() {} +func (*LiteralContext) IsLiteralContext() {} -func NewInt32HelperContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Int32HelperContext { - var p = new(Int32HelperContext) +func NewLiteralContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LiteralContext { + var p = new(LiteralContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = MongoShellParserRULE_int32Helper + p.RuleIndex = MongoShellParserRULE_literal return p } -func (s *Int32HelperContext) GetParser() antlr.Parser { return s.parser } +func (s *LiteralContext) GetParser() antlr.Parser { return s.parser } -func (s *Int32HelperContext) LPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserLPAREN, 0) +func (s *LiteralContext) CopyAll(ctx *LiteralContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) } -func (s *Int32HelperContext) NUMBER() antlr.TerminalNode { - return s.GetToken(MongoShellParserNUMBER, 0) +func (s *LiteralContext) GetRuleContext() antlr.RuleContext { + return s } -func (s *Int32HelperContext) RPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserRPAREN, 0) +func (s *LiteralContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *Int32HelperContext) INT32() antlr.TerminalNode { - return s.GetToken(MongoShellParserINT32, 0) +type StringLiteralValueContext struct { + LiteralContext +} + +func NewStringLiteralValueContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *StringLiteralValueContext { + var p = new(StringLiteralValueContext) + + InitEmptyLiteralContext(&p.LiteralContext) + p.parser = parser + p.CopyAll(ctx.(*LiteralContext)) + + return p +} + +func (s *StringLiteralValueContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *StringLiteralValueContext) StringLiteral() IStringLiteralContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IStringLiteralContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IStringLiteralContext) +} + +func (s *StringLiteralValueContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterStringLiteralValue(s) + } +} + +func (s *StringLiteralValueContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitStringLiteralValue(s) + } } -func (s *Int32HelperContext) NUMBER_INT() antlr.TerminalNode { - return s.GetToken(MongoShellParserNUMBER_INT, 0) +func (s *StringLiteralValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitStringLiteralValue(s) + + default: + return t.VisitChildren(s) + } +} + +type NullLiteralContext struct { + LiteralContext +} + +func NewNullLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NullLiteralContext { + var p = new(NullLiteralContext) + + InitEmptyLiteralContext(&p.LiteralContext) + p.parser = parser + p.CopyAll(ctx.(*LiteralContext)) + + return p +} + +func (s *NullLiteralContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *NullLiteralContext) NULL() antlr.TerminalNode { + return s.GetToken(MongoShellParserNULL, 0) +} + +func (s *NullLiteralContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterNullLiteral(s) + } +} + +func (s *NullLiteralContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitNullLiteral(s) + } +} + +func (s *NullLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitNullLiteral(s) + + default: + return t.VisitChildren(s) + } +} + +type FalseLiteralContext struct { + LiteralContext +} + +func NewFalseLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *FalseLiteralContext { + var p = new(FalseLiteralContext) + + InitEmptyLiteralContext(&p.LiteralContext) + p.parser = parser + p.CopyAll(ctx.(*LiteralContext)) + + return p } -func (s *Int32HelperContext) GetRuleContext() antlr.RuleContext { +func (s *FalseLiteralContext) GetRuleContext() antlr.RuleContext { return s } -func (s *Int32HelperContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) +func (s *FalseLiteralContext) FALSE() antlr.TerminalNode { + return s.GetToken(MongoShellParserFALSE, 0) } -func (s *Int32HelperContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *FalseLiteralContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterInt32Helper(s) + listenerT.EnterFalseLiteral(s) } } -func (s *Int32HelperContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *FalseLiteralContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitInt32Helper(s) + listenerT.ExitFalseLiteral(s) } } -func (s *Int32HelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *FalseLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitInt32Helper(s) + return t.VisitFalseLiteral(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) Int32Helper() (localctx IInt32HelperContext) { - localctx = NewInt32HelperContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 68, MongoShellParserRULE_int32Helper) - var _la int - - p.EnterOuterAlt(localctx, 1) - { - p.SetState(361) - _la = p.GetTokenStream().LA(1) - - if !(_la == MongoShellParserINT32 || _la == MongoShellParserNUMBER_INT) { - p.GetErrorHandler().RecoverInline(p) - } else { - p.GetErrorHandler().ReportMatch(p) - p.Consume() - } - } - { - p.SetState(362) - p.Match(MongoShellParserLPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(363) - p.Match(MongoShellParserNUMBER) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(364) - p.Match(MongoShellParserRPAREN) - 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 +type TrueLiteralContext struct { + LiteralContext } -// IDoubleHelperContext is an interface to support dynamic dispatch. -type IDoubleHelperContext interface { - antlr.ParserRuleContext - - // GetParser returns the parser. - GetParser() antlr.Parser +func NewTrueLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TrueLiteralContext { + var p = new(TrueLiteralContext) - // Getter signatures - DOUBLE() antlr.TerminalNode - LPAREN() antlr.TerminalNode - NUMBER() antlr.TerminalNode - RPAREN() antlr.TerminalNode + InitEmptyLiteralContext(&p.LiteralContext) + p.parser = parser + p.CopyAll(ctx.(*LiteralContext)) - // IsDoubleHelperContext differentiates from other interfaces. - IsDoubleHelperContext() + return p } -type DoubleHelperContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser +func (s *TrueLiteralContext) GetRuleContext() antlr.RuleContext { + return s } -func NewEmptyDoubleHelperContext() *DoubleHelperContext { - var p = new(DoubleHelperContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_doubleHelper - return p +func (s *TrueLiteralContext) TRUE() antlr.TerminalNode { + return s.GetToken(MongoShellParserTRUE, 0) } -func InitEmptyDoubleHelperContext(p *DoubleHelperContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_doubleHelper +func (s *TrueLiteralContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterTrueLiteral(s) + } } -func (*DoubleHelperContext) IsDoubleHelperContext() {} - -func NewDoubleHelperContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DoubleHelperContext { - var p = new(DoubleHelperContext) - - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) - - p.parser = parser - p.RuleIndex = MongoShellParserRULE_doubleHelper - - return p +func (s *TrueLiteralContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitTrueLiteral(s) + } } -func (s *DoubleHelperContext) GetParser() antlr.Parser { return s.parser } +func (s *TrueLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitTrueLiteral(s) -func (s *DoubleHelperContext) DOUBLE() antlr.TerminalNode { - return s.GetToken(MongoShellParserDOUBLE, 0) + default: + return t.VisitChildren(s) + } } -func (s *DoubleHelperContext) LPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserLPAREN, 0) +type NumberLiteralContext struct { + LiteralContext } -func (s *DoubleHelperContext) NUMBER() antlr.TerminalNode { - return s.GetToken(MongoShellParserNUMBER, 0) -} +func NewNumberLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NumberLiteralContext { + var p = new(NumberLiteralContext) -func (s *DoubleHelperContext) RPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserRPAREN, 0) + InitEmptyLiteralContext(&p.LiteralContext) + p.parser = parser + p.CopyAll(ctx.(*LiteralContext)) + + return p } -func (s *DoubleHelperContext) GetRuleContext() antlr.RuleContext { +func (s *NumberLiteralContext) GetRuleContext() antlr.RuleContext { return s } -func (s *DoubleHelperContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) +func (s *NumberLiteralContext) NUMBER() antlr.TerminalNode { + return s.GetToken(MongoShellParserNUMBER, 0) } -func (s *DoubleHelperContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *NumberLiteralContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterDoubleHelper(s) + listenerT.EnterNumberLiteral(s) } } -func (s *DoubleHelperContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *NumberLiteralContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitDoubleHelper(s) + listenerT.ExitNumberLiteral(s) } } -func (s *DoubleHelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *NumberLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitDoubleHelper(s) + return t.VisitNumberLiteral(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) DoubleHelper() (localctx IDoubleHelperContext) { - localctx = NewDoubleHelperContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 70, MongoShellParserRULE_doubleHelper) - p.EnterOuterAlt(localctx, 1) - { - p.SetState(366) - p.Match(MongoShellParserDOUBLE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } +func (p *MongoShellParser) Literal() (localctx ILiteralContext) { + localctx = NewLiteralContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 222, MongoShellParserRULE_literal) + p.SetState(1294) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit } - { - p.SetState(367) - p.Match(MongoShellParserLPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit + + switch p.GetTokenStream().LA(1) { + case MongoShellParserDOUBLE_QUOTED_STRING, MongoShellParserSINGLE_QUOTED_STRING: + localctx = NewStringLiteralValueContext(p, localctx) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(1289) + p.StringLiteral() } - } - { - p.SetState(368) - p.Match(MongoShellParserNUMBER) - if p.HasError() { - // Recognition error - abort rule - goto errorExit + + case MongoShellParserNUMBER: + localctx = NewNumberLiteralContext(p, localctx) + p.EnterOuterAlt(localctx, 2) + { + p.SetState(1290) + p.Match(MongoShellParserNUMBER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - } - { - p.SetState(369) - p.Match(MongoShellParserRPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit + + case MongoShellParserTRUE: + localctx = NewTrueLiteralContext(p, localctx) + p.EnterOuterAlt(localctx, 3) + { + p.SetState(1291) + p.Match(MongoShellParserTRUE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case MongoShellParserFALSE: + localctx = NewFalseLiteralContext(p, localctx) + p.EnterOuterAlt(localctx, 4) + { + p.SetState(1292) + p.Match(MongoShellParserFALSE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case MongoShellParserNULL: + localctx = NewNullLiteralContext(p, localctx) + p.EnterOuterAlt(localctx, 5) + { + p.SetState(1293) + p.Match(MongoShellParserNULL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } + + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit } errorExit: @@ -7856,156 +27160,109 @@ errorExit: return localctx goto errorExit // Trick to prevent compiler error if the label is not used } - -// IDecimal128HelperContext is an interface to support dynamic dispatch. -type IDecimal128HelperContext interface { + +// IStringLiteralContext is an interface to support dynamic dispatch. +type IStringLiteralContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - LPAREN() antlr.TerminalNode - StringLiteral() IStringLiteralContext - RPAREN() antlr.TerminalNode - DECIMAL128() antlr.TerminalNode - NUMBER_DECIMAL() antlr.TerminalNode + DOUBLE_QUOTED_STRING() antlr.TerminalNode + SINGLE_QUOTED_STRING() antlr.TerminalNode - // IsDecimal128HelperContext differentiates from other interfaces. - IsDecimal128HelperContext() + // IsStringLiteralContext differentiates from other interfaces. + IsStringLiteralContext() } -type Decimal128HelperContext struct { +type StringLiteralContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyDecimal128HelperContext() *Decimal128HelperContext { - var p = new(Decimal128HelperContext) +func NewEmptyStringLiteralContext() *StringLiteralContext { + var p = new(StringLiteralContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_decimal128Helper + p.RuleIndex = MongoShellParserRULE_stringLiteral return p } -func InitEmptyDecimal128HelperContext(p *Decimal128HelperContext) { +func InitEmptyStringLiteralContext(p *StringLiteralContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_decimal128Helper + p.RuleIndex = MongoShellParserRULE_stringLiteral } -func (*Decimal128HelperContext) IsDecimal128HelperContext() {} +func (*StringLiteralContext) IsStringLiteralContext() {} -func NewDecimal128HelperContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Decimal128HelperContext { - var p = new(Decimal128HelperContext) +func NewStringLiteralContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StringLiteralContext { + var p = new(StringLiteralContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = MongoShellParserRULE_decimal128Helper + p.RuleIndex = MongoShellParserRULE_stringLiteral return p } -func (s *Decimal128HelperContext) GetParser() antlr.Parser { return s.parser } - -func (s *Decimal128HelperContext) LPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserLPAREN, 0) -} - -func (s *Decimal128HelperContext) StringLiteral() IStringLiteralContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IStringLiteralContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } - - if t == nil { - return nil - } - - return t.(IStringLiteralContext) -} - -func (s *Decimal128HelperContext) RPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserRPAREN, 0) -} +func (s *StringLiteralContext) GetParser() antlr.Parser { return s.parser } -func (s *Decimal128HelperContext) DECIMAL128() antlr.TerminalNode { - return s.GetToken(MongoShellParserDECIMAL128, 0) +func (s *StringLiteralContext) DOUBLE_QUOTED_STRING() antlr.TerminalNode { + return s.GetToken(MongoShellParserDOUBLE_QUOTED_STRING, 0) } -func (s *Decimal128HelperContext) NUMBER_DECIMAL() antlr.TerminalNode { - return s.GetToken(MongoShellParserNUMBER_DECIMAL, 0) +func (s *StringLiteralContext) SINGLE_QUOTED_STRING() antlr.TerminalNode { + return s.GetToken(MongoShellParserSINGLE_QUOTED_STRING, 0) } -func (s *Decimal128HelperContext) GetRuleContext() antlr.RuleContext { +func (s *StringLiteralContext) GetRuleContext() antlr.RuleContext { return s } -func (s *Decimal128HelperContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *StringLiteralContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *Decimal128HelperContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *StringLiteralContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterDecimal128Helper(s) + listenerT.EnterStringLiteral(s) } } -func (s *Decimal128HelperContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *StringLiteralContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitDecimal128Helper(s) + listenerT.ExitStringLiteral(s) } } -func (s *Decimal128HelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *StringLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitDecimal128Helper(s) + return t.VisitStringLiteral(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) Decimal128Helper() (localctx IDecimal128HelperContext) { - localctx = NewDecimal128HelperContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 72, MongoShellParserRULE_decimal128Helper) +func (p *MongoShellParser) StringLiteral() (localctx IStringLiteralContext) { + localctx = NewStringLiteralContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 224, MongoShellParserRULE_stringLiteral) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(371) + p.SetState(1296) _la = p.GetTokenStream().LA(1) - if !(_la == MongoShellParserDECIMAL128 || _la == MongoShellParserNUMBER_DECIMAL) { + if !(_la == MongoShellParserDOUBLE_QUOTED_STRING || _la == MongoShellParserSINGLE_QUOTED_STRING) { p.GetErrorHandler().RecoverInline(p) } else { p.GetErrorHandler().ReportMatch(p) p.Consume() } } - { - p.SetState(372) - p.Match(MongoShellParserLPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(373) - p.StringLiteral() - } - { - p.SetState(374) - p.Match(MongoShellParserRPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } errorExit: if p.HasError() { @@ -8020,1724 +27277,2285 @@ errorExit: goto errorExit // Trick to prevent compiler error if the label is not used } -// ITimestampHelperContext is an interface to support dynamic dispatch. -type ITimestampHelperContext interface { +// IIdentifierContext is an interface to support dynamic dispatch. +type IIdentifierContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser - // IsTimestampHelperContext differentiates from other interfaces. - IsTimestampHelperContext() + + // Getter signatures + IDENTIFIER() antlr.TerminalNode + DOLLAR() antlr.TerminalNode + SHOW() antlr.TerminalNode + DBS() antlr.TerminalNode + DATABASES() antlr.TerminalNode + COLLECTIONS() antlr.TerminalNode + DB() antlr.TerminalNode + NEW() antlr.TerminalNode + TRUE() antlr.TerminalNode + FALSE() antlr.TerminalNode + NULL() antlr.TerminalNode + FIND() antlr.TerminalNode + FIND_ONE() antlr.TerminalNode + COUNT_DOCUMENTS() antlr.TerminalNode + ESTIMATED_DOCUMENT_COUNT() antlr.TerminalNode + DISTINCT() antlr.TerminalNode + AGGREGATE() antlr.TerminalNode + GET_INDEXES() antlr.TerminalNode + INSERT_ONE() antlr.TerminalNode + INSERT_MANY() antlr.TerminalNode + UPDATE_ONE() antlr.TerminalNode + UPDATE_MANY() antlr.TerminalNode + DELETE_ONE() antlr.TerminalNode + DELETE_MANY() antlr.TerminalNode + REPLACE_ONE() antlr.TerminalNode + FIND_ONE_AND_UPDATE() antlr.TerminalNode + FIND_ONE_AND_REPLACE() antlr.TerminalNode + FIND_ONE_AND_DELETE() antlr.TerminalNode + CREATE_INDEX() antlr.TerminalNode + CREATE_INDEXES() antlr.TerminalNode + DROP_INDEX() antlr.TerminalNode + DROP_INDEXES() antlr.TerminalNode + DROP() antlr.TerminalNode + RENAME_COLLECTION() antlr.TerminalNode + STATS() antlr.TerminalNode + STORAGE_SIZE() antlr.TerminalNode + TOTAL_INDEX_SIZE() antlr.TerminalNode + TOTAL_SIZE() antlr.TerminalNode + DATA_SIZE() antlr.TerminalNode + IS_CAPPED() antlr.TerminalNode + VALIDATE() antlr.TerminalNode + LATENCY_STATS() antlr.TerminalNode + SORT() antlr.TerminalNode + LIMIT() antlr.TerminalNode + SKIP_() antlr.TerminalNode + COUNT() antlr.TerminalNode + PROJECTION() antlr.TerminalNode + PROJECT() antlr.TerminalNode + GET_COLLECTION() antlr.TerminalNode + GET_COLLECTION_NAMES() antlr.TerminalNode + GET_COLLECTION_INFOS() antlr.TerminalNode + CREATE_COLLECTION() antlr.TerminalNode + DROP_DATABASE() antlr.TerminalNode + HOST_INFO() antlr.TerminalNode + LIST_COMMANDS() antlr.TerminalNode + SERVER_BUILD_INFO() antlr.TerminalNode + SERVER_STATUS() antlr.TerminalNode + VERSION() antlr.TerminalNode + RUN_COMMAND() antlr.TerminalNode + ADMIN_COMMAND() antlr.TerminalNode + GET_NAME() antlr.TerminalNode + GET_MONGO() antlr.TerminalNode + GET_SIBLING_DB() antlr.TerminalNode + OBJECT_ID() antlr.TerminalNode + ISO_DATE() antlr.TerminalNode + DATE() antlr.TerminalNode + UUID() antlr.TerminalNode + LONG() antlr.TerminalNode + NUMBER_LONG() antlr.TerminalNode + INT32() antlr.TerminalNode + NUMBER_INT() antlr.TerminalNode + DOUBLE() antlr.TerminalNode + DECIMAL128() antlr.TerminalNode + NUMBER_DECIMAL() antlr.TerminalNode + TIMESTAMP() antlr.TerminalNode + REG_EXP() antlr.TerminalNode + BIN_DATA() antlr.TerminalNode + BINARY() antlr.TerminalNode + BSON_REG_EXP() antlr.TerminalNode + HEX_DATA() antlr.TerminalNode + BATCH_SIZE() antlr.TerminalNode + CLOSE() antlr.TerminalNode + COLLATION() antlr.TerminalNode + COMMENT() antlr.TerminalNode + EXPLAIN() antlr.TerminalNode + FOR_EACH() antlr.TerminalNode + HAS_NEXT() antlr.TerminalNode + HINT() antlr.TerminalNode + IS_CLOSED() antlr.TerminalNode + IS_EXHAUSTED() antlr.TerminalNode + IT_COUNT() antlr.TerminalNode + MAP() antlr.TerminalNode + MAX() antlr.TerminalNode + MAX_AWAIT_TIME_MS() antlr.TerminalNode + MAX_TIME_MS() antlr.TerminalNode + MIN() antlr.TerminalNode + NEXT() antlr.TerminalNode + NO_CURSOR_TIMEOUT() antlr.TerminalNode + OBJS_LEFT_IN_BATCH() antlr.TerminalNode + PRETTY() antlr.TerminalNode + READ_CONCERN() antlr.TerminalNode + READ_PREF() antlr.TerminalNode + RETURN_KEY() antlr.TerminalNode + SHOW_RECORD_ID() antlr.TerminalNode + SIZE() antlr.TerminalNode + TAILABLE() antlr.TerminalNode + TO_ARRAY() antlr.TerminalNode + TRY_NEXT() antlr.TerminalNode + ALLOW_DISK_USE() antlr.TerminalNode + ADD_OPTION() antlr.TerminalNode + INITIALIZE_ORDERED_BULK_OP() antlr.TerminalNode + INITIALIZE_UNORDERED_BULK_OP() antlr.TerminalNode + EXECUTE() antlr.TerminalNode + GET_OPERATIONS() antlr.TerminalNode + TO_STRING() antlr.TerminalNode + INSERT() antlr.TerminalNode + REMOVE() antlr.TerminalNode + MONGO() antlr.TerminalNode + CONNECT() antlr.TerminalNode + GET_DB() antlr.TerminalNode + GET_READ_CONCERN() antlr.TerminalNode + GET_READ_PREF() antlr.TerminalNode + GET_READ_PREF_MODE() antlr.TerminalNode + GET_READ_PREF_TAG_SET() antlr.TerminalNode + GET_WRITE_CONCERN() antlr.TerminalNode + SET_READ_PREF() antlr.TerminalNode + SET_READ_CONCERN() antlr.TerminalNode + SET_WRITE_CONCERN() antlr.TerminalNode + START_SESSION() antlr.TerminalNode + WATCH() antlr.TerminalNode + GET_DB_NAMES() antlr.TerminalNode + RS() antlr.TerminalNode + SH() antlr.TerminalNode + SP() antlr.TerminalNode + GET_KEY_VAULT() antlr.TerminalNode + GET_CLIENT_ENCRYPTION() antlr.TerminalNode + GET_PLAN_CACHE() antlr.TerminalNode + + // IsIdentifierContext differentiates from other interfaces. + IsIdentifierContext() } -type TimestampHelperContext struct { +type IdentifierContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyTimestampHelperContext() *TimestampHelperContext { - var p = new(TimestampHelperContext) +func NewEmptyIdentifierContext() *IdentifierContext { + var p = new(IdentifierContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_timestampHelper + p.RuleIndex = MongoShellParserRULE_identifier return p } -func InitEmptyTimestampHelperContext(p *TimestampHelperContext) { +func InitEmptyIdentifierContext(p *IdentifierContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_timestampHelper + p.RuleIndex = MongoShellParserRULE_identifier } -func (*TimestampHelperContext) IsTimestampHelperContext() {} +func (*IdentifierContext) IsIdentifierContext() {} -func NewTimestampHelperContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TimestampHelperContext { - var p = new(TimestampHelperContext) +func NewIdentifierContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IdentifierContext { + var p = new(IdentifierContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser - p.RuleIndex = MongoShellParserRULE_timestampHelper + p.RuleIndex = MongoShellParserRULE_identifier return p } -func (s *TimestampHelperContext) GetParser() antlr.Parser { return s.parser } +func (s *IdentifierContext) GetParser() antlr.Parser { return s.parser } -func (s *TimestampHelperContext) CopyAll(ctx *TimestampHelperContext) { - s.CopyFrom(&ctx.BaseParserRuleContext) +func (s *IdentifierContext) IDENTIFIER() antlr.TerminalNode { + return s.GetToken(MongoShellParserIDENTIFIER, 0) } -func (s *TimestampHelperContext) GetRuleContext() antlr.RuleContext { - return s +func (s *IdentifierContext) DOLLAR() antlr.TerminalNode { + return s.GetToken(MongoShellParserDOLLAR, 0) } -func (s *TimestampHelperContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) +func (s *IdentifierContext) SHOW() antlr.TerminalNode { + return s.GetToken(MongoShellParserSHOW, 0) } -type TimestampArgsHelperContext struct { - TimestampHelperContext +func (s *IdentifierContext) DBS() antlr.TerminalNode { + return s.GetToken(MongoShellParserDBS, 0) } -func NewTimestampArgsHelperContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TimestampArgsHelperContext { - var p = new(TimestampArgsHelperContext) - - InitEmptyTimestampHelperContext(&p.TimestampHelperContext) - p.parser = parser - p.CopyAll(ctx.(*TimestampHelperContext)) - - return p +func (s *IdentifierContext) DATABASES() antlr.TerminalNode { + return s.GetToken(MongoShellParserDATABASES, 0) } -func (s *TimestampArgsHelperContext) GetRuleContext() antlr.RuleContext { - return s +func (s *IdentifierContext) COLLECTIONS() antlr.TerminalNode { + return s.GetToken(MongoShellParserCOLLECTIONS, 0) } -func (s *TimestampArgsHelperContext) TIMESTAMP() antlr.TerminalNode { - return s.GetToken(MongoShellParserTIMESTAMP, 0) +func (s *IdentifierContext) DB() antlr.TerminalNode { + return s.GetToken(MongoShellParserDB, 0) } -func (s *TimestampArgsHelperContext) LPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserLPAREN, 0) +func (s *IdentifierContext) NEW() antlr.TerminalNode { + return s.GetToken(MongoShellParserNEW, 0) } -func (s *TimestampArgsHelperContext) AllNUMBER() []antlr.TerminalNode { - return s.GetTokens(MongoShellParserNUMBER) +func (s *IdentifierContext) TRUE() antlr.TerminalNode { + return s.GetToken(MongoShellParserTRUE, 0) } -func (s *TimestampArgsHelperContext) NUMBER(i int) antlr.TerminalNode { - return s.GetToken(MongoShellParserNUMBER, i) +func (s *IdentifierContext) FALSE() antlr.TerminalNode { + return s.GetToken(MongoShellParserFALSE, 0) } -func (s *TimestampArgsHelperContext) COMMA() antlr.TerminalNode { - return s.GetToken(MongoShellParserCOMMA, 0) +func (s *IdentifierContext) NULL() antlr.TerminalNode { + return s.GetToken(MongoShellParserNULL, 0) } -func (s *TimestampArgsHelperContext) RPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserRPAREN, 0) +func (s *IdentifierContext) FIND() antlr.TerminalNode { + return s.GetToken(MongoShellParserFIND, 0) } -func (s *TimestampArgsHelperContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterTimestampArgsHelper(s) - } +func (s *IdentifierContext) FIND_ONE() antlr.TerminalNode { + return s.GetToken(MongoShellParserFIND_ONE, 0) } -func (s *TimestampArgsHelperContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitTimestampArgsHelper(s) - } +func (s *IdentifierContext) COUNT_DOCUMENTS() antlr.TerminalNode { + return s.GetToken(MongoShellParserCOUNT_DOCUMENTS, 0) } -func (s *TimestampArgsHelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case MongoShellParserVisitor: - return t.VisitTimestampArgsHelper(s) - - default: - return t.VisitChildren(s) - } +func (s *IdentifierContext) ESTIMATED_DOCUMENT_COUNT() antlr.TerminalNode { + return s.GetToken(MongoShellParserESTIMATED_DOCUMENT_COUNT, 0) } -type TimestampDocHelperContext struct { - TimestampHelperContext +func (s *IdentifierContext) DISTINCT() antlr.TerminalNode { + return s.GetToken(MongoShellParserDISTINCT, 0) } -func NewTimestampDocHelperContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TimestampDocHelperContext { - var p = new(TimestampDocHelperContext) +func (s *IdentifierContext) AGGREGATE() antlr.TerminalNode { + return s.GetToken(MongoShellParserAGGREGATE, 0) +} - InitEmptyTimestampHelperContext(&p.TimestampHelperContext) - p.parser = parser - p.CopyAll(ctx.(*TimestampHelperContext)) +func (s *IdentifierContext) GET_INDEXES() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_INDEXES, 0) +} - return p +func (s *IdentifierContext) INSERT_ONE() antlr.TerminalNode { + return s.GetToken(MongoShellParserINSERT_ONE, 0) } -func (s *TimestampDocHelperContext) GetRuleContext() antlr.RuleContext { - return s +func (s *IdentifierContext) INSERT_MANY() antlr.TerminalNode { + return s.GetToken(MongoShellParserINSERT_MANY, 0) } -func (s *TimestampDocHelperContext) TIMESTAMP() antlr.TerminalNode { - return s.GetToken(MongoShellParserTIMESTAMP, 0) +func (s *IdentifierContext) UPDATE_ONE() antlr.TerminalNode { + return s.GetToken(MongoShellParserUPDATE_ONE, 0) } -func (s *TimestampDocHelperContext) LPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserLPAREN, 0) +func (s *IdentifierContext) UPDATE_MANY() antlr.TerminalNode { + return s.GetToken(MongoShellParserUPDATE_MANY, 0) } -func (s *TimestampDocHelperContext) Document() IDocumentContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IDocumentContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } +func (s *IdentifierContext) DELETE_ONE() antlr.TerminalNode { + return s.GetToken(MongoShellParserDELETE_ONE, 0) +} - if t == nil { - return nil - } +func (s *IdentifierContext) DELETE_MANY() antlr.TerminalNode { + return s.GetToken(MongoShellParserDELETE_MANY, 0) +} - return t.(IDocumentContext) +func (s *IdentifierContext) REPLACE_ONE() antlr.TerminalNode { + return s.GetToken(MongoShellParserREPLACE_ONE, 0) } -func (s *TimestampDocHelperContext) RPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserRPAREN, 0) +func (s *IdentifierContext) FIND_ONE_AND_UPDATE() antlr.TerminalNode { + return s.GetToken(MongoShellParserFIND_ONE_AND_UPDATE, 0) } -func (s *TimestampDocHelperContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterTimestampDocHelper(s) - } +func (s *IdentifierContext) FIND_ONE_AND_REPLACE() antlr.TerminalNode { + return s.GetToken(MongoShellParserFIND_ONE_AND_REPLACE, 0) } -func (s *TimestampDocHelperContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitTimestampDocHelper(s) - } +func (s *IdentifierContext) FIND_ONE_AND_DELETE() antlr.TerminalNode { + return s.GetToken(MongoShellParserFIND_ONE_AND_DELETE, 0) } -func (s *TimestampDocHelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case MongoShellParserVisitor: - return t.VisitTimestampDocHelper(s) +func (s *IdentifierContext) CREATE_INDEX() antlr.TerminalNode { + return s.GetToken(MongoShellParserCREATE_INDEX, 0) +} - default: - return t.VisitChildren(s) - } +func (s *IdentifierContext) CREATE_INDEXES() antlr.TerminalNode { + return s.GetToken(MongoShellParserCREATE_INDEXES, 0) } -func (p *MongoShellParser) TimestampHelper() (localctx ITimestampHelperContext) { - localctx = NewTimestampHelperContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 74, MongoShellParserRULE_timestampHelper) - p.SetState(387) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } +func (s *IdentifierContext) DROP_INDEX() antlr.TerminalNode { + return s.GetToken(MongoShellParserDROP_INDEX, 0) +} - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 33, p.GetParserRuleContext()) { - case 1: - localctx = NewTimestampDocHelperContext(p, localctx) - p.EnterOuterAlt(localctx, 1) - { - p.SetState(376) - p.Match(MongoShellParserTIMESTAMP) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(377) - p.Match(MongoShellParserLPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(378) - p.Document() - } - { - p.SetState(379) - p.Match(MongoShellParserRPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } +func (s *IdentifierContext) DROP_INDEXES() antlr.TerminalNode { + return s.GetToken(MongoShellParserDROP_INDEXES, 0) +} - case 2: - localctx = NewTimestampArgsHelperContext(p, localctx) - p.EnterOuterAlt(localctx, 2) - { - p.SetState(381) - p.Match(MongoShellParserTIMESTAMP) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(382) - p.Match(MongoShellParserLPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(383) - p.Match(MongoShellParserNUMBER) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(384) - p.Match(MongoShellParserCOMMA) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(385) - p.Match(MongoShellParserNUMBER) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(386) - p.Match(MongoShellParserRPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } +func (s *IdentifierContext) DROP() antlr.TerminalNode { + return s.GetToken(MongoShellParserDROP, 0) +} - case antlr.ATNInvalidAltNumber: - goto errorExit - } +func (s *IdentifierContext) RENAME_COLLECTION() antlr.TerminalNode { + return s.GetToken(MongoShellParserRENAME_COLLECTION, 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 +func (s *IdentifierContext) STATS() antlr.TerminalNode { + return s.GetToken(MongoShellParserSTATS, 0) } -// IRegExpConstructorContext is an interface to support dynamic dispatch. -type IRegExpConstructorContext interface { - antlr.ParserRuleContext +func (s *IdentifierContext) STORAGE_SIZE() antlr.TerminalNode { + return s.GetToken(MongoShellParserSTORAGE_SIZE, 0) +} - // GetParser returns the parser. - GetParser() antlr.Parser +func (s *IdentifierContext) TOTAL_INDEX_SIZE() antlr.TerminalNode { + return s.GetToken(MongoShellParserTOTAL_INDEX_SIZE, 0) +} - // Getter signatures - REG_EXP() antlr.TerminalNode - LPAREN() antlr.TerminalNode - AllStringLiteral() []IStringLiteralContext - StringLiteral(i int) IStringLiteralContext - RPAREN() antlr.TerminalNode - COMMA() antlr.TerminalNode +func (s *IdentifierContext) TOTAL_SIZE() antlr.TerminalNode { + return s.GetToken(MongoShellParserTOTAL_SIZE, 0) +} - // IsRegExpConstructorContext differentiates from other interfaces. - IsRegExpConstructorContext() +func (s *IdentifierContext) DATA_SIZE() antlr.TerminalNode { + return s.GetToken(MongoShellParserDATA_SIZE, 0) } -type RegExpConstructorContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser +func (s *IdentifierContext) IS_CAPPED() antlr.TerminalNode { + return s.GetToken(MongoShellParserIS_CAPPED, 0) } -func NewEmptyRegExpConstructorContext() *RegExpConstructorContext { - var p = new(RegExpConstructorContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_regExpConstructor - return p +func (s *IdentifierContext) VALIDATE() antlr.TerminalNode { + return s.GetToken(MongoShellParserVALIDATE, 0) } -func InitEmptyRegExpConstructorContext(p *RegExpConstructorContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_regExpConstructor +func (s *IdentifierContext) LATENCY_STATS() antlr.TerminalNode { + return s.GetToken(MongoShellParserLATENCY_STATS, 0) } -func (*RegExpConstructorContext) IsRegExpConstructorContext() {} +func (s *IdentifierContext) SORT() antlr.TerminalNode { + return s.GetToken(MongoShellParserSORT, 0) +} -func NewRegExpConstructorContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *RegExpConstructorContext { - var p = new(RegExpConstructorContext) +func (s *IdentifierContext) LIMIT() antlr.TerminalNode { + return s.GetToken(MongoShellParserLIMIT, 0) +} - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) +func (s *IdentifierContext) SKIP_() antlr.TerminalNode { + return s.GetToken(MongoShellParserSKIP_, 0) +} - p.parser = parser - p.RuleIndex = MongoShellParserRULE_regExpConstructor +func (s *IdentifierContext) COUNT() antlr.TerminalNode { + return s.GetToken(MongoShellParserCOUNT, 0) +} - return p +func (s *IdentifierContext) PROJECTION() antlr.TerminalNode { + return s.GetToken(MongoShellParserPROJECTION, 0) } -func (s *RegExpConstructorContext) GetParser() antlr.Parser { return s.parser } +func (s *IdentifierContext) PROJECT() antlr.TerminalNode { + return s.GetToken(MongoShellParserPROJECT, 0) +} -func (s *RegExpConstructorContext) REG_EXP() antlr.TerminalNode { - return s.GetToken(MongoShellParserREG_EXP, 0) +func (s *IdentifierContext) GET_COLLECTION() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_COLLECTION, 0) } -func (s *RegExpConstructorContext) LPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserLPAREN, 0) +func (s *IdentifierContext) GET_COLLECTION_NAMES() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_COLLECTION_NAMES, 0) } -func (s *RegExpConstructorContext) AllStringLiteral() []IStringLiteralContext { - children := s.GetChildren() - len := 0 - for _, ctx := range children { - if _, ok := ctx.(IStringLiteralContext); ok { - len++ - } - } +func (s *IdentifierContext) GET_COLLECTION_INFOS() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_COLLECTION_INFOS, 0) +} - tst := make([]IStringLiteralContext, len) - i := 0 - for _, ctx := range children { - if t, ok := ctx.(IStringLiteralContext); ok { - tst[i] = t.(IStringLiteralContext) - i++ - } - } +func (s *IdentifierContext) CREATE_COLLECTION() antlr.TerminalNode { + return s.GetToken(MongoShellParserCREATE_COLLECTION, 0) +} - return tst +func (s *IdentifierContext) DROP_DATABASE() antlr.TerminalNode { + return s.GetToken(MongoShellParserDROP_DATABASE, 0) } -func (s *RegExpConstructorContext) StringLiteral(i int) IStringLiteralContext { - var t antlr.RuleContext - j := 0 - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IStringLiteralContext); ok { - if j == i { - t = ctx.(antlr.RuleContext) - break - } - j++ - } - } +func (s *IdentifierContext) HOST_INFO() antlr.TerminalNode { + return s.GetToken(MongoShellParserHOST_INFO, 0) +} + +func (s *IdentifierContext) LIST_COMMANDS() antlr.TerminalNode { + return s.GetToken(MongoShellParserLIST_COMMANDS, 0) +} - if t == nil { - return nil - } +func (s *IdentifierContext) SERVER_BUILD_INFO() antlr.TerminalNode { + return s.GetToken(MongoShellParserSERVER_BUILD_INFO, 0) +} - return t.(IStringLiteralContext) +func (s *IdentifierContext) SERVER_STATUS() antlr.TerminalNode { + return s.GetToken(MongoShellParserSERVER_STATUS, 0) } -func (s *RegExpConstructorContext) RPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserRPAREN, 0) +func (s *IdentifierContext) VERSION() antlr.TerminalNode { + return s.GetToken(MongoShellParserVERSION, 0) } -func (s *RegExpConstructorContext) COMMA() antlr.TerminalNode { - return s.GetToken(MongoShellParserCOMMA, 0) +func (s *IdentifierContext) RUN_COMMAND() antlr.TerminalNode { + return s.GetToken(MongoShellParserRUN_COMMAND, 0) } -func (s *RegExpConstructorContext) GetRuleContext() antlr.RuleContext { - return s +func (s *IdentifierContext) ADMIN_COMMAND() antlr.TerminalNode { + return s.GetToken(MongoShellParserADMIN_COMMAND, 0) } -func (s *RegExpConstructorContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) +func (s *IdentifierContext) GET_NAME() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_NAME, 0) } -func (s *RegExpConstructorContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterRegExpConstructor(s) - } +func (s *IdentifierContext) GET_MONGO() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_MONGO, 0) } -func (s *RegExpConstructorContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitRegExpConstructor(s) - } +func (s *IdentifierContext) GET_SIBLING_DB() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_SIBLING_DB, 0) } -func (s *RegExpConstructorContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case MongoShellParserVisitor: - return t.VisitRegExpConstructor(s) +func (s *IdentifierContext) OBJECT_ID() antlr.TerminalNode { + return s.GetToken(MongoShellParserOBJECT_ID, 0) +} - default: - return t.VisitChildren(s) - } +func (s *IdentifierContext) ISO_DATE() antlr.TerminalNode { + return s.GetToken(MongoShellParserISO_DATE, 0) } -func (p *MongoShellParser) RegExpConstructor() (localctx IRegExpConstructorContext) { - localctx = NewRegExpConstructorContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 76, MongoShellParserRULE_regExpConstructor) - var _la int +func (s *IdentifierContext) DATE() antlr.TerminalNode { + return s.GetToken(MongoShellParserDATE, 0) +} - p.EnterOuterAlt(localctx, 1) - { - p.SetState(389) - p.Match(MongoShellParserREG_EXP) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(390) - p.Match(MongoShellParserLPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(391) - p.StringLiteral() - } - p.SetState(394) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - _la = p.GetTokenStream().LA(1) +func (s *IdentifierContext) UUID() antlr.TerminalNode { + return s.GetToken(MongoShellParserUUID, 0) +} - if _la == MongoShellParserCOMMA { - { - p.SetState(392) - p.Match(MongoShellParserCOMMA) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(393) - p.StringLiteral() - } +func (s *IdentifierContext) LONG() antlr.TerminalNode { + return s.GetToken(MongoShellParserLONG, 0) +} - } - { - p.SetState(396) - p.Match(MongoShellParserRPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } +func (s *IdentifierContext) NUMBER_LONG() antlr.TerminalNode { + return s.GetToken(MongoShellParserNUMBER_LONG, 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 +func (s *IdentifierContext) INT32() antlr.TerminalNode { + return s.GetToken(MongoShellParserINT32, 0) } -// ILiteralContext is an interface to support dynamic dispatch. -type ILiteralContext interface { - antlr.ParserRuleContext +func (s *IdentifierContext) NUMBER_INT() antlr.TerminalNode { + return s.GetToken(MongoShellParserNUMBER_INT, 0) +} - // GetParser returns the parser. - GetParser() antlr.Parser - // IsLiteralContext differentiates from other interfaces. - IsLiteralContext() +func (s *IdentifierContext) DOUBLE() antlr.TerminalNode { + return s.GetToken(MongoShellParserDOUBLE, 0) } -type LiteralContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser +func (s *IdentifierContext) DECIMAL128() antlr.TerminalNode { + return s.GetToken(MongoShellParserDECIMAL128, 0) } -func NewEmptyLiteralContext() *LiteralContext { - var p = new(LiteralContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_literal - return p +func (s *IdentifierContext) NUMBER_DECIMAL() antlr.TerminalNode { + return s.GetToken(MongoShellParserNUMBER_DECIMAL, 0) } -func InitEmptyLiteralContext(p *LiteralContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_literal +func (s *IdentifierContext) TIMESTAMP() antlr.TerminalNode { + return s.GetToken(MongoShellParserTIMESTAMP, 0) } -func (*LiteralContext) IsLiteralContext() {} +func (s *IdentifierContext) REG_EXP() antlr.TerminalNode { + return s.GetToken(MongoShellParserREG_EXP, 0) +} -func NewLiteralContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LiteralContext { - var p = new(LiteralContext) +func (s *IdentifierContext) BIN_DATA() antlr.TerminalNode { + return s.GetToken(MongoShellParserBIN_DATA, 0) +} - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) +func (s *IdentifierContext) BINARY() antlr.TerminalNode { + return s.GetToken(MongoShellParserBINARY, 0) +} - p.parser = parser - p.RuleIndex = MongoShellParserRULE_literal +func (s *IdentifierContext) BSON_REG_EXP() antlr.TerminalNode { + return s.GetToken(MongoShellParserBSON_REG_EXP, 0) +} - return p +func (s *IdentifierContext) HEX_DATA() antlr.TerminalNode { + return s.GetToken(MongoShellParserHEX_DATA, 0) } -func (s *LiteralContext) GetParser() antlr.Parser { return s.parser } +func (s *IdentifierContext) BATCH_SIZE() antlr.TerminalNode { + return s.GetToken(MongoShellParserBATCH_SIZE, 0) +} -func (s *LiteralContext) CopyAll(ctx *LiteralContext) { - s.CopyFrom(&ctx.BaseParserRuleContext) +func (s *IdentifierContext) CLOSE() antlr.TerminalNode { + return s.GetToken(MongoShellParserCLOSE, 0) } -func (s *LiteralContext) GetRuleContext() antlr.RuleContext { - return s +func (s *IdentifierContext) COLLATION() antlr.TerminalNode { + return s.GetToken(MongoShellParserCOLLATION, 0) } -func (s *LiteralContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) +func (s *IdentifierContext) COMMENT() antlr.TerminalNode { + return s.GetToken(MongoShellParserCOMMENT, 0) } -type StringLiteralValueContext struct { - LiteralContext +func (s *IdentifierContext) EXPLAIN() antlr.TerminalNode { + return s.GetToken(MongoShellParserEXPLAIN, 0) } -func NewStringLiteralValueContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *StringLiteralValueContext { - var p = new(StringLiteralValueContext) +func (s *IdentifierContext) FOR_EACH() antlr.TerminalNode { + return s.GetToken(MongoShellParserFOR_EACH, 0) +} - InitEmptyLiteralContext(&p.LiteralContext) - p.parser = parser - p.CopyAll(ctx.(*LiteralContext)) +func (s *IdentifierContext) HAS_NEXT() antlr.TerminalNode { + return s.GetToken(MongoShellParserHAS_NEXT, 0) +} - return p +func (s *IdentifierContext) HINT() antlr.TerminalNode { + return s.GetToken(MongoShellParserHINT, 0) } -func (s *StringLiteralValueContext) GetRuleContext() antlr.RuleContext { - return s +func (s *IdentifierContext) IS_CLOSED() antlr.TerminalNode { + return s.GetToken(MongoShellParserIS_CLOSED, 0) } -func (s *StringLiteralValueContext) StringLiteral() IStringLiteralContext { - var t antlr.RuleContext - for _, ctx := range s.GetChildren() { - if _, ok := ctx.(IStringLiteralContext); ok { - t = ctx.(antlr.RuleContext) - break - } - } +func (s *IdentifierContext) IS_EXHAUSTED() antlr.TerminalNode { + return s.GetToken(MongoShellParserIS_EXHAUSTED, 0) +} - if t == nil { - return nil - } +func (s *IdentifierContext) IT_COUNT() antlr.TerminalNode { + return s.GetToken(MongoShellParserIT_COUNT, 0) +} - return t.(IStringLiteralContext) +func (s *IdentifierContext) MAP() antlr.TerminalNode { + return s.GetToken(MongoShellParserMAP, 0) } -func (s *StringLiteralValueContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterStringLiteralValue(s) - } +func (s *IdentifierContext) MAX() antlr.TerminalNode { + return s.GetToken(MongoShellParserMAX, 0) } -func (s *StringLiteralValueContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitStringLiteralValue(s) - } +func (s *IdentifierContext) MAX_AWAIT_TIME_MS() antlr.TerminalNode { + return s.GetToken(MongoShellParserMAX_AWAIT_TIME_MS, 0) } -func (s *StringLiteralValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case MongoShellParserVisitor: - return t.VisitStringLiteralValue(s) +func (s *IdentifierContext) MAX_TIME_MS() antlr.TerminalNode { + return s.GetToken(MongoShellParserMAX_TIME_MS, 0) +} - default: - return t.VisitChildren(s) - } +func (s *IdentifierContext) MIN() antlr.TerminalNode { + return s.GetToken(MongoShellParserMIN, 0) } -type NullLiteralContext struct { - LiteralContext +func (s *IdentifierContext) NEXT() antlr.TerminalNode { + return s.GetToken(MongoShellParserNEXT, 0) } -func NewNullLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NullLiteralContext { - var p = new(NullLiteralContext) +func (s *IdentifierContext) NO_CURSOR_TIMEOUT() antlr.TerminalNode { + return s.GetToken(MongoShellParserNO_CURSOR_TIMEOUT, 0) +} - InitEmptyLiteralContext(&p.LiteralContext) - p.parser = parser - p.CopyAll(ctx.(*LiteralContext)) +func (s *IdentifierContext) OBJS_LEFT_IN_BATCH() antlr.TerminalNode { + return s.GetToken(MongoShellParserOBJS_LEFT_IN_BATCH, 0) +} - return p +func (s *IdentifierContext) PRETTY() antlr.TerminalNode { + return s.GetToken(MongoShellParserPRETTY, 0) } -func (s *NullLiteralContext) GetRuleContext() antlr.RuleContext { - return s +func (s *IdentifierContext) READ_CONCERN() antlr.TerminalNode { + return s.GetToken(MongoShellParserREAD_CONCERN, 0) } -func (s *NullLiteralContext) NULL() antlr.TerminalNode { - return s.GetToken(MongoShellParserNULL, 0) +func (s *IdentifierContext) READ_PREF() antlr.TerminalNode { + return s.GetToken(MongoShellParserREAD_PREF, 0) } -func (s *NullLiteralContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterNullLiteral(s) - } +func (s *IdentifierContext) RETURN_KEY() antlr.TerminalNode { + return s.GetToken(MongoShellParserRETURN_KEY, 0) } -func (s *NullLiteralContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitNullLiteral(s) - } +func (s *IdentifierContext) SHOW_RECORD_ID() antlr.TerminalNode { + return s.GetToken(MongoShellParserSHOW_RECORD_ID, 0) } -func (s *NullLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case MongoShellParserVisitor: - return t.VisitNullLiteral(s) +func (s *IdentifierContext) SIZE() antlr.TerminalNode { + return s.GetToken(MongoShellParserSIZE, 0) +} - default: - return t.VisitChildren(s) - } +func (s *IdentifierContext) TAILABLE() antlr.TerminalNode { + return s.GetToken(MongoShellParserTAILABLE, 0) } -type FalseLiteralContext struct { - LiteralContext +func (s *IdentifierContext) TO_ARRAY() antlr.TerminalNode { + return s.GetToken(MongoShellParserTO_ARRAY, 0) } -func NewFalseLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *FalseLiteralContext { - var p = new(FalseLiteralContext) +func (s *IdentifierContext) TRY_NEXT() antlr.TerminalNode { + return s.GetToken(MongoShellParserTRY_NEXT, 0) +} - InitEmptyLiteralContext(&p.LiteralContext) - p.parser = parser - p.CopyAll(ctx.(*LiteralContext)) +func (s *IdentifierContext) ALLOW_DISK_USE() antlr.TerminalNode { + return s.GetToken(MongoShellParserALLOW_DISK_USE, 0) +} - return p +func (s *IdentifierContext) ADD_OPTION() antlr.TerminalNode { + return s.GetToken(MongoShellParserADD_OPTION, 0) } -func (s *FalseLiteralContext) GetRuleContext() antlr.RuleContext { - return s +func (s *IdentifierContext) INITIALIZE_ORDERED_BULK_OP() antlr.TerminalNode { + return s.GetToken(MongoShellParserINITIALIZE_ORDERED_BULK_OP, 0) } -func (s *FalseLiteralContext) FALSE() antlr.TerminalNode { - return s.GetToken(MongoShellParserFALSE, 0) +func (s *IdentifierContext) INITIALIZE_UNORDERED_BULK_OP() antlr.TerminalNode { + return s.GetToken(MongoShellParserINITIALIZE_UNORDERED_BULK_OP, 0) +} + +func (s *IdentifierContext) EXECUTE() antlr.TerminalNode { + return s.GetToken(MongoShellParserEXECUTE, 0) +} + +func (s *IdentifierContext) GET_OPERATIONS() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_OPERATIONS, 0) +} + +func (s *IdentifierContext) TO_STRING() antlr.TerminalNode { + return s.GetToken(MongoShellParserTO_STRING, 0) +} + +func (s *IdentifierContext) INSERT() antlr.TerminalNode { + return s.GetToken(MongoShellParserINSERT, 0) +} + +func (s *IdentifierContext) REMOVE() antlr.TerminalNode { + return s.GetToken(MongoShellParserREMOVE, 0) +} + +func (s *IdentifierContext) MONGO() antlr.TerminalNode { + return s.GetToken(MongoShellParserMONGO, 0) +} + +func (s *IdentifierContext) CONNECT() antlr.TerminalNode { + return s.GetToken(MongoShellParserCONNECT, 0) } -func (s *FalseLiteralContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterFalseLiteral(s) - } +func (s *IdentifierContext) GET_DB() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_DB, 0) } -func (s *FalseLiteralContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitFalseLiteral(s) - } +func (s *IdentifierContext) GET_READ_CONCERN() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_READ_CONCERN, 0) } -func (s *FalseLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case MongoShellParserVisitor: - return t.VisitFalseLiteral(s) +func (s *IdentifierContext) GET_READ_PREF() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_READ_PREF, 0) +} - default: - return t.VisitChildren(s) - } +func (s *IdentifierContext) GET_READ_PREF_MODE() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_READ_PREF_MODE, 0) } -type TrueLiteralContext struct { - LiteralContext +func (s *IdentifierContext) GET_READ_PREF_TAG_SET() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_READ_PREF_TAG_SET, 0) } -func NewTrueLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *TrueLiteralContext { - var p = new(TrueLiteralContext) +func (s *IdentifierContext) GET_WRITE_CONCERN() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_WRITE_CONCERN, 0) +} - InitEmptyLiteralContext(&p.LiteralContext) - p.parser = parser - p.CopyAll(ctx.(*LiteralContext)) +func (s *IdentifierContext) SET_READ_PREF() antlr.TerminalNode { + return s.GetToken(MongoShellParserSET_READ_PREF, 0) +} - return p +func (s *IdentifierContext) SET_READ_CONCERN() antlr.TerminalNode { + return s.GetToken(MongoShellParserSET_READ_CONCERN, 0) } -func (s *TrueLiteralContext) GetRuleContext() antlr.RuleContext { - return s +func (s *IdentifierContext) SET_WRITE_CONCERN() antlr.TerminalNode { + return s.GetToken(MongoShellParserSET_WRITE_CONCERN, 0) } -func (s *TrueLiteralContext) TRUE() antlr.TerminalNode { - return s.GetToken(MongoShellParserTRUE, 0) +func (s *IdentifierContext) START_SESSION() antlr.TerminalNode { + return s.GetToken(MongoShellParserSTART_SESSION, 0) } -func (s *TrueLiteralContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterTrueLiteral(s) - } +func (s *IdentifierContext) WATCH() antlr.TerminalNode { + return s.GetToken(MongoShellParserWATCH, 0) } -func (s *TrueLiteralContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitTrueLiteral(s) - } +func (s *IdentifierContext) GET_DB_NAMES() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_DB_NAMES, 0) } -func (s *TrueLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case MongoShellParserVisitor: - return t.VisitTrueLiteral(s) +func (s *IdentifierContext) RS() antlr.TerminalNode { + return s.GetToken(MongoShellParserRS, 0) +} - default: - return t.VisitChildren(s) - } +func (s *IdentifierContext) SH() antlr.TerminalNode { + return s.GetToken(MongoShellParserSH, 0) } -type NumberLiteralContext struct { - LiteralContext +func (s *IdentifierContext) SP() antlr.TerminalNode { + return s.GetToken(MongoShellParserSP, 0) } -func NewNumberLiteralContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NumberLiteralContext { - var p = new(NumberLiteralContext) +func (s *IdentifierContext) GET_KEY_VAULT() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_KEY_VAULT, 0) +} - InitEmptyLiteralContext(&p.LiteralContext) - p.parser = parser - p.CopyAll(ctx.(*LiteralContext)) +func (s *IdentifierContext) GET_CLIENT_ENCRYPTION() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_CLIENT_ENCRYPTION, 0) +} - return p +func (s *IdentifierContext) GET_PLAN_CACHE() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_PLAN_CACHE, 0) } -func (s *NumberLiteralContext) GetRuleContext() antlr.RuleContext { +func (s *IdentifierContext) GetRuleContext() antlr.RuleContext { return s } -func (s *NumberLiteralContext) NUMBER() antlr.TerminalNode { - return s.GetToken(MongoShellParserNUMBER, 0) +func (s *IdentifierContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *NumberLiteralContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *IdentifierContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterNumberLiteral(s) + listenerT.EnterIdentifier(s) } } -func (s *NumberLiteralContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *IdentifierContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitNumberLiteral(s) + listenerT.ExitIdentifier(s) } } -func (s *NumberLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *IdentifierContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitNumberLiteral(s) + return t.VisitIdentifier(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) Literal() (localctx ILiteralContext) { - localctx = NewLiteralContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 78, MongoShellParserRULE_literal) - p.SetState(403) +func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { + localctx = NewIdentifierContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 226, MongoShellParserRULE_identifier) + p.SetState(1436) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } switch p.GetTokenStream().LA(1) { - case MongoShellParserDOUBLE_QUOTED_STRING, MongoShellParserSINGLE_QUOTED_STRING: - localctx = NewStringLiteralValueContext(p, localctx) + case MongoShellParserIDENTIFIER: p.EnterOuterAlt(localctx, 1) { - p.SetState(398) - p.StringLiteral() + p.SetState(1298) + p.Match(MongoShellParserIDENTIFIER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case MongoShellParserDOLLAR: + p.EnterOuterAlt(localctx, 2) + { + p.SetState(1299) + p.Match(MongoShellParserDOLLAR) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(1300) + p.Match(MongoShellParserIDENTIFIER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case MongoShellParserSHOW: + p.EnterOuterAlt(localctx, 3) + { + p.SetState(1301) + p.Match(MongoShellParserSHOW) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case MongoShellParserDBS: + p.EnterOuterAlt(localctx, 4) + { + p.SetState(1302) + p.Match(MongoShellParserDBS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case MongoShellParserDATABASES: + p.EnterOuterAlt(localctx, 5) + { + p.SetState(1303) + p.Match(MongoShellParserDATABASES) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case MongoShellParserCOLLECTIONS: + p.EnterOuterAlt(localctx, 6) + { + p.SetState(1304) + p.Match(MongoShellParserCOLLECTIONS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case MongoShellParserDB: + p.EnterOuterAlt(localctx, 7) + { + p.SetState(1305) + p.Match(MongoShellParserDB) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case MongoShellParserNEW: + p.EnterOuterAlt(localctx, 8) + { + p.SetState(1306) + p.Match(MongoShellParserNEW) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case MongoShellParserTRUE: + p.EnterOuterAlt(localctx, 9) + { + p.SetState(1307) + p.Match(MongoShellParserTRUE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case MongoShellParserFALSE: + p.EnterOuterAlt(localctx, 10) + { + p.SetState(1308) + p.Match(MongoShellParserFALSE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case MongoShellParserNULL: + p.EnterOuterAlt(localctx, 11) + { + p.SetState(1309) + p.Match(MongoShellParserNULL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case MongoShellParserFIND: + p.EnterOuterAlt(localctx, 12) + { + p.SetState(1310) + p.Match(MongoShellParserFIND) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case MongoShellParserFIND_ONE: + p.EnterOuterAlt(localctx, 13) + { + p.SetState(1311) + p.Match(MongoShellParserFIND_ONE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case MongoShellParserCOUNT_DOCUMENTS: + p.EnterOuterAlt(localctx, 14) + { + p.SetState(1312) + p.Match(MongoShellParserCOUNT_DOCUMENTS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case MongoShellParserESTIMATED_DOCUMENT_COUNT: + p.EnterOuterAlt(localctx, 15) + { + p.SetState(1313) + p.Match(MongoShellParserESTIMATED_DOCUMENT_COUNT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case MongoShellParserDISTINCT: + p.EnterOuterAlt(localctx, 16) + { + p.SetState(1314) + p.Match(MongoShellParserDISTINCT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case MongoShellParserAGGREGATE: + p.EnterOuterAlt(localctx, 17) + { + p.SetState(1315) + p.Match(MongoShellParserAGGREGATE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - case MongoShellParserNUMBER: - localctx = NewNumberLiteralContext(p, localctx) - p.EnterOuterAlt(localctx, 2) + case MongoShellParserGET_INDEXES: + p.EnterOuterAlt(localctx, 18) { - p.SetState(399) - p.Match(MongoShellParserNUMBER) + p.SetState(1316) + p.Match(MongoShellParserGET_INDEXES) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserTRUE: - localctx = NewTrueLiteralContext(p, localctx) - p.EnterOuterAlt(localctx, 3) + case MongoShellParserINSERT_ONE: + p.EnterOuterAlt(localctx, 19) { - p.SetState(400) - p.Match(MongoShellParserTRUE) + p.SetState(1317) + p.Match(MongoShellParserINSERT_ONE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserFALSE: - localctx = NewFalseLiteralContext(p, localctx) - p.EnterOuterAlt(localctx, 4) + case MongoShellParserINSERT_MANY: + p.EnterOuterAlt(localctx, 20) { - p.SetState(401) - p.Match(MongoShellParserFALSE) + p.SetState(1318) + p.Match(MongoShellParserINSERT_MANY) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserNULL: - localctx = NewNullLiteralContext(p, localctx) - p.EnterOuterAlt(localctx, 5) + case MongoShellParserUPDATE_ONE: + p.EnterOuterAlt(localctx, 21) { - p.SetState(402) - p.Match(MongoShellParserNULL) + p.SetState(1319) + p.Match(MongoShellParserUPDATE_ONE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - default: - 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 -} - -// IStringLiteralContext is an interface to support dynamic dispatch. -type IStringLiteralContext interface { - antlr.ParserRuleContext - - // GetParser returns the parser. - GetParser() antlr.Parser - - // Getter signatures - DOUBLE_QUOTED_STRING() antlr.TerminalNode - SINGLE_QUOTED_STRING() antlr.TerminalNode - - // IsStringLiteralContext differentiates from other interfaces. - IsStringLiteralContext() -} - -type StringLiteralContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser -} - -func NewEmptyStringLiteralContext() *StringLiteralContext { - var p = new(StringLiteralContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_stringLiteral - return p -} - -func InitEmptyStringLiteralContext(p *StringLiteralContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_stringLiteral -} - -func (*StringLiteralContext) IsStringLiteralContext() {} - -func NewStringLiteralContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *StringLiteralContext { - var p = new(StringLiteralContext) - - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) - - p.parser = parser - p.RuleIndex = MongoShellParserRULE_stringLiteral + case MongoShellParserUPDATE_MANY: + p.EnterOuterAlt(localctx, 22) + { + p.SetState(1320) + p.Match(MongoShellParserUPDATE_MANY) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } - return p -} + case MongoShellParserDELETE_ONE: + p.EnterOuterAlt(localctx, 23) + { + p.SetState(1321) + p.Match(MongoShellParserDELETE_ONE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *StringLiteralContext) GetParser() antlr.Parser { return s.parser } + case MongoShellParserDELETE_MANY: + p.EnterOuterAlt(localctx, 24) + { + p.SetState(1322) + p.Match(MongoShellParserDELETE_MANY) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *StringLiteralContext) DOUBLE_QUOTED_STRING() antlr.TerminalNode { - return s.GetToken(MongoShellParserDOUBLE_QUOTED_STRING, 0) -} + case MongoShellParserREPLACE_ONE: + p.EnterOuterAlt(localctx, 25) + { + p.SetState(1323) + p.Match(MongoShellParserREPLACE_ONE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *StringLiteralContext) SINGLE_QUOTED_STRING() antlr.TerminalNode { - return s.GetToken(MongoShellParserSINGLE_QUOTED_STRING, 0) -} + case MongoShellParserFIND_ONE_AND_UPDATE: + p.EnterOuterAlt(localctx, 26) + { + p.SetState(1324) + p.Match(MongoShellParserFIND_ONE_AND_UPDATE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *StringLiteralContext) GetRuleContext() antlr.RuleContext { - return s -} + case MongoShellParserFIND_ONE_AND_REPLACE: + p.EnterOuterAlt(localctx, 27) + { + p.SetState(1325) + p.Match(MongoShellParserFIND_ONE_AND_REPLACE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *StringLiteralContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) -} + case MongoShellParserFIND_ONE_AND_DELETE: + p.EnterOuterAlt(localctx, 28) + { + p.SetState(1326) + p.Match(MongoShellParserFIND_ONE_AND_DELETE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *StringLiteralContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterStringLiteral(s) - } -} + case MongoShellParserCREATE_INDEX: + p.EnterOuterAlt(localctx, 29) + { + p.SetState(1327) + p.Match(MongoShellParserCREATE_INDEX) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *StringLiteralContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitStringLiteral(s) - } -} + case MongoShellParserCREATE_INDEXES: + p.EnterOuterAlt(localctx, 30) + { + p.SetState(1328) + p.Match(MongoShellParserCREATE_INDEXES) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *StringLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case MongoShellParserVisitor: - return t.VisitStringLiteral(s) + case MongoShellParserDROP_INDEX: + p.EnterOuterAlt(localctx, 31) + { + p.SetState(1329) + p.Match(MongoShellParserDROP_INDEX) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } - default: - return t.VisitChildren(s) - } -} + case MongoShellParserDROP_INDEXES: + p.EnterOuterAlt(localctx, 32) + { + p.SetState(1330) + p.Match(MongoShellParserDROP_INDEXES) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (p *MongoShellParser) StringLiteral() (localctx IStringLiteralContext) { - localctx = NewStringLiteralContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 80, MongoShellParserRULE_stringLiteral) - var _la int + case MongoShellParserDROP: + p.EnterOuterAlt(localctx, 33) + { + p.SetState(1331) + p.Match(MongoShellParserDROP) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } - p.EnterOuterAlt(localctx, 1) - { - p.SetState(405) - _la = p.GetTokenStream().LA(1) + case MongoShellParserRENAME_COLLECTION: + p.EnterOuterAlt(localctx, 34) + { + p.SetState(1332) + p.Match(MongoShellParserRENAME_COLLECTION) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } - if !(_la == MongoShellParserDOUBLE_QUOTED_STRING || _la == MongoShellParserSINGLE_QUOTED_STRING) { - p.GetErrorHandler().RecoverInline(p) - } else { - p.GetErrorHandler().ReportMatch(p) - p.Consume() + case MongoShellParserSTATS: + p.EnterOuterAlt(localctx, 35) + { + p.SetState(1333) + p.Match(MongoShellParserSTATS) + 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 -} + case MongoShellParserSTORAGE_SIZE: + p.EnterOuterAlt(localctx, 36) + { + p.SetState(1334) + p.Match(MongoShellParserSTORAGE_SIZE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -// IIdentifierContext is an interface to support dynamic dispatch. -type IIdentifierContext interface { - antlr.ParserRuleContext + case MongoShellParserTOTAL_INDEX_SIZE: + p.EnterOuterAlt(localctx, 37) + { + p.SetState(1335) + p.Match(MongoShellParserTOTAL_INDEX_SIZE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } - // GetParser returns the parser. - GetParser() antlr.Parser + case MongoShellParserTOTAL_SIZE: + p.EnterOuterAlt(localctx, 38) + { + p.SetState(1336) + p.Match(MongoShellParserTOTAL_SIZE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } - // Getter signatures - IDENTIFIER() antlr.TerminalNode - DOLLAR() antlr.TerminalNode - SHOW() antlr.TerminalNode - DBS() antlr.TerminalNode - DATABASES() antlr.TerminalNode - COLLECTIONS() antlr.TerminalNode - DB() antlr.TerminalNode - NEW() antlr.TerminalNode - TRUE() antlr.TerminalNode - FALSE() antlr.TerminalNode - NULL() antlr.TerminalNode - FIND() antlr.TerminalNode - FIND_ONE() antlr.TerminalNode - COUNT_DOCUMENTS() antlr.TerminalNode - ESTIMATED_DOCUMENT_COUNT() antlr.TerminalNode - DISTINCT() antlr.TerminalNode - AGGREGATE() antlr.TerminalNode - GET_INDEXES() antlr.TerminalNode - SORT() antlr.TerminalNode - LIMIT() antlr.TerminalNode - SKIP_() antlr.TerminalNode - COUNT() antlr.TerminalNode - PROJECTION() antlr.TerminalNode - PROJECT() antlr.TerminalNode - GET_COLLECTION() antlr.TerminalNode - GET_COLLECTION_NAMES() antlr.TerminalNode - GET_COLLECTION_INFOS() antlr.TerminalNode - OBJECT_ID() antlr.TerminalNode - ISO_DATE() antlr.TerminalNode - DATE() antlr.TerminalNode - UUID() antlr.TerminalNode - LONG() antlr.TerminalNode - NUMBER_LONG() antlr.TerminalNode - INT32() antlr.TerminalNode - NUMBER_INT() antlr.TerminalNode - DOUBLE() antlr.TerminalNode - DECIMAL128() antlr.TerminalNode - NUMBER_DECIMAL() antlr.TerminalNode - TIMESTAMP() antlr.TerminalNode - REG_EXP() antlr.TerminalNode + case MongoShellParserDATA_SIZE: + p.EnterOuterAlt(localctx, 39) + { + p.SetState(1337) + p.Match(MongoShellParserDATA_SIZE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } - // IsIdentifierContext differentiates from other interfaces. - IsIdentifierContext() -} + case MongoShellParserIS_CAPPED: + p.EnterOuterAlt(localctx, 40) + { + p.SetState(1338) + p.Match(MongoShellParserIS_CAPPED) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -type IdentifierContext struct { - antlr.BaseParserRuleContext - parser antlr.Parser -} + case MongoShellParserVALIDATE: + p.EnterOuterAlt(localctx, 41) + { + p.SetState(1339) + p.Match(MongoShellParserVALIDATE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func NewEmptyIdentifierContext() *IdentifierContext { - var p = new(IdentifierContext) - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_identifier - return p -} + case MongoShellParserLATENCY_STATS: + p.EnterOuterAlt(localctx, 42) + { + p.SetState(1340) + p.Match(MongoShellParserLATENCY_STATS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func InitEmptyIdentifierContext(p *IdentifierContext) { - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_identifier -} + case MongoShellParserSORT: + p.EnterOuterAlt(localctx, 43) + { + p.SetState(1341) + p.Match(MongoShellParserSORT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (*IdentifierContext) IsIdentifierContext() {} + case MongoShellParserLIMIT: + p.EnterOuterAlt(localctx, 44) + { + p.SetState(1342) + p.Match(MongoShellParserLIMIT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func NewIdentifierContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IdentifierContext { - var p = new(IdentifierContext) + case MongoShellParserSKIP_: + p.EnterOuterAlt(localctx, 45) + { + p.SetState(1343) + p.Match(MongoShellParserSKIP_) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } - antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) + case MongoShellParserCOUNT: + p.EnterOuterAlt(localctx, 46) + { + p.SetState(1344) + p.Match(MongoShellParserCOUNT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } - p.parser = parser - p.RuleIndex = MongoShellParserRULE_identifier + case MongoShellParserPROJECTION: + p.EnterOuterAlt(localctx, 47) + { + p.SetState(1345) + p.Match(MongoShellParserPROJECTION) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } - return p -} + case MongoShellParserPROJECT: + p.EnterOuterAlt(localctx, 48) + { + p.SetState(1346) + p.Match(MongoShellParserPROJECT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) GetParser() antlr.Parser { return s.parser } + case MongoShellParserGET_COLLECTION: + p.EnterOuterAlt(localctx, 49) + { + p.SetState(1347) + p.Match(MongoShellParserGET_COLLECTION) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) IDENTIFIER() antlr.TerminalNode { - return s.GetToken(MongoShellParserIDENTIFIER, 0) -} + case MongoShellParserGET_COLLECTION_NAMES: + p.EnterOuterAlt(localctx, 50) + { + p.SetState(1348) + p.Match(MongoShellParserGET_COLLECTION_NAMES) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) DOLLAR() antlr.TerminalNode { - return s.GetToken(MongoShellParserDOLLAR, 0) -} + case MongoShellParserGET_COLLECTION_INFOS: + p.EnterOuterAlt(localctx, 51) + { + p.SetState(1349) + p.Match(MongoShellParserGET_COLLECTION_INFOS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) SHOW() antlr.TerminalNode { - return s.GetToken(MongoShellParserSHOW, 0) -} + case MongoShellParserCREATE_COLLECTION: + p.EnterOuterAlt(localctx, 52) + { + p.SetState(1350) + p.Match(MongoShellParserCREATE_COLLECTION) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) DBS() antlr.TerminalNode { - return s.GetToken(MongoShellParserDBS, 0) -} + case MongoShellParserDROP_DATABASE: + p.EnterOuterAlt(localctx, 53) + { + p.SetState(1351) + p.Match(MongoShellParserDROP_DATABASE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) DATABASES() antlr.TerminalNode { - return s.GetToken(MongoShellParserDATABASES, 0) -} + case MongoShellParserHOST_INFO: + p.EnterOuterAlt(localctx, 54) + { + p.SetState(1352) + p.Match(MongoShellParserHOST_INFO) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) COLLECTIONS() antlr.TerminalNode { - return s.GetToken(MongoShellParserCOLLECTIONS, 0) -} + case MongoShellParserLIST_COMMANDS: + p.EnterOuterAlt(localctx, 55) + { + p.SetState(1353) + p.Match(MongoShellParserLIST_COMMANDS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) DB() antlr.TerminalNode { - return s.GetToken(MongoShellParserDB, 0) -} + case MongoShellParserSERVER_BUILD_INFO: + p.EnterOuterAlt(localctx, 56) + { + p.SetState(1354) + p.Match(MongoShellParserSERVER_BUILD_INFO) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) NEW() antlr.TerminalNode { - return s.GetToken(MongoShellParserNEW, 0) -} + case MongoShellParserSERVER_STATUS: + p.EnterOuterAlt(localctx, 57) + { + p.SetState(1355) + p.Match(MongoShellParserSERVER_STATUS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) TRUE() antlr.TerminalNode { - return s.GetToken(MongoShellParserTRUE, 0) -} + case MongoShellParserVERSION: + p.EnterOuterAlt(localctx, 58) + { + p.SetState(1356) + p.Match(MongoShellParserVERSION) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) FALSE() antlr.TerminalNode { - return s.GetToken(MongoShellParserFALSE, 0) -} + case MongoShellParserRUN_COMMAND: + p.EnterOuterAlt(localctx, 59) + { + p.SetState(1357) + p.Match(MongoShellParserRUN_COMMAND) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) NULL() antlr.TerminalNode { - return s.GetToken(MongoShellParserNULL, 0) -} + case MongoShellParserADMIN_COMMAND: + p.EnterOuterAlt(localctx, 60) + { + p.SetState(1358) + p.Match(MongoShellParserADMIN_COMMAND) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) FIND() antlr.TerminalNode { - return s.GetToken(MongoShellParserFIND, 0) -} + case MongoShellParserGET_NAME: + p.EnterOuterAlt(localctx, 61) + { + p.SetState(1359) + p.Match(MongoShellParserGET_NAME) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) FIND_ONE() antlr.TerminalNode { - return s.GetToken(MongoShellParserFIND_ONE, 0) -} + case MongoShellParserGET_MONGO: + p.EnterOuterAlt(localctx, 62) + { + p.SetState(1360) + p.Match(MongoShellParserGET_MONGO) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) COUNT_DOCUMENTS() antlr.TerminalNode { - return s.GetToken(MongoShellParserCOUNT_DOCUMENTS, 0) -} + case MongoShellParserGET_SIBLING_DB: + p.EnterOuterAlt(localctx, 63) + { + p.SetState(1361) + p.Match(MongoShellParserGET_SIBLING_DB) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) ESTIMATED_DOCUMENT_COUNT() antlr.TerminalNode { - return s.GetToken(MongoShellParserESTIMATED_DOCUMENT_COUNT, 0) -} + case MongoShellParserOBJECT_ID: + p.EnterOuterAlt(localctx, 64) + { + p.SetState(1362) + p.Match(MongoShellParserOBJECT_ID) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) DISTINCT() antlr.TerminalNode { - return s.GetToken(MongoShellParserDISTINCT, 0) -} + case MongoShellParserISO_DATE: + p.EnterOuterAlt(localctx, 65) + { + p.SetState(1363) + p.Match(MongoShellParserISO_DATE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) AGGREGATE() antlr.TerminalNode { - return s.GetToken(MongoShellParserAGGREGATE, 0) -} + case MongoShellParserDATE: + p.EnterOuterAlt(localctx, 66) + { + p.SetState(1364) + p.Match(MongoShellParserDATE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) GET_INDEXES() antlr.TerminalNode { - return s.GetToken(MongoShellParserGET_INDEXES, 0) -} + case MongoShellParserUUID: + p.EnterOuterAlt(localctx, 67) + { + p.SetState(1365) + p.Match(MongoShellParserUUID) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) SORT() antlr.TerminalNode { - return s.GetToken(MongoShellParserSORT, 0) -} + case MongoShellParserLONG: + p.EnterOuterAlt(localctx, 68) + { + p.SetState(1366) + p.Match(MongoShellParserLONG) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) LIMIT() antlr.TerminalNode { - return s.GetToken(MongoShellParserLIMIT, 0) -} + case MongoShellParserNUMBER_LONG: + p.EnterOuterAlt(localctx, 69) + { + p.SetState(1367) + p.Match(MongoShellParserNUMBER_LONG) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) SKIP_() antlr.TerminalNode { - return s.GetToken(MongoShellParserSKIP_, 0) -} + case MongoShellParserINT32: + p.EnterOuterAlt(localctx, 70) + { + p.SetState(1368) + p.Match(MongoShellParserINT32) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) COUNT() antlr.TerminalNode { - return s.GetToken(MongoShellParserCOUNT, 0) -} + case MongoShellParserNUMBER_INT: + p.EnterOuterAlt(localctx, 71) + { + p.SetState(1369) + p.Match(MongoShellParserNUMBER_INT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) PROJECTION() antlr.TerminalNode { - return s.GetToken(MongoShellParserPROJECTION, 0) -} + case MongoShellParserDOUBLE: + p.EnterOuterAlt(localctx, 72) + { + p.SetState(1370) + p.Match(MongoShellParserDOUBLE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) PROJECT() antlr.TerminalNode { - return s.GetToken(MongoShellParserPROJECT, 0) -} + case MongoShellParserDECIMAL128: + p.EnterOuterAlt(localctx, 73) + { + p.SetState(1371) + p.Match(MongoShellParserDECIMAL128) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) GET_COLLECTION() antlr.TerminalNode { - return s.GetToken(MongoShellParserGET_COLLECTION, 0) -} + case MongoShellParserNUMBER_DECIMAL: + p.EnterOuterAlt(localctx, 74) + { + p.SetState(1372) + p.Match(MongoShellParserNUMBER_DECIMAL) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) GET_COLLECTION_NAMES() antlr.TerminalNode { - return s.GetToken(MongoShellParserGET_COLLECTION_NAMES, 0) -} + case MongoShellParserTIMESTAMP: + p.EnterOuterAlt(localctx, 75) + { + p.SetState(1373) + p.Match(MongoShellParserTIMESTAMP) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) GET_COLLECTION_INFOS() antlr.TerminalNode { - return s.GetToken(MongoShellParserGET_COLLECTION_INFOS, 0) -} + case MongoShellParserREG_EXP: + p.EnterOuterAlt(localctx, 76) + { + p.SetState(1374) + p.Match(MongoShellParserREG_EXP) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) OBJECT_ID() antlr.TerminalNode { - return s.GetToken(MongoShellParserOBJECT_ID, 0) -} + case MongoShellParserBIN_DATA: + p.EnterOuterAlt(localctx, 77) + { + p.SetState(1375) + p.Match(MongoShellParserBIN_DATA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) ISO_DATE() antlr.TerminalNode { - return s.GetToken(MongoShellParserISO_DATE, 0) -} + case MongoShellParserBINARY: + p.EnterOuterAlt(localctx, 78) + { + p.SetState(1376) + p.Match(MongoShellParserBINARY) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) DATE() antlr.TerminalNode { - return s.GetToken(MongoShellParserDATE, 0) -} + case MongoShellParserBSON_REG_EXP: + p.EnterOuterAlt(localctx, 79) + { + p.SetState(1377) + p.Match(MongoShellParserBSON_REG_EXP) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) UUID() antlr.TerminalNode { - return s.GetToken(MongoShellParserUUID, 0) -} + case MongoShellParserHEX_DATA: + p.EnterOuterAlt(localctx, 80) + { + p.SetState(1378) + p.Match(MongoShellParserHEX_DATA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) LONG() antlr.TerminalNode { - return s.GetToken(MongoShellParserLONG, 0) -} + case MongoShellParserBATCH_SIZE: + p.EnterOuterAlt(localctx, 81) + { + p.SetState(1379) + p.Match(MongoShellParserBATCH_SIZE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) NUMBER_LONG() antlr.TerminalNode { - return s.GetToken(MongoShellParserNUMBER_LONG, 0) -} + case MongoShellParserCLOSE: + p.EnterOuterAlt(localctx, 82) + { + p.SetState(1380) + p.Match(MongoShellParserCLOSE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) INT32() antlr.TerminalNode { - return s.GetToken(MongoShellParserINT32, 0) -} + case MongoShellParserCOLLATION: + p.EnterOuterAlt(localctx, 83) + { + p.SetState(1381) + p.Match(MongoShellParserCOLLATION) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) NUMBER_INT() antlr.TerminalNode { - return s.GetToken(MongoShellParserNUMBER_INT, 0) -} + case MongoShellParserCOMMENT: + p.EnterOuterAlt(localctx, 84) + { + p.SetState(1382) + p.Match(MongoShellParserCOMMENT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) DOUBLE() antlr.TerminalNode { - return s.GetToken(MongoShellParserDOUBLE, 0) -} + case MongoShellParserEXPLAIN: + p.EnterOuterAlt(localctx, 85) + { + p.SetState(1383) + p.Match(MongoShellParserEXPLAIN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) DECIMAL128() antlr.TerminalNode { - return s.GetToken(MongoShellParserDECIMAL128, 0) -} + case MongoShellParserFOR_EACH: + p.EnterOuterAlt(localctx, 86) + { + p.SetState(1384) + p.Match(MongoShellParserFOR_EACH) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) NUMBER_DECIMAL() antlr.TerminalNode { - return s.GetToken(MongoShellParserNUMBER_DECIMAL, 0) -} + case MongoShellParserHAS_NEXT: + p.EnterOuterAlt(localctx, 87) + { + p.SetState(1385) + p.Match(MongoShellParserHAS_NEXT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) TIMESTAMP() antlr.TerminalNode { - return s.GetToken(MongoShellParserTIMESTAMP, 0) -} + case MongoShellParserHINT: + p.EnterOuterAlt(localctx, 88) + { + p.SetState(1386) + p.Match(MongoShellParserHINT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) REG_EXP() antlr.TerminalNode { - return s.GetToken(MongoShellParserREG_EXP, 0) -} + case MongoShellParserIS_CLOSED: + p.EnterOuterAlt(localctx, 89) + { + p.SetState(1387) + p.Match(MongoShellParserIS_CLOSED) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) GetRuleContext() antlr.RuleContext { - return s -} + case MongoShellParserIS_EXHAUSTED: + p.EnterOuterAlt(localctx, 90) + { + p.SetState(1388) + p.Match(MongoShellParserIS_EXHAUSTED) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { - return antlr.TreesStringTree(s, ruleNames, recog) -} + case MongoShellParserIT_COUNT: + p.EnterOuterAlt(localctx, 91) + { + p.SetState(1389) + p.Match(MongoShellParserIT_COUNT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) EnterRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterIdentifier(s) - } -} + case MongoShellParserMAP: + p.EnterOuterAlt(localctx, 92) + { + p.SetState(1390) + p.Match(MongoShellParserMAP) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) ExitRule(listener antlr.ParseTreeListener) { - if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitIdentifier(s) - } -} + case MongoShellParserMAX: + p.EnterOuterAlt(localctx, 93) + { + p.SetState(1391) + p.Match(MongoShellParserMAX) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (s *IdentifierContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { - switch t := visitor.(type) { - case MongoShellParserVisitor: - return t.VisitIdentifier(s) + case MongoShellParserMAX_AWAIT_TIME_MS: + p.EnterOuterAlt(localctx, 94) + { + p.SetState(1392) + p.Match(MongoShellParserMAX_AWAIT_TIME_MS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } - default: - return t.VisitChildren(s) - } -} + case MongoShellParserMAX_TIME_MS: + p.EnterOuterAlt(localctx, 95) + { + p.SetState(1393) + p.Match(MongoShellParserMAX_TIME_MS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } -func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { - localctx = NewIdentifierContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 82, MongoShellParserRULE_identifier) - p.SetState(448) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } + case MongoShellParserMIN: + p.EnterOuterAlt(localctx, 96) + { + p.SetState(1394) + p.Match(MongoShellParserMIN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } - switch p.GetTokenStream().LA(1) { - case MongoShellParserIDENTIFIER: - p.EnterOuterAlt(localctx, 1) + case MongoShellParserNEXT: + p.EnterOuterAlt(localctx, 97) { - p.SetState(407) - p.Match(MongoShellParserIDENTIFIER) + p.SetState(1395) + p.Match(MongoShellParserNEXT) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserDOLLAR: - p.EnterOuterAlt(localctx, 2) + case MongoShellParserNO_CURSOR_TIMEOUT: + p.EnterOuterAlt(localctx, 98) { - p.SetState(408) - p.Match(MongoShellParserDOLLAR) + p.SetState(1396) + p.Match(MongoShellParserNO_CURSOR_TIMEOUT) if p.HasError() { // Recognition error - abort rule goto errorExit } } + + case MongoShellParserOBJS_LEFT_IN_BATCH: + p.EnterOuterAlt(localctx, 99) { - p.SetState(409) - p.Match(MongoShellParserIDENTIFIER) + p.SetState(1397) + p.Match(MongoShellParserOBJS_LEFT_IN_BATCH) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserSHOW: - p.EnterOuterAlt(localctx, 3) + case MongoShellParserPRETTY: + p.EnterOuterAlt(localctx, 100) { - p.SetState(410) - p.Match(MongoShellParserSHOW) + p.SetState(1398) + p.Match(MongoShellParserPRETTY) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserDBS: - p.EnterOuterAlt(localctx, 4) + case MongoShellParserREAD_CONCERN: + p.EnterOuterAlt(localctx, 101) { - p.SetState(411) - p.Match(MongoShellParserDBS) + p.SetState(1399) + p.Match(MongoShellParserREAD_CONCERN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserDATABASES: - p.EnterOuterAlt(localctx, 5) + case MongoShellParserREAD_PREF: + p.EnterOuterAlt(localctx, 102) { - p.SetState(412) - p.Match(MongoShellParserDATABASES) + p.SetState(1400) + p.Match(MongoShellParserREAD_PREF) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserCOLLECTIONS: - p.EnterOuterAlt(localctx, 6) + case MongoShellParserRETURN_KEY: + p.EnterOuterAlt(localctx, 103) { - p.SetState(413) - p.Match(MongoShellParserCOLLECTIONS) + p.SetState(1401) + p.Match(MongoShellParserRETURN_KEY) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserDB: - p.EnterOuterAlt(localctx, 7) + case MongoShellParserSHOW_RECORD_ID: + p.EnterOuterAlt(localctx, 104) { - p.SetState(414) - p.Match(MongoShellParserDB) + p.SetState(1402) + p.Match(MongoShellParserSHOW_RECORD_ID) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserNEW: - p.EnterOuterAlt(localctx, 8) + case MongoShellParserSIZE: + p.EnterOuterAlt(localctx, 105) { - p.SetState(415) - p.Match(MongoShellParserNEW) + p.SetState(1403) + p.Match(MongoShellParserSIZE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserTRUE: - p.EnterOuterAlt(localctx, 9) + case MongoShellParserTAILABLE: + p.EnterOuterAlt(localctx, 106) { - p.SetState(416) - p.Match(MongoShellParserTRUE) + p.SetState(1404) + p.Match(MongoShellParserTAILABLE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserFALSE: - p.EnterOuterAlt(localctx, 10) + case MongoShellParserTO_ARRAY: + p.EnterOuterAlt(localctx, 107) { - p.SetState(417) - p.Match(MongoShellParserFALSE) + p.SetState(1405) + p.Match(MongoShellParserTO_ARRAY) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserNULL: - p.EnterOuterAlt(localctx, 11) + case MongoShellParserTRY_NEXT: + p.EnterOuterAlt(localctx, 108) { - p.SetState(418) - p.Match(MongoShellParserNULL) + p.SetState(1406) + p.Match(MongoShellParserTRY_NEXT) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserFIND: - p.EnterOuterAlt(localctx, 12) + case MongoShellParserALLOW_DISK_USE: + p.EnterOuterAlt(localctx, 109) { - p.SetState(419) - p.Match(MongoShellParserFIND) + p.SetState(1407) + p.Match(MongoShellParserALLOW_DISK_USE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserFIND_ONE: - p.EnterOuterAlt(localctx, 13) + case MongoShellParserADD_OPTION: + p.EnterOuterAlt(localctx, 110) { - p.SetState(420) - p.Match(MongoShellParserFIND_ONE) + p.SetState(1408) + p.Match(MongoShellParserADD_OPTION) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserCOUNT_DOCUMENTS: - p.EnterOuterAlt(localctx, 14) + case MongoShellParserINITIALIZE_ORDERED_BULK_OP: + p.EnterOuterAlt(localctx, 111) { - p.SetState(421) - p.Match(MongoShellParserCOUNT_DOCUMENTS) + p.SetState(1409) + p.Match(MongoShellParserINITIALIZE_ORDERED_BULK_OP) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserESTIMATED_DOCUMENT_COUNT: - p.EnterOuterAlt(localctx, 15) + case MongoShellParserINITIALIZE_UNORDERED_BULK_OP: + p.EnterOuterAlt(localctx, 112) { - p.SetState(422) - p.Match(MongoShellParserESTIMATED_DOCUMENT_COUNT) + p.SetState(1410) + p.Match(MongoShellParserINITIALIZE_UNORDERED_BULK_OP) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserDISTINCT: - p.EnterOuterAlt(localctx, 16) + case MongoShellParserEXECUTE: + p.EnterOuterAlt(localctx, 113) { - p.SetState(423) - p.Match(MongoShellParserDISTINCT) + p.SetState(1411) + p.Match(MongoShellParserEXECUTE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserAGGREGATE: - p.EnterOuterAlt(localctx, 17) + case MongoShellParserGET_OPERATIONS: + p.EnterOuterAlt(localctx, 114) { - p.SetState(424) - p.Match(MongoShellParserAGGREGATE) + p.SetState(1412) + p.Match(MongoShellParserGET_OPERATIONS) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserGET_INDEXES: - p.EnterOuterAlt(localctx, 18) + case MongoShellParserTO_STRING: + p.EnterOuterAlt(localctx, 115) { - p.SetState(425) - p.Match(MongoShellParserGET_INDEXES) + p.SetState(1413) + p.Match(MongoShellParserTO_STRING) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserSORT: - p.EnterOuterAlt(localctx, 19) + case MongoShellParserINSERT: + p.EnterOuterAlt(localctx, 116) { - p.SetState(426) - p.Match(MongoShellParserSORT) + p.SetState(1414) + p.Match(MongoShellParserINSERT) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserLIMIT: - p.EnterOuterAlt(localctx, 20) + case MongoShellParserREMOVE: + p.EnterOuterAlt(localctx, 117) { - p.SetState(427) - p.Match(MongoShellParserLIMIT) + p.SetState(1415) + p.Match(MongoShellParserREMOVE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserSKIP_: - p.EnterOuterAlt(localctx, 21) + case MongoShellParserMONGO: + p.EnterOuterAlt(localctx, 118) { - p.SetState(428) - p.Match(MongoShellParserSKIP_) + p.SetState(1416) + p.Match(MongoShellParserMONGO) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserCOUNT: - p.EnterOuterAlt(localctx, 22) + case MongoShellParserCONNECT: + p.EnterOuterAlt(localctx, 119) { - p.SetState(429) - p.Match(MongoShellParserCOUNT) + p.SetState(1417) + p.Match(MongoShellParserCONNECT) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserPROJECTION: - p.EnterOuterAlt(localctx, 23) + case MongoShellParserGET_DB: + p.EnterOuterAlt(localctx, 120) { - p.SetState(430) - p.Match(MongoShellParserPROJECTION) + p.SetState(1418) + p.Match(MongoShellParserGET_DB) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserPROJECT: - p.EnterOuterAlt(localctx, 24) + case MongoShellParserGET_READ_CONCERN: + p.EnterOuterAlt(localctx, 121) { - p.SetState(431) - p.Match(MongoShellParserPROJECT) + p.SetState(1419) + p.Match(MongoShellParserGET_READ_CONCERN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserGET_COLLECTION: - p.EnterOuterAlt(localctx, 25) + case MongoShellParserGET_READ_PREF: + p.EnterOuterAlt(localctx, 122) { - p.SetState(432) - p.Match(MongoShellParserGET_COLLECTION) + p.SetState(1420) + p.Match(MongoShellParserGET_READ_PREF) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserGET_COLLECTION_NAMES: - p.EnterOuterAlt(localctx, 26) + case MongoShellParserGET_READ_PREF_MODE: + p.EnterOuterAlt(localctx, 123) { - p.SetState(433) - p.Match(MongoShellParserGET_COLLECTION_NAMES) + p.SetState(1421) + p.Match(MongoShellParserGET_READ_PREF_MODE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserGET_COLLECTION_INFOS: - p.EnterOuterAlt(localctx, 27) + case MongoShellParserGET_READ_PREF_TAG_SET: + p.EnterOuterAlt(localctx, 124) { - p.SetState(434) - p.Match(MongoShellParserGET_COLLECTION_INFOS) + p.SetState(1422) + p.Match(MongoShellParserGET_READ_PREF_TAG_SET) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserOBJECT_ID: - p.EnterOuterAlt(localctx, 28) + case MongoShellParserGET_WRITE_CONCERN: + p.EnterOuterAlt(localctx, 125) { - p.SetState(435) - p.Match(MongoShellParserOBJECT_ID) + p.SetState(1423) + p.Match(MongoShellParserGET_WRITE_CONCERN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserISO_DATE: - p.EnterOuterAlt(localctx, 29) + case MongoShellParserSET_READ_PREF: + p.EnterOuterAlt(localctx, 126) { - p.SetState(436) - p.Match(MongoShellParserISO_DATE) + p.SetState(1424) + p.Match(MongoShellParserSET_READ_PREF) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserDATE: - p.EnterOuterAlt(localctx, 30) + case MongoShellParserSET_READ_CONCERN: + p.EnterOuterAlt(localctx, 127) { - p.SetState(437) - p.Match(MongoShellParserDATE) + p.SetState(1425) + p.Match(MongoShellParserSET_READ_CONCERN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserUUID: - p.EnterOuterAlt(localctx, 31) + case MongoShellParserSET_WRITE_CONCERN: + p.EnterOuterAlt(localctx, 128) { - p.SetState(438) - p.Match(MongoShellParserUUID) + p.SetState(1426) + p.Match(MongoShellParserSET_WRITE_CONCERN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserLONG: - p.EnterOuterAlt(localctx, 32) + case MongoShellParserSTART_SESSION: + p.EnterOuterAlt(localctx, 129) { - p.SetState(439) - p.Match(MongoShellParserLONG) + p.SetState(1427) + p.Match(MongoShellParserSTART_SESSION) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserNUMBER_LONG: - p.EnterOuterAlt(localctx, 33) + case MongoShellParserWATCH: + p.EnterOuterAlt(localctx, 130) { - p.SetState(440) - p.Match(MongoShellParserNUMBER_LONG) + p.SetState(1428) + p.Match(MongoShellParserWATCH) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserINT32: - p.EnterOuterAlt(localctx, 34) + case MongoShellParserGET_DB_NAMES: + p.EnterOuterAlt(localctx, 131) { - p.SetState(441) - p.Match(MongoShellParserINT32) + p.SetState(1429) + p.Match(MongoShellParserGET_DB_NAMES) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserNUMBER_INT: - p.EnterOuterAlt(localctx, 35) + case MongoShellParserRS: + p.EnterOuterAlt(localctx, 132) { - p.SetState(442) - p.Match(MongoShellParserNUMBER_INT) + p.SetState(1430) + p.Match(MongoShellParserRS) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserDOUBLE: - p.EnterOuterAlt(localctx, 36) + case MongoShellParserSH: + p.EnterOuterAlt(localctx, 133) { - p.SetState(443) - p.Match(MongoShellParserDOUBLE) + p.SetState(1431) + p.Match(MongoShellParserSH) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserDECIMAL128: - p.EnterOuterAlt(localctx, 37) + case MongoShellParserSP: + p.EnterOuterAlt(localctx, 134) { - p.SetState(444) - p.Match(MongoShellParserDECIMAL128) + p.SetState(1432) + p.Match(MongoShellParserSP) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserNUMBER_DECIMAL: - p.EnterOuterAlt(localctx, 38) + case MongoShellParserGET_KEY_VAULT: + p.EnterOuterAlt(localctx, 135) { - p.SetState(445) - p.Match(MongoShellParserNUMBER_DECIMAL) + p.SetState(1433) + p.Match(MongoShellParserGET_KEY_VAULT) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserTIMESTAMP: - p.EnterOuterAlt(localctx, 39) + case MongoShellParserGET_CLIENT_ENCRYPTION: + p.EnterOuterAlt(localctx, 136) { - p.SetState(446) - p.Match(MongoShellParserTIMESTAMP) + p.SetState(1434) + p.Match(MongoShellParserGET_CLIENT_ENCRYPTION) if p.HasError() { // Recognition error - abort rule goto errorExit } } - case MongoShellParserREG_EXP: - p.EnterOuterAlt(localctx, 40) + case MongoShellParserGET_PLAN_CACHE: + p.EnterOuterAlt(localctx, 137) { - p.SetState(447) - p.Match(MongoShellParserREG_EXP) + p.SetState(1435) + p.Match(MongoShellParserGET_PLAN_CACHE) if p.HasError() { // Recognition error - abort rule goto errorExit diff --git a/mongodb/mongoshellparser_base_listener.go b/mongodb/mongoshellparser_base_listener.go index 772b5e8..a3c76b5 100644 --- a/mongodb/mongoshellparser_base_listener.go +++ b/mongodb/mongoshellparser_base_listener.go @@ -56,12 +56,322 @@ func (s *BaseMongoShellParserListener) EnterGetCollectionInfos(ctx *GetCollectio // ExitGetCollectionInfos is called when production getCollectionInfos is exited. func (s *BaseMongoShellParserListener) ExitGetCollectionInfos(ctx *GetCollectionInfosContext) {} +// EnterCreateCollection is called when production createCollection is entered. +func (s *BaseMongoShellParserListener) EnterCreateCollection(ctx *CreateCollectionContext) {} + +// ExitCreateCollection is called when production createCollection is exited. +func (s *BaseMongoShellParserListener) ExitCreateCollection(ctx *CreateCollectionContext) {} + +// EnterDropDatabase is called when production dropDatabase is entered. +func (s *BaseMongoShellParserListener) EnterDropDatabase(ctx *DropDatabaseContext) {} + +// ExitDropDatabase is called when production dropDatabase is exited. +func (s *BaseMongoShellParserListener) ExitDropDatabase(ctx *DropDatabaseContext) {} + +// EnterDbStats is called when production dbStats is entered. +func (s *BaseMongoShellParserListener) EnterDbStats(ctx *DbStatsContext) {} + +// ExitDbStats is called when production dbStats is exited. +func (s *BaseMongoShellParserListener) ExitDbStats(ctx *DbStatsContext) {} + +// EnterServerStatus is called when production serverStatus is entered. +func (s *BaseMongoShellParserListener) EnterServerStatus(ctx *ServerStatusContext) {} + +// ExitServerStatus is called when production serverStatus is exited. +func (s *BaseMongoShellParserListener) ExitServerStatus(ctx *ServerStatusContext) {} + +// EnterServerBuildInfo is called when production serverBuildInfo is entered. +func (s *BaseMongoShellParserListener) EnterServerBuildInfo(ctx *ServerBuildInfoContext) {} + +// ExitServerBuildInfo is called when production serverBuildInfo is exited. +func (s *BaseMongoShellParserListener) ExitServerBuildInfo(ctx *ServerBuildInfoContext) {} + +// EnterDbVersion is called when production dbVersion is entered. +func (s *BaseMongoShellParserListener) EnterDbVersion(ctx *DbVersionContext) {} + +// ExitDbVersion is called when production dbVersion is exited. +func (s *BaseMongoShellParserListener) ExitDbVersion(ctx *DbVersionContext) {} + +// EnterHostInfo is called when production hostInfo is entered. +func (s *BaseMongoShellParserListener) EnterHostInfo(ctx *HostInfoContext) {} + +// ExitHostInfo is called when production hostInfo is exited. +func (s *BaseMongoShellParserListener) ExitHostInfo(ctx *HostInfoContext) {} + +// EnterListCommands is called when production listCommands is entered. +func (s *BaseMongoShellParserListener) EnterListCommands(ctx *ListCommandsContext) {} + +// ExitListCommands is called when production listCommands is exited. +func (s *BaseMongoShellParserListener) ExitListCommands(ctx *ListCommandsContext) {} + +// EnterRunCommand is called when production runCommand is entered. +func (s *BaseMongoShellParserListener) EnterRunCommand(ctx *RunCommandContext) {} + +// ExitRunCommand is called when production runCommand is exited. +func (s *BaseMongoShellParserListener) ExitRunCommand(ctx *RunCommandContext) {} + +// EnterAdminCommand is called when production adminCommand is entered. +func (s *BaseMongoShellParserListener) EnterAdminCommand(ctx *AdminCommandContext) {} + +// ExitAdminCommand is called when production adminCommand is exited. +func (s *BaseMongoShellParserListener) ExitAdminCommand(ctx *AdminCommandContext) {} + +// EnterGetName is called when production getName is entered. +func (s *BaseMongoShellParserListener) EnterGetName(ctx *GetNameContext) {} + +// ExitGetName is called when production getName is exited. +func (s *BaseMongoShellParserListener) ExitGetName(ctx *GetNameContext) {} + +// EnterGetMongo is called when production getMongo is entered. +func (s *BaseMongoShellParserListener) EnterGetMongo(ctx *GetMongoContext) {} + +// ExitGetMongo is called when production getMongo is exited. +func (s *BaseMongoShellParserListener) ExitGetMongo(ctx *GetMongoContext) {} + +// EnterGetSiblingDB is called when production getSiblingDB is entered. +func (s *BaseMongoShellParserListener) EnterGetSiblingDB(ctx *GetSiblingDBContext) {} + +// ExitGetSiblingDB is called when production getSiblingDB is exited. +func (s *BaseMongoShellParserListener) ExitGetSiblingDB(ctx *GetSiblingDBContext) {} + +// EnterDbGenericMethod is called when production dbGenericMethod is entered. +func (s *BaseMongoShellParserListener) EnterDbGenericMethod(ctx *DbGenericMethodContext) {} + +// ExitDbGenericMethod is called when production dbGenericMethod is exited. +func (s *BaseMongoShellParserListener) ExitDbGenericMethod(ctx *DbGenericMethodContext) {} + // EnterCollectionOperation is called when production collectionOperation is entered. func (s *BaseMongoShellParserListener) EnterCollectionOperation(ctx *CollectionOperationContext) {} // ExitCollectionOperation is called when production collectionOperation is exited. func (s *BaseMongoShellParserListener) ExitCollectionOperation(ctx *CollectionOperationContext) {} +// EnterGenericDbMethod is called when production genericDbMethod is entered. +func (s *BaseMongoShellParserListener) EnterGenericDbMethod(ctx *GenericDbMethodContext) {} + +// ExitGenericDbMethod is called when production genericDbMethod is exited. +func (s *BaseMongoShellParserListener) ExitGenericDbMethod(ctx *GenericDbMethodContext) {} + +// EnterBulkStatement is called when production bulkStatement is entered. +func (s *BaseMongoShellParserListener) EnterBulkStatement(ctx *BulkStatementContext) {} + +// ExitBulkStatement is called when production bulkStatement is exited. +func (s *BaseMongoShellParserListener) ExitBulkStatement(ctx *BulkStatementContext) {} + +// EnterBulkInitMethod is called when production bulkInitMethod is entered. +func (s *BaseMongoShellParserListener) EnterBulkInitMethod(ctx *BulkInitMethodContext) {} + +// ExitBulkInitMethod is called when production bulkInitMethod is exited. +func (s *BaseMongoShellParserListener) ExitBulkInitMethod(ctx *BulkInitMethodContext) {} + +// EnterBulkMethodChain is called when production bulkMethodChain is entered. +func (s *BaseMongoShellParserListener) EnterBulkMethodChain(ctx *BulkMethodChainContext) {} + +// ExitBulkMethodChain is called when production bulkMethodChain is exited. +func (s *BaseMongoShellParserListener) ExitBulkMethodChain(ctx *BulkMethodChainContext) {} + +// EnterBulkFind is called when production bulkFind is entered. +func (s *BaseMongoShellParserListener) EnterBulkFind(ctx *BulkFindContext) {} + +// ExitBulkFind is called when production bulkFind is exited. +func (s *BaseMongoShellParserListener) ExitBulkFind(ctx *BulkFindContext) {} + +// EnterBulkInsert is called when production bulkInsert is entered. +func (s *BaseMongoShellParserListener) EnterBulkInsert(ctx *BulkInsertContext) {} + +// ExitBulkInsert is called when production bulkInsert is exited. +func (s *BaseMongoShellParserListener) ExitBulkInsert(ctx *BulkInsertContext) {} + +// EnterBulkRemove is called when production bulkRemove is entered. +func (s *BaseMongoShellParserListener) EnterBulkRemove(ctx *BulkRemoveContext) {} + +// ExitBulkRemove is called when production bulkRemove is exited. +func (s *BaseMongoShellParserListener) ExitBulkRemove(ctx *BulkRemoveContext) {} + +// EnterBulkExecute is called when production bulkExecute is entered. +func (s *BaseMongoShellParserListener) EnterBulkExecute(ctx *BulkExecuteContext) {} + +// ExitBulkExecute is called when production bulkExecute is exited. +func (s *BaseMongoShellParserListener) ExitBulkExecute(ctx *BulkExecuteContext) {} + +// EnterBulkGetOperations is called when production bulkGetOperations is entered. +func (s *BaseMongoShellParserListener) EnterBulkGetOperations(ctx *BulkGetOperationsContext) {} + +// ExitBulkGetOperations is called when production bulkGetOperations is exited. +func (s *BaseMongoShellParserListener) ExitBulkGetOperations(ctx *BulkGetOperationsContext) {} + +// EnterBulkToString is called when production bulkToString is entered. +func (s *BaseMongoShellParserListener) EnterBulkToString(ctx *BulkToStringContext) {} + +// ExitBulkToString is called when production bulkToString is exited. +func (s *BaseMongoShellParserListener) ExitBulkToString(ctx *BulkToStringContext) {} + +// EnterBulkGenericMethod is called when production bulkGenericMethod is entered. +func (s *BaseMongoShellParserListener) EnterBulkGenericMethod(ctx *BulkGenericMethodContext) {} + +// ExitBulkGenericMethod is called when production bulkGenericMethod is exited. +func (s *BaseMongoShellParserListener) ExitBulkGenericMethod(ctx *BulkGenericMethodContext) {} + +// EnterMongoConnection is called when production mongoConnection is entered. +func (s *BaseMongoShellParserListener) EnterMongoConnection(ctx *MongoConnectionContext) {} + +// ExitMongoConnection is called when production mongoConnection is exited. +func (s *BaseMongoShellParserListener) ExitMongoConnection(ctx *MongoConnectionContext) {} + +// EnterConnectCall is called when production connectCall is entered. +func (s *BaseMongoShellParserListener) EnterConnectCall(ctx *ConnectCallContext) {} + +// ExitConnectCall is called when production connectCall is exited. +func (s *BaseMongoShellParserListener) ExitConnectCall(ctx *ConnectCallContext) {} + +// EnterDbGetMongoChain is called when production dbGetMongoChain is entered. +func (s *BaseMongoShellParserListener) EnterDbGetMongoChain(ctx *DbGetMongoChainContext) {} + +// ExitDbGetMongoChain is called when production dbGetMongoChain is exited. +func (s *BaseMongoShellParserListener) ExitDbGetMongoChain(ctx *DbGetMongoChainContext) {} + +// EnterConnectionMethodChain is called when production connectionMethodChain is entered. +func (s *BaseMongoShellParserListener) EnterConnectionMethodChain(ctx *ConnectionMethodChainContext) { +} + +// ExitConnectionMethodChain is called when production connectionMethodChain is exited. +func (s *BaseMongoShellParserListener) ExitConnectionMethodChain(ctx *ConnectionMethodChainContext) {} + +// EnterRsStatement is called when production rsStatement is entered. +func (s *BaseMongoShellParserListener) EnterRsStatement(ctx *RsStatementContext) {} + +// ExitRsStatement is called when production rsStatement is exited. +func (s *BaseMongoShellParserListener) ExitRsStatement(ctx *RsStatementContext) {} + +// EnterShStatement is called when production shStatement is entered. +func (s *BaseMongoShellParserListener) EnterShStatement(ctx *ShStatementContext) {} + +// ExitShStatement is called when production shStatement is exited. +func (s *BaseMongoShellParserListener) ExitShStatement(ctx *ShStatementContext) {} + +// EnterKeyVaultStatement is called when production keyVaultStatement is entered. +func (s *BaseMongoShellParserListener) EnterKeyVaultStatement(ctx *KeyVaultStatementContext) {} + +// ExitKeyVaultStatement is called when production keyVaultStatement is exited. +func (s *BaseMongoShellParserListener) ExitKeyVaultStatement(ctx *KeyVaultStatementContext) {} + +// EnterClientEncryptionStatement is called when production clientEncryptionStatement is entered. +func (s *BaseMongoShellParserListener) EnterClientEncryptionStatement(ctx *ClientEncryptionStatementContext) { +} + +// ExitClientEncryptionStatement is called when production clientEncryptionStatement is exited. +func (s *BaseMongoShellParserListener) ExitClientEncryptionStatement(ctx *ClientEncryptionStatementContext) { +} + +// EnterPlanCacheStatement is called when production planCacheStatement is entered. +func (s *BaseMongoShellParserListener) EnterPlanCacheStatement(ctx *PlanCacheStatementContext) {} + +// ExitPlanCacheStatement is called when production planCacheStatement is exited. +func (s *BaseMongoShellParserListener) ExitPlanCacheStatement(ctx *PlanCacheStatementContext) {} + +// EnterSpStatement is called when production spStatement is entered. +func (s *BaseMongoShellParserListener) EnterSpStatement(ctx *SpStatementContext) {} + +// ExitSpStatement is called when production spStatement is exited. +func (s *BaseMongoShellParserListener) ExitSpStatement(ctx *SpStatementContext) {} + +// EnterNativeFunctionCall is called when production nativeFunctionCall is entered. +func (s *BaseMongoShellParserListener) EnterNativeFunctionCall(ctx *NativeFunctionCallContext) {} + +// ExitNativeFunctionCall is called when production nativeFunctionCall is exited. +func (s *BaseMongoShellParserListener) ExitNativeFunctionCall(ctx *NativeFunctionCallContext) {} + +// EnterConnGetDB is called when production connGetDB is entered. +func (s *BaseMongoShellParserListener) EnterConnGetDB(ctx *ConnGetDBContext) {} + +// ExitConnGetDB is called when production connGetDB is exited. +func (s *BaseMongoShellParserListener) ExitConnGetDB(ctx *ConnGetDBContext) {} + +// EnterConnGetReadConcern is called when production connGetReadConcern is entered. +func (s *BaseMongoShellParserListener) EnterConnGetReadConcern(ctx *ConnGetReadConcernContext) {} + +// ExitConnGetReadConcern is called when production connGetReadConcern is exited. +func (s *BaseMongoShellParserListener) ExitConnGetReadConcern(ctx *ConnGetReadConcernContext) {} + +// EnterConnGetReadPref is called when production connGetReadPref is entered. +func (s *BaseMongoShellParserListener) EnterConnGetReadPref(ctx *ConnGetReadPrefContext) {} + +// ExitConnGetReadPref is called when production connGetReadPref is exited. +func (s *BaseMongoShellParserListener) ExitConnGetReadPref(ctx *ConnGetReadPrefContext) {} + +// EnterConnGetReadPrefMode is called when production connGetReadPrefMode is entered. +func (s *BaseMongoShellParserListener) EnterConnGetReadPrefMode(ctx *ConnGetReadPrefModeContext) {} + +// ExitConnGetReadPrefMode is called when production connGetReadPrefMode is exited. +func (s *BaseMongoShellParserListener) ExitConnGetReadPrefMode(ctx *ConnGetReadPrefModeContext) {} + +// EnterConnGetReadPrefTagSet is called when production connGetReadPrefTagSet is entered. +func (s *BaseMongoShellParserListener) EnterConnGetReadPrefTagSet(ctx *ConnGetReadPrefTagSetContext) { +} + +// ExitConnGetReadPrefTagSet is called when production connGetReadPrefTagSet is exited. +func (s *BaseMongoShellParserListener) ExitConnGetReadPrefTagSet(ctx *ConnGetReadPrefTagSetContext) {} + +// EnterConnGetWriteConcern is called when production connGetWriteConcern is entered. +func (s *BaseMongoShellParserListener) EnterConnGetWriteConcern(ctx *ConnGetWriteConcernContext) {} + +// ExitConnGetWriteConcern is called when production connGetWriteConcern is exited. +func (s *BaseMongoShellParserListener) ExitConnGetWriteConcern(ctx *ConnGetWriteConcernContext) {} + +// EnterConnSetReadPref is called when production connSetReadPref is entered. +func (s *BaseMongoShellParserListener) EnterConnSetReadPref(ctx *ConnSetReadPrefContext) {} + +// ExitConnSetReadPref is called when production connSetReadPref is exited. +func (s *BaseMongoShellParserListener) ExitConnSetReadPref(ctx *ConnSetReadPrefContext) {} + +// EnterConnSetReadConcern is called when production connSetReadConcern is entered. +func (s *BaseMongoShellParserListener) EnterConnSetReadConcern(ctx *ConnSetReadConcernContext) {} + +// ExitConnSetReadConcern is called when production connSetReadConcern is exited. +func (s *BaseMongoShellParserListener) ExitConnSetReadConcern(ctx *ConnSetReadConcernContext) {} + +// EnterConnSetWriteConcern is called when production connSetWriteConcern is entered. +func (s *BaseMongoShellParserListener) EnterConnSetWriteConcern(ctx *ConnSetWriteConcernContext) {} + +// ExitConnSetWriteConcern is called when production connSetWriteConcern is exited. +func (s *BaseMongoShellParserListener) ExitConnSetWriteConcern(ctx *ConnSetWriteConcernContext) {} + +// EnterConnStartSession is called when production connStartSession is entered. +func (s *BaseMongoShellParserListener) EnterConnStartSession(ctx *ConnStartSessionContext) {} + +// ExitConnStartSession is called when production connStartSession is exited. +func (s *BaseMongoShellParserListener) ExitConnStartSession(ctx *ConnStartSessionContext) {} + +// EnterConnWatch is called when production connWatch is entered. +func (s *BaseMongoShellParserListener) EnterConnWatch(ctx *ConnWatchContext) {} + +// ExitConnWatch is called when production connWatch is exited. +func (s *BaseMongoShellParserListener) ExitConnWatch(ctx *ConnWatchContext) {} + +// EnterConnClose is called when production connClose is entered. +func (s *BaseMongoShellParserListener) EnterConnClose(ctx *ConnCloseContext) {} + +// ExitConnClose is called when production connClose is exited. +func (s *BaseMongoShellParserListener) ExitConnClose(ctx *ConnCloseContext) {} + +// EnterConnAdminCommand is called when production connAdminCommand is entered. +func (s *BaseMongoShellParserListener) EnterConnAdminCommand(ctx *ConnAdminCommandContext) {} + +// ExitConnAdminCommand is called when production connAdminCommand is exited. +func (s *BaseMongoShellParserListener) ExitConnAdminCommand(ctx *ConnAdminCommandContext) {} + +// EnterConnGetDBNames is called when production connGetDBNames is entered. +func (s *BaseMongoShellParserListener) EnterConnGetDBNames(ctx *ConnGetDBNamesContext) {} + +// ExitConnGetDBNames is called when production connGetDBNames is exited. +func (s *BaseMongoShellParserListener) ExitConnGetDBNames(ctx *ConnGetDBNamesContext) {} + +// EnterConnGenericMethod is called when production connGenericMethod is entered. +func (s *BaseMongoShellParserListener) EnterConnGenericMethod(ctx *ConnGenericMethodContext) {} + +// ExitConnGenericMethod is called when production connGenericMethod is exited. +func (s *BaseMongoShellParserListener) ExitConnGenericMethod(ctx *ConnGenericMethodContext) {} + // EnterDotAccess is called when production dotAccess is entered. func (s *BaseMongoShellParserListener) EnterDotAccess(ctx *DotAccessContext) {} @@ -136,6 +446,158 @@ func (s *BaseMongoShellParserListener) EnterGetIndexesMethod(ctx *GetIndexesMeth // ExitGetIndexesMethod is called when production getIndexesMethod is exited. func (s *BaseMongoShellParserListener) ExitGetIndexesMethod(ctx *GetIndexesMethodContext) {} +// EnterInsertOneMethod is called when production insertOneMethod is entered. +func (s *BaseMongoShellParserListener) EnterInsertOneMethod(ctx *InsertOneMethodContext) {} + +// ExitInsertOneMethod is called when production insertOneMethod is exited. +func (s *BaseMongoShellParserListener) ExitInsertOneMethod(ctx *InsertOneMethodContext) {} + +// EnterInsertManyMethod is called when production insertManyMethod is entered. +func (s *BaseMongoShellParserListener) EnterInsertManyMethod(ctx *InsertManyMethodContext) {} + +// ExitInsertManyMethod is called when production insertManyMethod is exited. +func (s *BaseMongoShellParserListener) ExitInsertManyMethod(ctx *InsertManyMethodContext) {} + +// EnterUpdateOneMethod is called when production updateOneMethod is entered. +func (s *BaseMongoShellParserListener) EnterUpdateOneMethod(ctx *UpdateOneMethodContext) {} + +// ExitUpdateOneMethod is called when production updateOneMethod is exited. +func (s *BaseMongoShellParserListener) ExitUpdateOneMethod(ctx *UpdateOneMethodContext) {} + +// EnterUpdateManyMethod is called when production updateManyMethod is entered. +func (s *BaseMongoShellParserListener) EnterUpdateManyMethod(ctx *UpdateManyMethodContext) {} + +// ExitUpdateManyMethod is called when production updateManyMethod is exited. +func (s *BaseMongoShellParserListener) ExitUpdateManyMethod(ctx *UpdateManyMethodContext) {} + +// EnterDeleteOneMethod is called when production deleteOneMethod is entered. +func (s *BaseMongoShellParserListener) EnterDeleteOneMethod(ctx *DeleteOneMethodContext) {} + +// ExitDeleteOneMethod is called when production deleteOneMethod is exited. +func (s *BaseMongoShellParserListener) ExitDeleteOneMethod(ctx *DeleteOneMethodContext) {} + +// EnterDeleteManyMethod is called when production deleteManyMethod is entered. +func (s *BaseMongoShellParserListener) EnterDeleteManyMethod(ctx *DeleteManyMethodContext) {} + +// ExitDeleteManyMethod is called when production deleteManyMethod is exited. +func (s *BaseMongoShellParserListener) ExitDeleteManyMethod(ctx *DeleteManyMethodContext) {} + +// EnterReplaceOneMethod is called when production replaceOneMethod is entered. +func (s *BaseMongoShellParserListener) EnterReplaceOneMethod(ctx *ReplaceOneMethodContext) {} + +// ExitReplaceOneMethod is called when production replaceOneMethod is exited. +func (s *BaseMongoShellParserListener) ExitReplaceOneMethod(ctx *ReplaceOneMethodContext) {} + +// EnterFindOneAndUpdateMethod is called when production findOneAndUpdateMethod is entered. +func (s *BaseMongoShellParserListener) EnterFindOneAndUpdateMethod(ctx *FindOneAndUpdateMethodContext) { +} + +// ExitFindOneAndUpdateMethod is called when production findOneAndUpdateMethod is exited. +func (s *BaseMongoShellParserListener) ExitFindOneAndUpdateMethod(ctx *FindOneAndUpdateMethodContext) { +} + +// EnterFindOneAndReplaceMethod is called when production findOneAndReplaceMethod is entered. +func (s *BaseMongoShellParserListener) EnterFindOneAndReplaceMethod(ctx *FindOneAndReplaceMethodContext) { +} + +// ExitFindOneAndReplaceMethod is called when production findOneAndReplaceMethod is exited. +func (s *BaseMongoShellParserListener) ExitFindOneAndReplaceMethod(ctx *FindOneAndReplaceMethodContext) { +} + +// EnterFindOneAndDeleteMethod is called when production findOneAndDeleteMethod is entered. +func (s *BaseMongoShellParserListener) EnterFindOneAndDeleteMethod(ctx *FindOneAndDeleteMethodContext) { +} + +// ExitFindOneAndDeleteMethod is called when production findOneAndDeleteMethod is exited. +func (s *BaseMongoShellParserListener) ExitFindOneAndDeleteMethod(ctx *FindOneAndDeleteMethodContext) { +} + +// EnterCreateIndexMethod is called when production createIndexMethod is entered. +func (s *BaseMongoShellParserListener) EnterCreateIndexMethod(ctx *CreateIndexMethodContext) {} + +// ExitCreateIndexMethod is called when production createIndexMethod is exited. +func (s *BaseMongoShellParserListener) ExitCreateIndexMethod(ctx *CreateIndexMethodContext) {} + +// EnterCreateIndexesMethod is called when production createIndexesMethod is entered. +func (s *BaseMongoShellParserListener) EnterCreateIndexesMethod(ctx *CreateIndexesMethodContext) {} + +// ExitCreateIndexesMethod is called when production createIndexesMethod is exited. +func (s *BaseMongoShellParserListener) ExitCreateIndexesMethod(ctx *CreateIndexesMethodContext) {} + +// EnterDropIndexMethod is called when production dropIndexMethod is entered. +func (s *BaseMongoShellParserListener) EnterDropIndexMethod(ctx *DropIndexMethodContext) {} + +// ExitDropIndexMethod is called when production dropIndexMethod is exited. +func (s *BaseMongoShellParserListener) ExitDropIndexMethod(ctx *DropIndexMethodContext) {} + +// EnterDropIndexesMethod is called when production dropIndexesMethod is entered. +func (s *BaseMongoShellParserListener) EnterDropIndexesMethod(ctx *DropIndexesMethodContext) {} + +// ExitDropIndexesMethod is called when production dropIndexesMethod is exited. +func (s *BaseMongoShellParserListener) ExitDropIndexesMethod(ctx *DropIndexesMethodContext) {} + +// EnterDropMethod is called when production dropMethod is entered. +func (s *BaseMongoShellParserListener) EnterDropMethod(ctx *DropMethodContext) {} + +// ExitDropMethod is called when production dropMethod is exited. +func (s *BaseMongoShellParserListener) ExitDropMethod(ctx *DropMethodContext) {} + +// EnterRenameCollectionMethod is called when production renameCollectionMethod is entered. +func (s *BaseMongoShellParserListener) EnterRenameCollectionMethod(ctx *RenameCollectionMethodContext) { +} + +// ExitRenameCollectionMethod is called when production renameCollectionMethod is exited. +func (s *BaseMongoShellParserListener) ExitRenameCollectionMethod(ctx *RenameCollectionMethodContext) { +} + +// EnterStatsMethod is called when production statsMethod is entered. +func (s *BaseMongoShellParserListener) EnterStatsMethod(ctx *StatsMethodContext) {} + +// ExitStatsMethod is called when production statsMethod is exited. +func (s *BaseMongoShellParserListener) ExitStatsMethod(ctx *StatsMethodContext) {} + +// EnterStorageSizeMethod is called when production storageSizeMethod is entered. +func (s *BaseMongoShellParserListener) EnterStorageSizeMethod(ctx *StorageSizeMethodContext) {} + +// ExitStorageSizeMethod is called when production storageSizeMethod is exited. +func (s *BaseMongoShellParserListener) ExitStorageSizeMethod(ctx *StorageSizeMethodContext) {} + +// EnterTotalIndexSizeMethod is called when production totalIndexSizeMethod is entered. +func (s *BaseMongoShellParserListener) EnterTotalIndexSizeMethod(ctx *TotalIndexSizeMethodContext) {} + +// ExitTotalIndexSizeMethod is called when production totalIndexSizeMethod is exited. +func (s *BaseMongoShellParserListener) ExitTotalIndexSizeMethod(ctx *TotalIndexSizeMethodContext) {} + +// EnterTotalSizeMethod is called when production totalSizeMethod is entered. +func (s *BaseMongoShellParserListener) EnterTotalSizeMethod(ctx *TotalSizeMethodContext) {} + +// ExitTotalSizeMethod is called when production totalSizeMethod is exited. +func (s *BaseMongoShellParserListener) ExitTotalSizeMethod(ctx *TotalSizeMethodContext) {} + +// EnterDataSizeMethod is called when production dataSizeMethod is entered. +func (s *BaseMongoShellParserListener) EnterDataSizeMethod(ctx *DataSizeMethodContext) {} + +// ExitDataSizeMethod is called when production dataSizeMethod is exited. +func (s *BaseMongoShellParserListener) ExitDataSizeMethod(ctx *DataSizeMethodContext) {} + +// EnterIsCappedMethod is called when production isCappedMethod is entered. +func (s *BaseMongoShellParserListener) EnterIsCappedMethod(ctx *IsCappedMethodContext) {} + +// ExitIsCappedMethod is called when production isCappedMethod is exited. +func (s *BaseMongoShellParserListener) ExitIsCappedMethod(ctx *IsCappedMethodContext) {} + +// EnterValidateMethod is called when production validateMethod is entered. +func (s *BaseMongoShellParserListener) EnterValidateMethod(ctx *ValidateMethodContext) {} + +// ExitValidateMethod is called when production validateMethod is exited. +func (s *BaseMongoShellParserListener) ExitValidateMethod(ctx *ValidateMethodContext) {} + +// EnterLatencyStatsMethod is called when production latencyStatsMethod is entered. +func (s *BaseMongoShellParserListener) EnterLatencyStatsMethod(ctx *LatencyStatsMethodContext) {} + +// ExitLatencyStatsMethod is called when production latencyStatsMethod is exited. +func (s *BaseMongoShellParserListener) ExitLatencyStatsMethod(ctx *LatencyStatsMethodContext) {} + // EnterSortMethod is called when production sortMethod is entered. func (s *BaseMongoShellParserListener) EnterSortMethod(ctx *SortMethodContext) {} @@ -166,6 +628,188 @@ func (s *BaseMongoShellParserListener) EnterProjectionMethod(ctx *ProjectionMeth // ExitProjectionMethod is called when production projectionMethod is exited. func (s *BaseMongoShellParserListener) ExitProjectionMethod(ctx *ProjectionMethodContext) {} +// EnterBatchSizeMethod is called when production batchSizeMethod is entered. +func (s *BaseMongoShellParserListener) EnterBatchSizeMethod(ctx *BatchSizeMethodContext) {} + +// ExitBatchSizeMethod is called when production batchSizeMethod is exited. +func (s *BaseMongoShellParserListener) ExitBatchSizeMethod(ctx *BatchSizeMethodContext) {} + +// EnterCloseMethod is called when production closeMethod is entered. +func (s *BaseMongoShellParserListener) EnterCloseMethod(ctx *CloseMethodContext) {} + +// ExitCloseMethod is called when production closeMethod is exited. +func (s *BaseMongoShellParserListener) ExitCloseMethod(ctx *CloseMethodContext) {} + +// EnterCollationMethod is called when production collationMethod is entered. +func (s *BaseMongoShellParserListener) EnterCollationMethod(ctx *CollationMethodContext) {} + +// ExitCollationMethod is called when production collationMethod is exited. +func (s *BaseMongoShellParserListener) ExitCollationMethod(ctx *CollationMethodContext) {} + +// EnterCommentMethod is called when production commentMethod is entered. +func (s *BaseMongoShellParserListener) EnterCommentMethod(ctx *CommentMethodContext) {} + +// ExitCommentMethod is called when production commentMethod is exited. +func (s *BaseMongoShellParserListener) ExitCommentMethod(ctx *CommentMethodContext) {} + +// EnterExplainMethod is called when production explainMethod is entered. +func (s *BaseMongoShellParserListener) EnterExplainMethod(ctx *ExplainMethodContext) {} + +// ExitExplainMethod is called when production explainMethod is exited. +func (s *BaseMongoShellParserListener) ExitExplainMethod(ctx *ExplainMethodContext) {} + +// EnterForEachMethod is called when production forEachMethod is entered. +func (s *BaseMongoShellParserListener) EnterForEachMethod(ctx *ForEachMethodContext) {} + +// ExitForEachMethod is called when production forEachMethod is exited. +func (s *BaseMongoShellParserListener) ExitForEachMethod(ctx *ForEachMethodContext) {} + +// EnterHasNextMethod is called when production hasNextMethod is entered. +func (s *BaseMongoShellParserListener) EnterHasNextMethod(ctx *HasNextMethodContext) {} + +// ExitHasNextMethod is called when production hasNextMethod is exited. +func (s *BaseMongoShellParserListener) ExitHasNextMethod(ctx *HasNextMethodContext) {} + +// EnterHintMethod is called when production hintMethod is entered. +func (s *BaseMongoShellParserListener) EnterHintMethod(ctx *HintMethodContext) {} + +// ExitHintMethod is called when production hintMethod is exited. +func (s *BaseMongoShellParserListener) ExitHintMethod(ctx *HintMethodContext) {} + +// EnterIsClosedMethod is called when production isClosedMethod is entered. +func (s *BaseMongoShellParserListener) EnterIsClosedMethod(ctx *IsClosedMethodContext) {} + +// ExitIsClosedMethod is called when production isClosedMethod is exited. +func (s *BaseMongoShellParserListener) ExitIsClosedMethod(ctx *IsClosedMethodContext) {} + +// EnterIsExhaustedMethod is called when production isExhaustedMethod is entered. +func (s *BaseMongoShellParserListener) EnterIsExhaustedMethod(ctx *IsExhaustedMethodContext) {} + +// ExitIsExhaustedMethod is called when production isExhaustedMethod is exited. +func (s *BaseMongoShellParserListener) ExitIsExhaustedMethod(ctx *IsExhaustedMethodContext) {} + +// EnterItcountMethod is called when production itcountMethod is entered. +func (s *BaseMongoShellParserListener) EnterItcountMethod(ctx *ItcountMethodContext) {} + +// ExitItcountMethod is called when production itcountMethod is exited. +func (s *BaseMongoShellParserListener) ExitItcountMethod(ctx *ItcountMethodContext) {} + +// EnterMapMethod is called when production mapMethod is entered. +func (s *BaseMongoShellParserListener) EnterMapMethod(ctx *MapMethodContext) {} + +// ExitMapMethod is called when production mapMethod is exited. +func (s *BaseMongoShellParserListener) ExitMapMethod(ctx *MapMethodContext) {} + +// EnterMaxMethod is called when production maxMethod is entered. +func (s *BaseMongoShellParserListener) EnterMaxMethod(ctx *MaxMethodContext) {} + +// ExitMaxMethod is called when production maxMethod is exited. +func (s *BaseMongoShellParserListener) ExitMaxMethod(ctx *MaxMethodContext) {} + +// EnterMaxAwaitTimeMSMethod is called when production maxAwaitTimeMSMethod is entered. +func (s *BaseMongoShellParserListener) EnterMaxAwaitTimeMSMethod(ctx *MaxAwaitTimeMSMethodContext) {} + +// ExitMaxAwaitTimeMSMethod is called when production maxAwaitTimeMSMethod is exited. +func (s *BaseMongoShellParserListener) ExitMaxAwaitTimeMSMethod(ctx *MaxAwaitTimeMSMethodContext) {} + +// EnterMaxTimeMSMethod is called when production maxTimeMSMethod is entered. +func (s *BaseMongoShellParserListener) EnterMaxTimeMSMethod(ctx *MaxTimeMSMethodContext) {} + +// ExitMaxTimeMSMethod is called when production maxTimeMSMethod is exited. +func (s *BaseMongoShellParserListener) ExitMaxTimeMSMethod(ctx *MaxTimeMSMethodContext) {} + +// EnterMinMethod is called when production minMethod is entered. +func (s *BaseMongoShellParserListener) EnterMinMethod(ctx *MinMethodContext) {} + +// ExitMinMethod is called when production minMethod is exited. +func (s *BaseMongoShellParserListener) ExitMinMethod(ctx *MinMethodContext) {} + +// EnterNextMethod is called when production nextMethod is entered. +func (s *BaseMongoShellParserListener) EnterNextMethod(ctx *NextMethodContext) {} + +// ExitNextMethod is called when production nextMethod is exited. +func (s *BaseMongoShellParserListener) ExitNextMethod(ctx *NextMethodContext) {} + +// EnterNoCursorTimeoutMethod is called when production noCursorTimeoutMethod is entered. +func (s *BaseMongoShellParserListener) EnterNoCursorTimeoutMethod(ctx *NoCursorTimeoutMethodContext) { +} + +// ExitNoCursorTimeoutMethod is called when production noCursorTimeoutMethod is exited. +func (s *BaseMongoShellParserListener) ExitNoCursorTimeoutMethod(ctx *NoCursorTimeoutMethodContext) {} + +// EnterObjsLeftInBatchMethod is called when production objsLeftInBatchMethod is entered. +func (s *BaseMongoShellParserListener) EnterObjsLeftInBatchMethod(ctx *ObjsLeftInBatchMethodContext) { +} + +// ExitObjsLeftInBatchMethod is called when production objsLeftInBatchMethod is exited. +func (s *BaseMongoShellParserListener) ExitObjsLeftInBatchMethod(ctx *ObjsLeftInBatchMethodContext) {} + +// EnterPrettyMethod is called when production prettyMethod is entered. +func (s *BaseMongoShellParserListener) EnterPrettyMethod(ctx *PrettyMethodContext) {} + +// ExitPrettyMethod is called when production prettyMethod is exited. +func (s *BaseMongoShellParserListener) ExitPrettyMethod(ctx *PrettyMethodContext) {} + +// EnterReadConcernMethod is called when production readConcernMethod is entered. +func (s *BaseMongoShellParserListener) EnterReadConcernMethod(ctx *ReadConcernMethodContext) {} + +// ExitReadConcernMethod is called when production readConcernMethod is exited. +func (s *BaseMongoShellParserListener) ExitReadConcernMethod(ctx *ReadConcernMethodContext) {} + +// EnterReadPrefMethod is called when production readPrefMethod is entered. +func (s *BaseMongoShellParserListener) EnterReadPrefMethod(ctx *ReadPrefMethodContext) {} + +// ExitReadPrefMethod is called when production readPrefMethod is exited. +func (s *BaseMongoShellParserListener) ExitReadPrefMethod(ctx *ReadPrefMethodContext) {} + +// EnterReturnKeyMethod is called when production returnKeyMethod is entered. +func (s *BaseMongoShellParserListener) EnterReturnKeyMethod(ctx *ReturnKeyMethodContext) {} + +// ExitReturnKeyMethod is called when production returnKeyMethod is exited. +func (s *BaseMongoShellParserListener) ExitReturnKeyMethod(ctx *ReturnKeyMethodContext) {} + +// EnterShowRecordIdMethod is called when production showRecordIdMethod is entered. +func (s *BaseMongoShellParserListener) EnterShowRecordIdMethod(ctx *ShowRecordIdMethodContext) {} + +// ExitShowRecordIdMethod is called when production showRecordIdMethod is exited. +func (s *BaseMongoShellParserListener) ExitShowRecordIdMethod(ctx *ShowRecordIdMethodContext) {} + +// EnterSizeMethod is called when production sizeMethod is entered. +func (s *BaseMongoShellParserListener) EnterSizeMethod(ctx *SizeMethodContext) {} + +// ExitSizeMethod is called when production sizeMethod is exited. +func (s *BaseMongoShellParserListener) ExitSizeMethod(ctx *SizeMethodContext) {} + +// EnterTailableMethod is called when production tailableMethod is entered. +func (s *BaseMongoShellParserListener) EnterTailableMethod(ctx *TailableMethodContext) {} + +// ExitTailableMethod is called when production tailableMethod is exited. +func (s *BaseMongoShellParserListener) ExitTailableMethod(ctx *TailableMethodContext) {} + +// EnterToArrayMethod is called when production toArrayMethod is entered. +func (s *BaseMongoShellParserListener) EnterToArrayMethod(ctx *ToArrayMethodContext) {} + +// ExitToArrayMethod is called when production toArrayMethod is exited. +func (s *BaseMongoShellParserListener) ExitToArrayMethod(ctx *ToArrayMethodContext) {} + +// EnterTryNextMethod is called when production tryNextMethod is entered. +func (s *BaseMongoShellParserListener) EnterTryNextMethod(ctx *TryNextMethodContext) {} + +// ExitTryNextMethod is called when production tryNextMethod is exited. +func (s *BaseMongoShellParserListener) ExitTryNextMethod(ctx *TryNextMethodContext) {} + +// EnterAllowDiskUseMethod is called when production allowDiskUseMethod is entered. +func (s *BaseMongoShellParserListener) EnterAllowDiskUseMethod(ctx *AllowDiskUseMethodContext) {} + +// ExitAllowDiskUseMethod is called when production allowDiskUseMethod is exited. +func (s *BaseMongoShellParserListener) ExitAllowDiskUseMethod(ctx *AllowDiskUseMethodContext) {} + +// EnterAddOptionMethod is called when production addOptionMethod is entered. +func (s *BaseMongoShellParserListener) EnterAddOptionMethod(ctx *AddOptionMethodContext) {} + +// ExitAddOptionMethod is called when production addOptionMethod is exited. +func (s *BaseMongoShellParserListener) ExitAddOptionMethod(ctx *AddOptionMethodContext) {} + // EnterGenericMethod is called when production genericMethod is entered. func (s *BaseMongoShellParserListener) EnterGenericMethod(ctx *GenericMethodContext) {} @@ -336,6 +980,30 @@ func (s *BaseMongoShellParserListener) EnterRegExpConstructor(ctx *RegExpConstru // ExitRegExpConstructor is called when production regExpConstructor is exited. func (s *BaseMongoShellParserListener) ExitRegExpConstructor(ctx *RegExpConstructorContext) {} +// EnterBinDataHelper is called when production binDataHelper is entered. +func (s *BaseMongoShellParserListener) EnterBinDataHelper(ctx *BinDataHelperContext) {} + +// ExitBinDataHelper is called when production binDataHelper is exited. +func (s *BaseMongoShellParserListener) ExitBinDataHelper(ctx *BinDataHelperContext) {} + +// EnterBinaryHelper is called when production binaryHelper is entered. +func (s *BaseMongoShellParserListener) EnterBinaryHelper(ctx *BinaryHelperContext) {} + +// ExitBinaryHelper is called when production binaryHelper is exited. +func (s *BaseMongoShellParserListener) ExitBinaryHelper(ctx *BinaryHelperContext) {} + +// EnterBsonRegExpHelper is called when production bsonRegExpHelper is entered. +func (s *BaseMongoShellParserListener) EnterBsonRegExpHelper(ctx *BsonRegExpHelperContext) {} + +// ExitBsonRegExpHelper is called when production bsonRegExpHelper is exited. +func (s *BaseMongoShellParserListener) ExitBsonRegExpHelper(ctx *BsonRegExpHelperContext) {} + +// EnterHexDataHelper is called when production hexDataHelper is entered. +func (s *BaseMongoShellParserListener) EnterHexDataHelper(ctx *HexDataHelperContext) {} + +// ExitHexDataHelper is called when production hexDataHelper is exited. +func (s *BaseMongoShellParserListener) ExitHexDataHelper(ctx *HexDataHelperContext) {} + // EnterStringLiteralValue is called when production stringLiteralValue is entered. func (s *BaseMongoShellParserListener) EnterStringLiteralValue(ctx *StringLiteralValueContext) {} diff --git a/mongodb/mongoshellparser_base_visitor.go b/mongodb/mongoshellparser_base_visitor.go index 5b82400..9e05cea 100644 --- a/mongodb/mongoshellparser_base_visitor.go +++ b/mongodb/mongoshellparser_base_visitor.go @@ -31,10 +31,214 @@ func (v *BaseMongoShellParserVisitor) VisitGetCollectionInfos(ctx *GetCollection return v.VisitChildren(ctx) } +func (v *BaseMongoShellParserVisitor) VisitCreateCollection(ctx *CreateCollectionContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitDropDatabase(ctx *DropDatabaseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitDbStats(ctx *DbStatsContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitServerStatus(ctx *ServerStatusContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitServerBuildInfo(ctx *ServerBuildInfoContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitDbVersion(ctx *DbVersionContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitHostInfo(ctx *HostInfoContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitListCommands(ctx *ListCommandsContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitRunCommand(ctx *RunCommandContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitAdminCommand(ctx *AdminCommandContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitGetName(ctx *GetNameContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitGetMongo(ctx *GetMongoContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitGetSiblingDB(ctx *GetSiblingDBContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitDbGenericMethod(ctx *DbGenericMethodContext) interface{} { + return v.VisitChildren(ctx) +} + func (v *BaseMongoShellParserVisitor) VisitCollectionOperation(ctx *CollectionOperationContext) interface{} { return v.VisitChildren(ctx) } +func (v *BaseMongoShellParserVisitor) VisitGenericDbMethod(ctx *GenericDbMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitBulkStatement(ctx *BulkStatementContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitBulkInitMethod(ctx *BulkInitMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitBulkMethodChain(ctx *BulkMethodChainContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitBulkFind(ctx *BulkFindContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitBulkInsert(ctx *BulkInsertContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitBulkRemove(ctx *BulkRemoveContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitBulkExecute(ctx *BulkExecuteContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitBulkGetOperations(ctx *BulkGetOperationsContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitBulkToString(ctx *BulkToStringContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitBulkGenericMethod(ctx *BulkGenericMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitMongoConnection(ctx *MongoConnectionContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitConnectCall(ctx *ConnectCallContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitDbGetMongoChain(ctx *DbGetMongoChainContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitConnectionMethodChain(ctx *ConnectionMethodChainContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitRsStatement(ctx *RsStatementContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitShStatement(ctx *ShStatementContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitKeyVaultStatement(ctx *KeyVaultStatementContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitClientEncryptionStatement(ctx *ClientEncryptionStatementContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitPlanCacheStatement(ctx *PlanCacheStatementContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitSpStatement(ctx *SpStatementContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitNativeFunctionCall(ctx *NativeFunctionCallContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitConnGetDB(ctx *ConnGetDBContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitConnGetReadConcern(ctx *ConnGetReadConcernContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitConnGetReadPref(ctx *ConnGetReadPrefContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitConnGetReadPrefMode(ctx *ConnGetReadPrefModeContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitConnGetReadPrefTagSet(ctx *ConnGetReadPrefTagSetContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitConnGetWriteConcern(ctx *ConnGetWriteConcernContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitConnSetReadPref(ctx *ConnSetReadPrefContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitConnSetReadConcern(ctx *ConnSetReadConcernContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitConnSetWriteConcern(ctx *ConnSetWriteConcernContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitConnStartSession(ctx *ConnStartSessionContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitConnWatch(ctx *ConnWatchContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitConnClose(ctx *ConnCloseContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitConnAdminCommand(ctx *ConnAdminCommandContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitConnGetDBNames(ctx *ConnGetDBNamesContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitConnGenericMethod(ctx *ConnGenericMethodContext) interface{} { + return v.VisitChildren(ctx) +} + func (v *BaseMongoShellParserVisitor) VisitDotAccess(ctx *DotAccessContext) interface{} { return v.VisitChildren(ctx) } @@ -83,6 +287,102 @@ func (v *BaseMongoShellParserVisitor) VisitGetIndexesMethod(ctx *GetIndexesMetho return v.VisitChildren(ctx) } +func (v *BaseMongoShellParserVisitor) VisitInsertOneMethod(ctx *InsertOneMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitInsertManyMethod(ctx *InsertManyMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitUpdateOneMethod(ctx *UpdateOneMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitUpdateManyMethod(ctx *UpdateManyMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitDeleteOneMethod(ctx *DeleteOneMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitDeleteManyMethod(ctx *DeleteManyMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitReplaceOneMethod(ctx *ReplaceOneMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitFindOneAndUpdateMethod(ctx *FindOneAndUpdateMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitFindOneAndReplaceMethod(ctx *FindOneAndReplaceMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitFindOneAndDeleteMethod(ctx *FindOneAndDeleteMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitCreateIndexMethod(ctx *CreateIndexMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitCreateIndexesMethod(ctx *CreateIndexesMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitDropIndexMethod(ctx *DropIndexMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitDropIndexesMethod(ctx *DropIndexesMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitDropMethod(ctx *DropMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitRenameCollectionMethod(ctx *RenameCollectionMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitStatsMethod(ctx *StatsMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitStorageSizeMethod(ctx *StorageSizeMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitTotalIndexSizeMethod(ctx *TotalIndexSizeMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitTotalSizeMethod(ctx *TotalSizeMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitDataSizeMethod(ctx *DataSizeMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitIsCappedMethod(ctx *IsCappedMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitValidateMethod(ctx *ValidateMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitLatencyStatsMethod(ctx *LatencyStatsMethodContext) interface{} { + return v.VisitChildren(ctx) +} + func (v *BaseMongoShellParserVisitor) VisitSortMethod(ctx *SortMethodContext) interface{} { return v.VisitChildren(ctx) } @@ -103,6 +403,126 @@ func (v *BaseMongoShellParserVisitor) VisitProjectionMethod(ctx *ProjectionMetho return v.VisitChildren(ctx) } +func (v *BaseMongoShellParserVisitor) VisitBatchSizeMethod(ctx *BatchSizeMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitCloseMethod(ctx *CloseMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitCollationMethod(ctx *CollationMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitCommentMethod(ctx *CommentMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitExplainMethod(ctx *ExplainMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitForEachMethod(ctx *ForEachMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitHasNextMethod(ctx *HasNextMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitHintMethod(ctx *HintMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitIsClosedMethod(ctx *IsClosedMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitIsExhaustedMethod(ctx *IsExhaustedMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitItcountMethod(ctx *ItcountMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitMapMethod(ctx *MapMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitMaxMethod(ctx *MaxMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitMaxAwaitTimeMSMethod(ctx *MaxAwaitTimeMSMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitMaxTimeMSMethod(ctx *MaxTimeMSMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitMinMethod(ctx *MinMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitNextMethod(ctx *NextMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitNoCursorTimeoutMethod(ctx *NoCursorTimeoutMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitObjsLeftInBatchMethod(ctx *ObjsLeftInBatchMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitPrettyMethod(ctx *PrettyMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitReadConcernMethod(ctx *ReadConcernMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitReadPrefMethod(ctx *ReadPrefMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitReturnKeyMethod(ctx *ReturnKeyMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitShowRecordIdMethod(ctx *ShowRecordIdMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitSizeMethod(ctx *SizeMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitTailableMethod(ctx *TailableMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitToArrayMethod(ctx *ToArrayMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitTryNextMethod(ctx *TryNextMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitAllowDiskUseMethod(ctx *AllowDiskUseMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitAddOptionMethod(ctx *AddOptionMethodContext) interface{} { + return v.VisitChildren(ctx) +} + func (v *BaseMongoShellParserVisitor) VisitGenericMethod(ctx *GenericMethodContext) interface{} { return v.VisitChildren(ctx) } @@ -215,6 +635,22 @@ func (v *BaseMongoShellParserVisitor) VisitRegExpConstructor(ctx *RegExpConstruc return v.VisitChildren(ctx) } +func (v *BaseMongoShellParserVisitor) VisitBinDataHelper(ctx *BinDataHelperContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitBinaryHelper(ctx *BinaryHelperContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitBsonRegExpHelper(ctx *BsonRegExpHelperContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitHexDataHelper(ctx *HexDataHelperContext) interface{} { + return v.VisitChildren(ctx) +} + func (v *BaseMongoShellParserVisitor) VisitStringLiteralValue(ctx *StringLiteralValueContext) interface{} { return v.VisitChildren(ctx) } diff --git a/mongodb/mongoshellparser_listener.go b/mongodb/mongoshellparser_listener.go index 5cde51e..a3ce925 100644 --- a/mongodb/mongoshellparser_listener.go +++ b/mongodb/mongoshellparser_listener.go @@ -25,9 +25,162 @@ type MongoShellParserListener interface { // EnterGetCollectionInfos is called when entering the getCollectionInfos production. EnterGetCollectionInfos(c *GetCollectionInfosContext) + // EnterCreateCollection is called when entering the createCollection production. + EnterCreateCollection(c *CreateCollectionContext) + + // EnterDropDatabase is called when entering the dropDatabase production. + EnterDropDatabase(c *DropDatabaseContext) + + // EnterDbStats is called when entering the dbStats production. + EnterDbStats(c *DbStatsContext) + + // EnterServerStatus is called when entering the serverStatus production. + EnterServerStatus(c *ServerStatusContext) + + // EnterServerBuildInfo is called when entering the serverBuildInfo production. + EnterServerBuildInfo(c *ServerBuildInfoContext) + + // EnterDbVersion is called when entering the dbVersion production. + EnterDbVersion(c *DbVersionContext) + + // EnterHostInfo is called when entering the hostInfo production. + EnterHostInfo(c *HostInfoContext) + + // EnterListCommands is called when entering the listCommands production. + EnterListCommands(c *ListCommandsContext) + + // EnterRunCommand is called when entering the runCommand production. + EnterRunCommand(c *RunCommandContext) + + // EnterAdminCommand is called when entering the adminCommand production. + EnterAdminCommand(c *AdminCommandContext) + + // EnterGetName is called when entering the getName production. + EnterGetName(c *GetNameContext) + + // EnterGetMongo is called when entering the getMongo production. + EnterGetMongo(c *GetMongoContext) + + // EnterGetSiblingDB is called when entering the getSiblingDB production. + EnterGetSiblingDB(c *GetSiblingDBContext) + + // EnterDbGenericMethod is called when entering the dbGenericMethod production. + EnterDbGenericMethod(c *DbGenericMethodContext) + // EnterCollectionOperation is called when entering the collectionOperation production. EnterCollectionOperation(c *CollectionOperationContext) + // EnterGenericDbMethod is called when entering the genericDbMethod production. + EnterGenericDbMethod(c *GenericDbMethodContext) + + // EnterBulkStatement is called when entering the bulkStatement production. + EnterBulkStatement(c *BulkStatementContext) + + // EnterBulkInitMethod is called when entering the bulkInitMethod production. + EnterBulkInitMethod(c *BulkInitMethodContext) + + // EnterBulkMethodChain is called when entering the bulkMethodChain production. + EnterBulkMethodChain(c *BulkMethodChainContext) + + // EnterBulkFind is called when entering the bulkFind production. + EnterBulkFind(c *BulkFindContext) + + // EnterBulkInsert is called when entering the bulkInsert production. + EnterBulkInsert(c *BulkInsertContext) + + // EnterBulkRemove is called when entering the bulkRemove production. + EnterBulkRemove(c *BulkRemoveContext) + + // EnterBulkExecute is called when entering the bulkExecute production. + EnterBulkExecute(c *BulkExecuteContext) + + // EnterBulkGetOperations is called when entering the bulkGetOperations production. + EnterBulkGetOperations(c *BulkGetOperationsContext) + + // EnterBulkToString is called when entering the bulkToString production. + EnterBulkToString(c *BulkToStringContext) + + // EnterBulkGenericMethod is called when entering the bulkGenericMethod production. + EnterBulkGenericMethod(c *BulkGenericMethodContext) + + // EnterMongoConnection is called when entering the mongoConnection production. + EnterMongoConnection(c *MongoConnectionContext) + + // EnterConnectCall is called when entering the connectCall production. + EnterConnectCall(c *ConnectCallContext) + + // EnterDbGetMongoChain is called when entering the dbGetMongoChain production. + EnterDbGetMongoChain(c *DbGetMongoChainContext) + + // EnterConnectionMethodChain is called when entering the connectionMethodChain production. + EnterConnectionMethodChain(c *ConnectionMethodChainContext) + + // EnterRsStatement is called when entering the rsStatement production. + EnterRsStatement(c *RsStatementContext) + + // EnterShStatement is called when entering the shStatement production. + EnterShStatement(c *ShStatementContext) + + // EnterKeyVaultStatement is called when entering the keyVaultStatement production. + EnterKeyVaultStatement(c *KeyVaultStatementContext) + + // EnterClientEncryptionStatement is called when entering the clientEncryptionStatement production. + EnterClientEncryptionStatement(c *ClientEncryptionStatementContext) + + // EnterPlanCacheStatement is called when entering the planCacheStatement production. + EnterPlanCacheStatement(c *PlanCacheStatementContext) + + // EnterSpStatement is called when entering the spStatement production. + EnterSpStatement(c *SpStatementContext) + + // EnterNativeFunctionCall is called when entering the nativeFunctionCall production. + EnterNativeFunctionCall(c *NativeFunctionCallContext) + + // EnterConnGetDB is called when entering the connGetDB production. + EnterConnGetDB(c *ConnGetDBContext) + + // EnterConnGetReadConcern is called when entering the connGetReadConcern production. + EnterConnGetReadConcern(c *ConnGetReadConcernContext) + + // EnterConnGetReadPref is called when entering the connGetReadPref production. + EnterConnGetReadPref(c *ConnGetReadPrefContext) + + // EnterConnGetReadPrefMode is called when entering the connGetReadPrefMode production. + EnterConnGetReadPrefMode(c *ConnGetReadPrefModeContext) + + // EnterConnGetReadPrefTagSet is called when entering the connGetReadPrefTagSet production. + EnterConnGetReadPrefTagSet(c *ConnGetReadPrefTagSetContext) + + // EnterConnGetWriteConcern is called when entering the connGetWriteConcern production. + EnterConnGetWriteConcern(c *ConnGetWriteConcernContext) + + // EnterConnSetReadPref is called when entering the connSetReadPref production. + EnterConnSetReadPref(c *ConnSetReadPrefContext) + + // EnterConnSetReadConcern is called when entering the connSetReadConcern production. + EnterConnSetReadConcern(c *ConnSetReadConcernContext) + + // EnterConnSetWriteConcern is called when entering the connSetWriteConcern production. + EnterConnSetWriteConcern(c *ConnSetWriteConcernContext) + + // EnterConnStartSession is called when entering the connStartSession production. + EnterConnStartSession(c *ConnStartSessionContext) + + // EnterConnWatch is called when entering the connWatch production. + EnterConnWatch(c *ConnWatchContext) + + // EnterConnClose is called when entering the connClose production. + EnterConnClose(c *ConnCloseContext) + + // EnterConnAdminCommand is called when entering the connAdminCommand production. + EnterConnAdminCommand(c *ConnAdminCommandContext) + + // EnterConnGetDBNames is called when entering the connGetDBNames production. + EnterConnGetDBNames(c *ConnGetDBNamesContext) + + // EnterConnGenericMethod is called when entering the connGenericMethod production. + EnterConnGenericMethod(c *ConnGenericMethodContext) + // EnterDotAccess is called when entering the dotAccess production. EnterDotAccess(c *DotAccessContext) @@ -64,6 +217,78 @@ type MongoShellParserListener interface { // EnterGetIndexesMethod is called when entering the getIndexesMethod production. EnterGetIndexesMethod(c *GetIndexesMethodContext) + // EnterInsertOneMethod is called when entering the insertOneMethod production. + EnterInsertOneMethod(c *InsertOneMethodContext) + + // EnterInsertManyMethod is called when entering the insertManyMethod production. + EnterInsertManyMethod(c *InsertManyMethodContext) + + // EnterUpdateOneMethod is called when entering the updateOneMethod production. + EnterUpdateOneMethod(c *UpdateOneMethodContext) + + // EnterUpdateManyMethod is called when entering the updateManyMethod production. + EnterUpdateManyMethod(c *UpdateManyMethodContext) + + // EnterDeleteOneMethod is called when entering the deleteOneMethod production. + EnterDeleteOneMethod(c *DeleteOneMethodContext) + + // EnterDeleteManyMethod is called when entering the deleteManyMethod production. + EnterDeleteManyMethod(c *DeleteManyMethodContext) + + // EnterReplaceOneMethod is called when entering the replaceOneMethod production. + EnterReplaceOneMethod(c *ReplaceOneMethodContext) + + // EnterFindOneAndUpdateMethod is called when entering the findOneAndUpdateMethod production. + EnterFindOneAndUpdateMethod(c *FindOneAndUpdateMethodContext) + + // EnterFindOneAndReplaceMethod is called when entering the findOneAndReplaceMethod production. + EnterFindOneAndReplaceMethod(c *FindOneAndReplaceMethodContext) + + // EnterFindOneAndDeleteMethod is called when entering the findOneAndDeleteMethod production. + EnterFindOneAndDeleteMethod(c *FindOneAndDeleteMethodContext) + + // EnterCreateIndexMethod is called when entering the createIndexMethod production. + EnterCreateIndexMethod(c *CreateIndexMethodContext) + + // EnterCreateIndexesMethod is called when entering the createIndexesMethod production. + EnterCreateIndexesMethod(c *CreateIndexesMethodContext) + + // EnterDropIndexMethod is called when entering the dropIndexMethod production. + EnterDropIndexMethod(c *DropIndexMethodContext) + + // EnterDropIndexesMethod is called when entering the dropIndexesMethod production. + EnterDropIndexesMethod(c *DropIndexesMethodContext) + + // EnterDropMethod is called when entering the dropMethod production. + EnterDropMethod(c *DropMethodContext) + + // EnterRenameCollectionMethod is called when entering the renameCollectionMethod production. + EnterRenameCollectionMethod(c *RenameCollectionMethodContext) + + // EnterStatsMethod is called when entering the statsMethod production. + EnterStatsMethod(c *StatsMethodContext) + + // EnterStorageSizeMethod is called when entering the storageSizeMethod production. + EnterStorageSizeMethod(c *StorageSizeMethodContext) + + // EnterTotalIndexSizeMethod is called when entering the totalIndexSizeMethod production. + EnterTotalIndexSizeMethod(c *TotalIndexSizeMethodContext) + + // EnterTotalSizeMethod is called when entering the totalSizeMethod production. + EnterTotalSizeMethod(c *TotalSizeMethodContext) + + // EnterDataSizeMethod is called when entering the dataSizeMethod production. + EnterDataSizeMethod(c *DataSizeMethodContext) + + // EnterIsCappedMethod is called when entering the isCappedMethod production. + EnterIsCappedMethod(c *IsCappedMethodContext) + + // EnterValidateMethod is called when entering the validateMethod production. + EnterValidateMethod(c *ValidateMethodContext) + + // EnterLatencyStatsMethod is called when entering the latencyStatsMethod production. + EnterLatencyStatsMethod(c *LatencyStatsMethodContext) + // EnterSortMethod is called when entering the sortMethod production. EnterSortMethod(c *SortMethodContext) @@ -79,6 +304,96 @@ type MongoShellParserListener interface { // EnterProjectionMethod is called when entering the projectionMethod production. EnterProjectionMethod(c *ProjectionMethodContext) + // EnterBatchSizeMethod is called when entering the batchSizeMethod production. + EnterBatchSizeMethod(c *BatchSizeMethodContext) + + // EnterCloseMethod is called when entering the closeMethod production. + EnterCloseMethod(c *CloseMethodContext) + + // EnterCollationMethod is called when entering the collationMethod production. + EnterCollationMethod(c *CollationMethodContext) + + // EnterCommentMethod is called when entering the commentMethod production. + EnterCommentMethod(c *CommentMethodContext) + + // EnterExplainMethod is called when entering the explainMethod production. + EnterExplainMethod(c *ExplainMethodContext) + + // EnterForEachMethod is called when entering the forEachMethod production. + EnterForEachMethod(c *ForEachMethodContext) + + // EnterHasNextMethod is called when entering the hasNextMethod production. + EnterHasNextMethod(c *HasNextMethodContext) + + // EnterHintMethod is called when entering the hintMethod production. + EnterHintMethod(c *HintMethodContext) + + // EnterIsClosedMethod is called when entering the isClosedMethod production. + EnterIsClosedMethod(c *IsClosedMethodContext) + + // EnterIsExhaustedMethod is called when entering the isExhaustedMethod production. + EnterIsExhaustedMethod(c *IsExhaustedMethodContext) + + // EnterItcountMethod is called when entering the itcountMethod production. + EnterItcountMethod(c *ItcountMethodContext) + + // EnterMapMethod is called when entering the mapMethod production. + EnterMapMethod(c *MapMethodContext) + + // EnterMaxMethod is called when entering the maxMethod production. + EnterMaxMethod(c *MaxMethodContext) + + // EnterMaxAwaitTimeMSMethod is called when entering the maxAwaitTimeMSMethod production. + EnterMaxAwaitTimeMSMethod(c *MaxAwaitTimeMSMethodContext) + + // EnterMaxTimeMSMethod is called when entering the maxTimeMSMethod production. + EnterMaxTimeMSMethod(c *MaxTimeMSMethodContext) + + // EnterMinMethod is called when entering the minMethod production. + EnterMinMethod(c *MinMethodContext) + + // EnterNextMethod is called when entering the nextMethod production. + EnterNextMethod(c *NextMethodContext) + + // EnterNoCursorTimeoutMethod is called when entering the noCursorTimeoutMethod production. + EnterNoCursorTimeoutMethod(c *NoCursorTimeoutMethodContext) + + // EnterObjsLeftInBatchMethod is called when entering the objsLeftInBatchMethod production. + EnterObjsLeftInBatchMethod(c *ObjsLeftInBatchMethodContext) + + // EnterPrettyMethod is called when entering the prettyMethod production. + EnterPrettyMethod(c *PrettyMethodContext) + + // EnterReadConcernMethod is called when entering the readConcernMethod production. + EnterReadConcernMethod(c *ReadConcernMethodContext) + + // EnterReadPrefMethod is called when entering the readPrefMethod production. + EnterReadPrefMethod(c *ReadPrefMethodContext) + + // EnterReturnKeyMethod is called when entering the returnKeyMethod production. + EnterReturnKeyMethod(c *ReturnKeyMethodContext) + + // EnterShowRecordIdMethod is called when entering the showRecordIdMethod production. + EnterShowRecordIdMethod(c *ShowRecordIdMethodContext) + + // EnterSizeMethod is called when entering the sizeMethod production. + EnterSizeMethod(c *SizeMethodContext) + + // EnterTailableMethod is called when entering the tailableMethod production. + EnterTailableMethod(c *TailableMethodContext) + + // EnterToArrayMethod is called when entering the toArrayMethod production. + EnterToArrayMethod(c *ToArrayMethodContext) + + // EnterTryNextMethod is called when entering the tryNextMethod production. + EnterTryNextMethod(c *TryNextMethodContext) + + // EnterAllowDiskUseMethod is called when entering the allowDiskUseMethod production. + EnterAllowDiskUseMethod(c *AllowDiskUseMethodContext) + + // EnterAddOptionMethod is called when entering the addOptionMethod production. + EnterAddOptionMethod(c *AddOptionMethodContext) + // EnterGenericMethod is called when entering the genericMethod production. EnterGenericMethod(c *GenericMethodContext) @@ -163,6 +478,18 @@ type MongoShellParserListener interface { // EnterRegExpConstructor is called when entering the regExpConstructor production. EnterRegExpConstructor(c *RegExpConstructorContext) + // EnterBinDataHelper is called when entering the binDataHelper production. + EnterBinDataHelper(c *BinDataHelperContext) + + // EnterBinaryHelper is called when entering the binaryHelper production. + EnterBinaryHelper(c *BinaryHelperContext) + + // EnterBsonRegExpHelper is called when entering the bsonRegExpHelper production. + EnterBsonRegExpHelper(c *BsonRegExpHelperContext) + + // EnterHexDataHelper is called when entering the hexDataHelper production. + EnterHexDataHelper(c *HexDataHelperContext) + // EnterStringLiteralValue is called when entering the stringLiteralValue production. EnterStringLiteralValue(c *StringLiteralValueContext) @@ -202,9 +529,162 @@ type MongoShellParserListener interface { // ExitGetCollectionInfos is called when exiting the getCollectionInfos production. ExitGetCollectionInfos(c *GetCollectionInfosContext) + // ExitCreateCollection is called when exiting the createCollection production. + ExitCreateCollection(c *CreateCollectionContext) + + // ExitDropDatabase is called when exiting the dropDatabase production. + ExitDropDatabase(c *DropDatabaseContext) + + // ExitDbStats is called when exiting the dbStats production. + ExitDbStats(c *DbStatsContext) + + // ExitServerStatus is called when exiting the serverStatus production. + ExitServerStatus(c *ServerStatusContext) + + // ExitServerBuildInfo is called when exiting the serverBuildInfo production. + ExitServerBuildInfo(c *ServerBuildInfoContext) + + // ExitDbVersion is called when exiting the dbVersion production. + ExitDbVersion(c *DbVersionContext) + + // ExitHostInfo is called when exiting the hostInfo production. + ExitHostInfo(c *HostInfoContext) + + // ExitListCommands is called when exiting the listCommands production. + ExitListCommands(c *ListCommandsContext) + + // ExitRunCommand is called when exiting the runCommand production. + ExitRunCommand(c *RunCommandContext) + + // ExitAdminCommand is called when exiting the adminCommand production. + ExitAdminCommand(c *AdminCommandContext) + + // ExitGetName is called when exiting the getName production. + ExitGetName(c *GetNameContext) + + // ExitGetMongo is called when exiting the getMongo production. + ExitGetMongo(c *GetMongoContext) + + // ExitGetSiblingDB is called when exiting the getSiblingDB production. + ExitGetSiblingDB(c *GetSiblingDBContext) + + // ExitDbGenericMethod is called when exiting the dbGenericMethod production. + ExitDbGenericMethod(c *DbGenericMethodContext) + // ExitCollectionOperation is called when exiting the collectionOperation production. ExitCollectionOperation(c *CollectionOperationContext) + // ExitGenericDbMethod is called when exiting the genericDbMethod production. + ExitGenericDbMethod(c *GenericDbMethodContext) + + // ExitBulkStatement is called when exiting the bulkStatement production. + ExitBulkStatement(c *BulkStatementContext) + + // ExitBulkInitMethod is called when exiting the bulkInitMethod production. + ExitBulkInitMethod(c *BulkInitMethodContext) + + // ExitBulkMethodChain is called when exiting the bulkMethodChain production. + ExitBulkMethodChain(c *BulkMethodChainContext) + + // ExitBulkFind is called when exiting the bulkFind production. + ExitBulkFind(c *BulkFindContext) + + // ExitBulkInsert is called when exiting the bulkInsert production. + ExitBulkInsert(c *BulkInsertContext) + + // ExitBulkRemove is called when exiting the bulkRemove production. + ExitBulkRemove(c *BulkRemoveContext) + + // ExitBulkExecute is called when exiting the bulkExecute production. + ExitBulkExecute(c *BulkExecuteContext) + + // ExitBulkGetOperations is called when exiting the bulkGetOperations production. + ExitBulkGetOperations(c *BulkGetOperationsContext) + + // ExitBulkToString is called when exiting the bulkToString production. + ExitBulkToString(c *BulkToStringContext) + + // ExitBulkGenericMethod is called when exiting the bulkGenericMethod production. + ExitBulkGenericMethod(c *BulkGenericMethodContext) + + // ExitMongoConnection is called when exiting the mongoConnection production. + ExitMongoConnection(c *MongoConnectionContext) + + // ExitConnectCall is called when exiting the connectCall production. + ExitConnectCall(c *ConnectCallContext) + + // ExitDbGetMongoChain is called when exiting the dbGetMongoChain production. + ExitDbGetMongoChain(c *DbGetMongoChainContext) + + // ExitConnectionMethodChain is called when exiting the connectionMethodChain production. + ExitConnectionMethodChain(c *ConnectionMethodChainContext) + + // ExitRsStatement is called when exiting the rsStatement production. + ExitRsStatement(c *RsStatementContext) + + // ExitShStatement is called when exiting the shStatement production. + ExitShStatement(c *ShStatementContext) + + // ExitKeyVaultStatement is called when exiting the keyVaultStatement production. + ExitKeyVaultStatement(c *KeyVaultStatementContext) + + // ExitClientEncryptionStatement is called when exiting the clientEncryptionStatement production. + ExitClientEncryptionStatement(c *ClientEncryptionStatementContext) + + // ExitPlanCacheStatement is called when exiting the planCacheStatement production. + ExitPlanCacheStatement(c *PlanCacheStatementContext) + + // ExitSpStatement is called when exiting the spStatement production. + ExitSpStatement(c *SpStatementContext) + + // ExitNativeFunctionCall is called when exiting the nativeFunctionCall production. + ExitNativeFunctionCall(c *NativeFunctionCallContext) + + // ExitConnGetDB is called when exiting the connGetDB production. + ExitConnGetDB(c *ConnGetDBContext) + + // ExitConnGetReadConcern is called when exiting the connGetReadConcern production. + ExitConnGetReadConcern(c *ConnGetReadConcernContext) + + // ExitConnGetReadPref is called when exiting the connGetReadPref production. + ExitConnGetReadPref(c *ConnGetReadPrefContext) + + // ExitConnGetReadPrefMode is called when exiting the connGetReadPrefMode production. + ExitConnGetReadPrefMode(c *ConnGetReadPrefModeContext) + + // ExitConnGetReadPrefTagSet is called when exiting the connGetReadPrefTagSet production. + ExitConnGetReadPrefTagSet(c *ConnGetReadPrefTagSetContext) + + // ExitConnGetWriteConcern is called when exiting the connGetWriteConcern production. + ExitConnGetWriteConcern(c *ConnGetWriteConcernContext) + + // ExitConnSetReadPref is called when exiting the connSetReadPref production. + ExitConnSetReadPref(c *ConnSetReadPrefContext) + + // ExitConnSetReadConcern is called when exiting the connSetReadConcern production. + ExitConnSetReadConcern(c *ConnSetReadConcernContext) + + // ExitConnSetWriteConcern is called when exiting the connSetWriteConcern production. + ExitConnSetWriteConcern(c *ConnSetWriteConcernContext) + + // ExitConnStartSession is called when exiting the connStartSession production. + ExitConnStartSession(c *ConnStartSessionContext) + + // ExitConnWatch is called when exiting the connWatch production. + ExitConnWatch(c *ConnWatchContext) + + // ExitConnClose is called when exiting the connClose production. + ExitConnClose(c *ConnCloseContext) + + // ExitConnAdminCommand is called when exiting the connAdminCommand production. + ExitConnAdminCommand(c *ConnAdminCommandContext) + + // ExitConnGetDBNames is called when exiting the connGetDBNames production. + ExitConnGetDBNames(c *ConnGetDBNamesContext) + + // ExitConnGenericMethod is called when exiting the connGenericMethod production. + ExitConnGenericMethod(c *ConnGenericMethodContext) + // ExitDotAccess is called when exiting the dotAccess production. ExitDotAccess(c *DotAccessContext) @@ -241,6 +721,78 @@ type MongoShellParserListener interface { // ExitGetIndexesMethod is called when exiting the getIndexesMethod production. ExitGetIndexesMethod(c *GetIndexesMethodContext) + // ExitInsertOneMethod is called when exiting the insertOneMethod production. + ExitInsertOneMethod(c *InsertOneMethodContext) + + // ExitInsertManyMethod is called when exiting the insertManyMethod production. + ExitInsertManyMethod(c *InsertManyMethodContext) + + // ExitUpdateOneMethod is called when exiting the updateOneMethod production. + ExitUpdateOneMethod(c *UpdateOneMethodContext) + + // ExitUpdateManyMethod is called when exiting the updateManyMethod production. + ExitUpdateManyMethod(c *UpdateManyMethodContext) + + // ExitDeleteOneMethod is called when exiting the deleteOneMethod production. + ExitDeleteOneMethod(c *DeleteOneMethodContext) + + // ExitDeleteManyMethod is called when exiting the deleteManyMethod production. + ExitDeleteManyMethod(c *DeleteManyMethodContext) + + // ExitReplaceOneMethod is called when exiting the replaceOneMethod production. + ExitReplaceOneMethod(c *ReplaceOneMethodContext) + + // ExitFindOneAndUpdateMethod is called when exiting the findOneAndUpdateMethod production. + ExitFindOneAndUpdateMethod(c *FindOneAndUpdateMethodContext) + + // ExitFindOneAndReplaceMethod is called when exiting the findOneAndReplaceMethod production. + ExitFindOneAndReplaceMethod(c *FindOneAndReplaceMethodContext) + + // ExitFindOneAndDeleteMethod is called when exiting the findOneAndDeleteMethod production. + ExitFindOneAndDeleteMethod(c *FindOneAndDeleteMethodContext) + + // ExitCreateIndexMethod is called when exiting the createIndexMethod production. + ExitCreateIndexMethod(c *CreateIndexMethodContext) + + // ExitCreateIndexesMethod is called when exiting the createIndexesMethod production. + ExitCreateIndexesMethod(c *CreateIndexesMethodContext) + + // ExitDropIndexMethod is called when exiting the dropIndexMethod production. + ExitDropIndexMethod(c *DropIndexMethodContext) + + // ExitDropIndexesMethod is called when exiting the dropIndexesMethod production. + ExitDropIndexesMethod(c *DropIndexesMethodContext) + + // ExitDropMethod is called when exiting the dropMethod production. + ExitDropMethod(c *DropMethodContext) + + // ExitRenameCollectionMethod is called when exiting the renameCollectionMethod production. + ExitRenameCollectionMethod(c *RenameCollectionMethodContext) + + // ExitStatsMethod is called when exiting the statsMethod production. + ExitStatsMethod(c *StatsMethodContext) + + // ExitStorageSizeMethod is called when exiting the storageSizeMethod production. + ExitStorageSizeMethod(c *StorageSizeMethodContext) + + // ExitTotalIndexSizeMethod is called when exiting the totalIndexSizeMethod production. + ExitTotalIndexSizeMethod(c *TotalIndexSizeMethodContext) + + // ExitTotalSizeMethod is called when exiting the totalSizeMethod production. + ExitTotalSizeMethod(c *TotalSizeMethodContext) + + // ExitDataSizeMethod is called when exiting the dataSizeMethod production. + ExitDataSizeMethod(c *DataSizeMethodContext) + + // ExitIsCappedMethod is called when exiting the isCappedMethod production. + ExitIsCappedMethod(c *IsCappedMethodContext) + + // ExitValidateMethod is called when exiting the validateMethod production. + ExitValidateMethod(c *ValidateMethodContext) + + // ExitLatencyStatsMethod is called when exiting the latencyStatsMethod production. + ExitLatencyStatsMethod(c *LatencyStatsMethodContext) + // ExitSortMethod is called when exiting the sortMethod production. ExitSortMethod(c *SortMethodContext) @@ -256,6 +808,96 @@ type MongoShellParserListener interface { // ExitProjectionMethod is called when exiting the projectionMethod production. ExitProjectionMethod(c *ProjectionMethodContext) + // ExitBatchSizeMethod is called when exiting the batchSizeMethod production. + ExitBatchSizeMethod(c *BatchSizeMethodContext) + + // ExitCloseMethod is called when exiting the closeMethod production. + ExitCloseMethod(c *CloseMethodContext) + + // ExitCollationMethod is called when exiting the collationMethod production. + ExitCollationMethod(c *CollationMethodContext) + + // ExitCommentMethod is called when exiting the commentMethod production. + ExitCommentMethod(c *CommentMethodContext) + + // ExitExplainMethod is called when exiting the explainMethod production. + ExitExplainMethod(c *ExplainMethodContext) + + // ExitForEachMethod is called when exiting the forEachMethod production. + ExitForEachMethod(c *ForEachMethodContext) + + // ExitHasNextMethod is called when exiting the hasNextMethod production. + ExitHasNextMethod(c *HasNextMethodContext) + + // ExitHintMethod is called when exiting the hintMethod production. + ExitHintMethod(c *HintMethodContext) + + // ExitIsClosedMethod is called when exiting the isClosedMethod production. + ExitIsClosedMethod(c *IsClosedMethodContext) + + // ExitIsExhaustedMethod is called when exiting the isExhaustedMethod production. + ExitIsExhaustedMethod(c *IsExhaustedMethodContext) + + // ExitItcountMethod is called when exiting the itcountMethod production. + ExitItcountMethod(c *ItcountMethodContext) + + // ExitMapMethod is called when exiting the mapMethod production. + ExitMapMethod(c *MapMethodContext) + + // ExitMaxMethod is called when exiting the maxMethod production. + ExitMaxMethod(c *MaxMethodContext) + + // ExitMaxAwaitTimeMSMethod is called when exiting the maxAwaitTimeMSMethod production. + ExitMaxAwaitTimeMSMethod(c *MaxAwaitTimeMSMethodContext) + + // ExitMaxTimeMSMethod is called when exiting the maxTimeMSMethod production. + ExitMaxTimeMSMethod(c *MaxTimeMSMethodContext) + + // ExitMinMethod is called when exiting the minMethod production. + ExitMinMethod(c *MinMethodContext) + + // ExitNextMethod is called when exiting the nextMethod production. + ExitNextMethod(c *NextMethodContext) + + // ExitNoCursorTimeoutMethod is called when exiting the noCursorTimeoutMethod production. + ExitNoCursorTimeoutMethod(c *NoCursorTimeoutMethodContext) + + // ExitObjsLeftInBatchMethod is called when exiting the objsLeftInBatchMethod production. + ExitObjsLeftInBatchMethod(c *ObjsLeftInBatchMethodContext) + + // ExitPrettyMethod is called when exiting the prettyMethod production. + ExitPrettyMethod(c *PrettyMethodContext) + + // ExitReadConcernMethod is called when exiting the readConcernMethod production. + ExitReadConcernMethod(c *ReadConcernMethodContext) + + // ExitReadPrefMethod is called when exiting the readPrefMethod production. + ExitReadPrefMethod(c *ReadPrefMethodContext) + + // ExitReturnKeyMethod is called when exiting the returnKeyMethod production. + ExitReturnKeyMethod(c *ReturnKeyMethodContext) + + // ExitShowRecordIdMethod is called when exiting the showRecordIdMethod production. + ExitShowRecordIdMethod(c *ShowRecordIdMethodContext) + + // ExitSizeMethod is called when exiting the sizeMethod production. + ExitSizeMethod(c *SizeMethodContext) + + // ExitTailableMethod is called when exiting the tailableMethod production. + ExitTailableMethod(c *TailableMethodContext) + + // ExitToArrayMethod is called when exiting the toArrayMethod production. + ExitToArrayMethod(c *ToArrayMethodContext) + + // ExitTryNextMethod is called when exiting the tryNextMethod production. + ExitTryNextMethod(c *TryNextMethodContext) + + // ExitAllowDiskUseMethod is called when exiting the allowDiskUseMethod production. + ExitAllowDiskUseMethod(c *AllowDiskUseMethodContext) + + // ExitAddOptionMethod is called when exiting the addOptionMethod production. + ExitAddOptionMethod(c *AddOptionMethodContext) + // ExitGenericMethod is called when exiting the genericMethod production. ExitGenericMethod(c *GenericMethodContext) @@ -340,6 +982,18 @@ type MongoShellParserListener interface { // ExitRegExpConstructor is called when exiting the regExpConstructor production. ExitRegExpConstructor(c *RegExpConstructorContext) + // ExitBinDataHelper is called when exiting the binDataHelper production. + ExitBinDataHelper(c *BinDataHelperContext) + + // ExitBinaryHelper is called when exiting the binaryHelper production. + ExitBinaryHelper(c *BinaryHelperContext) + + // ExitBsonRegExpHelper is called when exiting the bsonRegExpHelper production. + ExitBsonRegExpHelper(c *BsonRegExpHelperContext) + + // ExitHexDataHelper is called when exiting the hexDataHelper production. + ExitHexDataHelper(c *HexDataHelperContext) + // ExitStringLiteralValue is called when exiting the stringLiteralValue production. ExitStringLiteralValue(c *StringLiteralValueContext) diff --git a/mongodb/mongoshellparser_visitor.go b/mongodb/mongoshellparser_visitor.go index 2849981..774b442 100644 --- a/mongodb/mongoshellparser_visitor.go +++ b/mongodb/mongoshellparser_visitor.go @@ -25,9 +25,162 @@ type MongoShellParserVisitor interface { // Visit a parse tree produced by MongoShellParser#getCollectionInfos. VisitGetCollectionInfos(ctx *GetCollectionInfosContext) interface{} + // Visit a parse tree produced by MongoShellParser#createCollection. + VisitCreateCollection(ctx *CreateCollectionContext) interface{} + + // Visit a parse tree produced by MongoShellParser#dropDatabase. + VisitDropDatabase(ctx *DropDatabaseContext) interface{} + + // Visit a parse tree produced by MongoShellParser#dbStats. + VisitDbStats(ctx *DbStatsContext) interface{} + + // Visit a parse tree produced by MongoShellParser#serverStatus. + VisitServerStatus(ctx *ServerStatusContext) interface{} + + // Visit a parse tree produced by MongoShellParser#serverBuildInfo. + VisitServerBuildInfo(ctx *ServerBuildInfoContext) interface{} + + // Visit a parse tree produced by MongoShellParser#dbVersion. + VisitDbVersion(ctx *DbVersionContext) interface{} + + // Visit a parse tree produced by MongoShellParser#hostInfo. + VisitHostInfo(ctx *HostInfoContext) interface{} + + // Visit a parse tree produced by MongoShellParser#listCommands. + VisitListCommands(ctx *ListCommandsContext) interface{} + + // Visit a parse tree produced by MongoShellParser#runCommand. + VisitRunCommand(ctx *RunCommandContext) interface{} + + // Visit a parse tree produced by MongoShellParser#adminCommand. + VisitAdminCommand(ctx *AdminCommandContext) interface{} + + // Visit a parse tree produced by MongoShellParser#getName. + VisitGetName(ctx *GetNameContext) interface{} + + // Visit a parse tree produced by MongoShellParser#getMongo. + VisitGetMongo(ctx *GetMongoContext) interface{} + + // Visit a parse tree produced by MongoShellParser#getSiblingDB. + VisitGetSiblingDB(ctx *GetSiblingDBContext) interface{} + + // Visit a parse tree produced by MongoShellParser#dbGenericMethod. + VisitDbGenericMethod(ctx *DbGenericMethodContext) interface{} + // Visit a parse tree produced by MongoShellParser#collectionOperation. VisitCollectionOperation(ctx *CollectionOperationContext) interface{} + // Visit a parse tree produced by MongoShellParser#genericDbMethod. + VisitGenericDbMethod(ctx *GenericDbMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#bulkStatement. + VisitBulkStatement(ctx *BulkStatementContext) interface{} + + // Visit a parse tree produced by MongoShellParser#bulkInitMethod. + VisitBulkInitMethod(ctx *BulkInitMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#bulkMethodChain. + VisitBulkMethodChain(ctx *BulkMethodChainContext) interface{} + + // Visit a parse tree produced by MongoShellParser#bulkFind. + VisitBulkFind(ctx *BulkFindContext) interface{} + + // Visit a parse tree produced by MongoShellParser#bulkInsert. + VisitBulkInsert(ctx *BulkInsertContext) interface{} + + // Visit a parse tree produced by MongoShellParser#bulkRemove. + VisitBulkRemove(ctx *BulkRemoveContext) interface{} + + // Visit a parse tree produced by MongoShellParser#bulkExecute. + VisitBulkExecute(ctx *BulkExecuteContext) interface{} + + // Visit a parse tree produced by MongoShellParser#bulkGetOperations. + VisitBulkGetOperations(ctx *BulkGetOperationsContext) interface{} + + // Visit a parse tree produced by MongoShellParser#bulkToString. + VisitBulkToString(ctx *BulkToStringContext) interface{} + + // Visit a parse tree produced by MongoShellParser#bulkGenericMethod. + VisitBulkGenericMethod(ctx *BulkGenericMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#mongoConnection. + VisitMongoConnection(ctx *MongoConnectionContext) interface{} + + // Visit a parse tree produced by MongoShellParser#connectCall. + VisitConnectCall(ctx *ConnectCallContext) interface{} + + // Visit a parse tree produced by MongoShellParser#dbGetMongoChain. + VisitDbGetMongoChain(ctx *DbGetMongoChainContext) interface{} + + // Visit a parse tree produced by MongoShellParser#connectionMethodChain. + VisitConnectionMethodChain(ctx *ConnectionMethodChainContext) interface{} + + // Visit a parse tree produced by MongoShellParser#rsStatement. + VisitRsStatement(ctx *RsStatementContext) interface{} + + // Visit a parse tree produced by MongoShellParser#shStatement. + VisitShStatement(ctx *ShStatementContext) interface{} + + // Visit a parse tree produced by MongoShellParser#keyVaultStatement. + VisitKeyVaultStatement(ctx *KeyVaultStatementContext) interface{} + + // Visit a parse tree produced by MongoShellParser#clientEncryptionStatement. + VisitClientEncryptionStatement(ctx *ClientEncryptionStatementContext) interface{} + + // Visit a parse tree produced by MongoShellParser#planCacheStatement. + VisitPlanCacheStatement(ctx *PlanCacheStatementContext) interface{} + + // Visit a parse tree produced by MongoShellParser#spStatement. + VisitSpStatement(ctx *SpStatementContext) interface{} + + // Visit a parse tree produced by MongoShellParser#nativeFunctionCall. + VisitNativeFunctionCall(ctx *NativeFunctionCallContext) interface{} + + // Visit a parse tree produced by MongoShellParser#connGetDB. + VisitConnGetDB(ctx *ConnGetDBContext) interface{} + + // Visit a parse tree produced by MongoShellParser#connGetReadConcern. + VisitConnGetReadConcern(ctx *ConnGetReadConcernContext) interface{} + + // Visit a parse tree produced by MongoShellParser#connGetReadPref. + VisitConnGetReadPref(ctx *ConnGetReadPrefContext) interface{} + + // Visit a parse tree produced by MongoShellParser#connGetReadPrefMode. + VisitConnGetReadPrefMode(ctx *ConnGetReadPrefModeContext) interface{} + + // Visit a parse tree produced by MongoShellParser#connGetReadPrefTagSet. + VisitConnGetReadPrefTagSet(ctx *ConnGetReadPrefTagSetContext) interface{} + + // Visit a parse tree produced by MongoShellParser#connGetWriteConcern. + VisitConnGetWriteConcern(ctx *ConnGetWriteConcernContext) interface{} + + // Visit a parse tree produced by MongoShellParser#connSetReadPref. + VisitConnSetReadPref(ctx *ConnSetReadPrefContext) interface{} + + // Visit a parse tree produced by MongoShellParser#connSetReadConcern. + VisitConnSetReadConcern(ctx *ConnSetReadConcernContext) interface{} + + // Visit a parse tree produced by MongoShellParser#connSetWriteConcern. + VisitConnSetWriteConcern(ctx *ConnSetWriteConcernContext) interface{} + + // Visit a parse tree produced by MongoShellParser#connStartSession. + VisitConnStartSession(ctx *ConnStartSessionContext) interface{} + + // Visit a parse tree produced by MongoShellParser#connWatch. + VisitConnWatch(ctx *ConnWatchContext) interface{} + + // Visit a parse tree produced by MongoShellParser#connClose. + VisitConnClose(ctx *ConnCloseContext) interface{} + + // Visit a parse tree produced by MongoShellParser#connAdminCommand. + VisitConnAdminCommand(ctx *ConnAdminCommandContext) interface{} + + // Visit a parse tree produced by MongoShellParser#connGetDBNames. + VisitConnGetDBNames(ctx *ConnGetDBNamesContext) interface{} + + // Visit a parse tree produced by MongoShellParser#connGenericMethod. + VisitConnGenericMethod(ctx *ConnGenericMethodContext) interface{} + // Visit a parse tree produced by MongoShellParser#dotAccess. VisitDotAccess(ctx *DotAccessContext) interface{} @@ -64,6 +217,78 @@ type MongoShellParserVisitor interface { // Visit a parse tree produced by MongoShellParser#getIndexesMethod. VisitGetIndexesMethod(ctx *GetIndexesMethodContext) interface{} + // Visit a parse tree produced by MongoShellParser#insertOneMethod. + VisitInsertOneMethod(ctx *InsertOneMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#insertManyMethod. + VisitInsertManyMethod(ctx *InsertManyMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#updateOneMethod. + VisitUpdateOneMethod(ctx *UpdateOneMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#updateManyMethod. + VisitUpdateManyMethod(ctx *UpdateManyMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#deleteOneMethod. + VisitDeleteOneMethod(ctx *DeleteOneMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#deleteManyMethod. + VisitDeleteManyMethod(ctx *DeleteManyMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#replaceOneMethod. + VisitReplaceOneMethod(ctx *ReplaceOneMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#findOneAndUpdateMethod. + VisitFindOneAndUpdateMethod(ctx *FindOneAndUpdateMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#findOneAndReplaceMethod. + VisitFindOneAndReplaceMethod(ctx *FindOneAndReplaceMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#findOneAndDeleteMethod. + VisitFindOneAndDeleteMethod(ctx *FindOneAndDeleteMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#createIndexMethod. + VisitCreateIndexMethod(ctx *CreateIndexMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#createIndexesMethod. + VisitCreateIndexesMethod(ctx *CreateIndexesMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#dropIndexMethod. + VisitDropIndexMethod(ctx *DropIndexMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#dropIndexesMethod. + VisitDropIndexesMethod(ctx *DropIndexesMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#dropMethod. + VisitDropMethod(ctx *DropMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#renameCollectionMethod. + VisitRenameCollectionMethod(ctx *RenameCollectionMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#statsMethod. + VisitStatsMethod(ctx *StatsMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#storageSizeMethod. + VisitStorageSizeMethod(ctx *StorageSizeMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#totalIndexSizeMethod. + VisitTotalIndexSizeMethod(ctx *TotalIndexSizeMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#totalSizeMethod. + VisitTotalSizeMethod(ctx *TotalSizeMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#dataSizeMethod. + VisitDataSizeMethod(ctx *DataSizeMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#isCappedMethod. + VisitIsCappedMethod(ctx *IsCappedMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#validateMethod. + VisitValidateMethod(ctx *ValidateMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#latencyStatsMethod. + VisitLatencyStatsMethod(ctx *LatencyStatsMethodContext) interface{} + // Visit a parse tree produced by MongoShellParser#sortMethod. VisitSortMethod(ctx *SortMethodContext) interface{} @@ -79,6 +304,96 @@ type MongoShellParserVisitor interface { // Visit a parse tree produced by MongoShellParser#projectionMethod. VisitProjectionMethod(ctx *ProjectionMethodContext) interface{} + // Visit a parse tree produced by MongoShellParser#batchSizeMethod. + VisitBatchSizeMethod(ctx *BatchSizeMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#closeMethod. + VisitCloseMethod(ctx *CloseMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#collationMethod. + VisitCollationMethod(ctx *CollationMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#commentMethod. + VisitCommentMethod(ctx *CommentMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#explainMethod. + VisitExplainMethod(ctx *ExplainMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#forEachMethod. + VisitForEachMethod(ctx *ForEachMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#hasNextMethod. + VisitHasNextMethod(ctx *HasNextMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#hintMethod. + VisitHintMethod(ctx *HintMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#isClosedMethod. + VisitIsClosedMethod(ctx *IsClosedMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#isExhaustedMethod. + VisitIsExhaustedMethod(ctx *IsExhaustedMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#itcountMethod. + VisitItcountMethod(ctx *ItcountMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#mapMethod. + VisitMapMethod(ctx *MapMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#maxMethod. + VisitMaxMethod(ctx *MaxMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#maxAwaitTimeMSMethod. + VisitMaxAwaitTimeMSMethod(ctx *MaxAwaitTimeMSMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#maxTimeMSMethod. + VisitMaxTimeMSMethod(ctx *MaxTimeMSMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#minMethod. + VisitMinMethod(ctx *MinMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#nextMethod. + VisitNextMethod(ctx *NextMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#noCursorTimeoutMethod. + VisitNoCursorTimeoutMethod(ctx *NoCursorTimeoutMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#objsLeftInBatchMethod. + VisitObjsLeftInBatchMethod(ctx *ObjsLeftInBatchMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#prettyMethod. + VisitPrettyMethod(ctx *PrettyMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#readConcernMethod. + VisitReadConcernMethod(ctx *ReadConcernMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#readPrefMethod. + VisitReadPrefMethod(ctx *ReadPrefMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#returnKeyMethod. + VisitReturnKeyMethod(ctx *ReturnKeyMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#showRecordIdMethod. + VisitShowRecordIdMethod(ctx *ShowRecordIdMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#sizeMethod. + VisitSizeMethod(ctx *SizeMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#tailableMethod. + VisitTailableMethod(ctx *TailableMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#toArrayMethod. + VisitToArrayMethod(ctx *ToArrayMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#tryNextMethod. + VisitTryNextMethod(ctx *TryNextMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#allowDiskUseMethod. + VisitAllowDiskUseMethod(ctx *AllowDiskUseMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#addOptionMethod. + VisitAddOptionMethod(ctx *AddOptionMethodContext) interface{} + // Visit a parse tree produced by MongoShellParser#genericMethod. VisitGenericMethod(ctx *GenericMethodContext) interface{} @@ -163,6 +478,18 @@ type MongoShellParserVisitor interface { // Visit a parse tree produced by MongoShellParser#regExpConstructor. VisitRegExpConstructor(ctx *RegExpConstructorContext) interface{} + // Visit a parse tree produced by MongoShellParser#binDataHelper. + VisitBinDataHelper(ctx *BinDataHelperContext) interface{} + + // Visit a parse tree produced by MongoShellParser#binaryHelper. + VisitBinaryHelper(ctx *BinaryHelperContext) interface{} + + // Visit a parse tree produced by MongoShellParser#bsonRegExpHelper. + VisitBsonRegExpHelper(ctx *BsonRegExpHelperContext) interface{} + + // Visit a parse tree produced by MongoShellParser#hexDataHelper. + VisitHexDataHelper(ctx *HexDataHelperContext) interface{} + // Visit a parse tree produced by MongoShellParser#stringLiteralValue. VisitStringLiteralValue(ctx *StringLiteralValueContext) interface{}