diff --git a/mongodb/MongoShellLexer.g4 b/mongodb/MongoShellLexer.g4 index 0605bef..521878f 100644 --- a/mongodb/MongoShellLexer.g4 +++ b/mongodb/MongoShellLexer.g4 @@ -34,14 +34,22 @@ NUMBER_DECIMAL: 'NumberDecimal'; TIMESTAMP: 'Timestamp'; REG_EXP: 'RegExp'; -// Cursor modifiers (methods) +// Collection methods FIND: 'find'; FIND_ONE: 'findOne'; +COUNT_DOCUMENTS: 'countDocuments'; +ESTIMATED_DOCUMENT_COUNT: 'estimatedDocumentCount'; +DISTINCT: 'distinct'; +AGGREGATE: 'aggregate'; +GET_INDEXES: 'getIndexes'; + +// Cursor modifiers (methods) SORT: 'sort'; LIMIT: 'limit'; SKIP_: 'skip'; PROJECTION: 'projection'; PROJECT: 'project'; +COUNT: 'count'; // Punctuation LPAREN: '('; diff --git a/mongodb/MongoShellParser.g4 b/mongodb/MongoShellParser.g4 index 4906d45..3b4631d 100644 --- a/mongodb/MongoShellParser.g4 +++ b/mongodb/MongoShellParser.g4 @@ -2,12 +2,14 @@ * MongoDB Shell (mongosh) Parser Grammar * For use with ANTLR 4 * - * Supports MVP read operations: + * Milestone 1: Read Operations + Utility + Aggregation * - Shell commands: show dbs, show databases, show collections - * - Database statements: db.collection.method(...) - * - Read methods: find(), findOne() - * - Cursor modifiers: sort(), limit(), skip(), projection(), project() - * - Helper functions: ObjectId(), ISODate(), UUID(), Long(), etc. + * - 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 */ @@ -55,9 +57,15 @@ methodChain methodCall : findMethod | findOneMethod + | countDocumentsMethod + | estimatedDocumentCountMethod + | distinctMethod + | aggregateMethod + | getIndexesMethod | sortMethod | limitMethod | skipMethod + | countMethod | projectionMethod | genericMethod ; @@ -71,6 +79,31 @@ findOneMethod : FIND_ONE LPAREN argument? RPAREN ; +// countDocuments(filter?, options?) +countDocumentsMethod + : COUNT_DOCUMENTS LPAREN arguments? RPAREN + ; + +// estimatedDocumentCount(options?) +estimatedDocumentCountMethod + : ESTIMATED_DOCUMENT_COUNT LPAREN argument? RPAREN + ; + +// distinct(field, query?, options?) +distinctMethod + : DISTINCT LPAREN arguments RPAREN + ; + +// aggregate(pipeline, options?) +aggregateMethod + : AGGREGATE LPAREN arguments RPAREN + ; + +// getIndexes() +getIndexesMethod + : GET_INDEXES LPAREN RPAREN + ; + sortMethod : SORT LPAREN document RPAREN ; @@ -83,6 +116,11 @@ skipMethod : SKIP_ LPAREN NUMBER RPAREN ; +// cursor.count() - returns count of documents matching the query +countMethod + : COUNT LPAREN RPAREN + ; + projectionMethod : (PROJECTION | PROJECT) LPAREN document RPAREN ; @@ -125,6 +163,14 @@ value | REGEX_LITERAL # regexLiteralValue | regExpConstructor # regexpConstructorValue | literal # literalValue + | newKeywordError # newKeywordValue + ; + +// 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) + { p.NotifyErrorListeners("'new' keyword is not supported. Use ObjectId(), ISODate(), UUID(), etc. directly without 'new'", nil, nil) } + LPAREN arguments? RPAREN ; // Array: [ value, ... ] with optional trailing comma @@ -149,19 +195,16 @@ helperFunction // ObjectId("hex") or ObjectId() objectIdHelper : OBJECT_ID LPAREN stringLiteral? RPAREN - | NEW OBJECT_ID { p.NotifyErrorListeners("'new' keyword is not supported. Use ObjectId() directly", nil, nil) } ; // ISODate("iso-string") or ISODate() isoDateHelper : ISO_DATE LPAREN stringLiteral? RPAREN - | NEW ISO_DATE { p.NotifyErrorListeners("'new' keyword is not supported. Use ISODate() directly", nil, nil) } ; // Date() or Date("string") or Date(timestamp) dateHelper : DATE LPAREN (stringLiteral | NUMBER)? RPAREN - | NEW DATE { p.NotifyErrorListeners("'new' keyword is not supported. Use Date() directly", nil, nil) } ; // UUID("uuid-string") @@ -198,7 +241,6 @@ timestampHelper // RegExp("pattern", "flags") constructor regExpConstructor : REG_EXP LPAREN stringLiteral (COMMA stringLiteral)? RPAREN - | NEW REG_EXP { p.NotifyErrorListeners("'new' keyword is not supported. Use RegExp() directly", nil, nil) } ; // Literals @@ -233,9 +275,15 @@ identifier | NULL | FIND | FIND_ONE + | COUNT_DOCUMENTS + | ESTIMATED_DOCUMENT_COUNT + | DISTINCT + | AGGREGATE + | GET_INDEXES | SORT | LIMIT | SKIP_ + | COUNT | PROJECTION | PROJECT | GET_COLLECTION diff --git a/mongodb/examples/collection-aggregate.js b/mongodb/examples/collection-aggregate.js new file mode 100644 index 0000000..83c9193 --- /dev/null +++ b/mongodb/examples/collection-aggregate.js @@ -0,0 +1,107 @@ +// db.collection.aggregate() - Aggregation pipeline + +// Empty pipeline +db.orders.aggregate([]) + +// Single stage pipelines +db.orders.aggregate([{ $match: { status: "completed" } }]) +db.orders.aggregate([{ $group: { _id: "$category", count: { $sum: 1 } } }]) +db.orders.aggregate([{ $sort: { createdAt: -1 } }]) +db.orders.aggregate([{ $limit: 10 }]) +db.orders.aggregate([{ $skip: 20 }]) +db.orders.aggregate([{ $project: { name: 1, total: 1, _id: 0 } }]) +db.orders.aggregate([{ $unwind: "$items" }]) +db.orders.aggregate([{ $count: "totalOrders" }]) + +// $match stage variations +db.users.aggregate([{ $match: { age: { $gt: 18 } } }]) +db.users.aggregate([{ $match: { status: { $in: ["active", "pending"] } } }]) +db.users.aggregate([{ $match: { $or: [{ role: "admin" }, { role: "moderator" }] } }]) +db.users.aggregate([{ $match: { "address.country": "USA" } }]) + +// $group stage variations +db.orders.aggregate([{ $group: { _id: "$customerId", total: { $sum: "$amount" } } }]) +db.orders.aggregate([{ $group: { _id: "$category", avgPrice: { $avg: "$price" } } }]) +db.orders.aggregate([{ $group: { _id: "$status", count: { $sum: 1 }, items: { $push: "$name" } } }]) +db.orders.aggregate([{ $group: { _id: null, totalRevenue: { $sum: "$amount" } } }]) +db.sales.aggregate([{ $group: { _id: { year: { $year: "$date" }, month: { $month: "$date" } }, total: { $sum: "$amount" } } }]) + +// $project stage variations +db.users.aggregate([{ $project: { name: 1, email: 1 } }]) +db.users.aggregate([{ $project: { password: 0, ssn: 0 } }]) +db.users.aggregate([{ $project: { fullName: { $concat: ["$firstName", " ", "$lastName"] } } }]) +db.orders.aggregate([{ $project: { total: { $multiply: ["$price", "$quantity"] } } }]) + +// $sort stage variations +db.users.aggregate([{ $sort: { name: 1 } }]) +db.users.aggregate([{ $sort: { createdAt: -1 } }]) +db.users.aggregate([{ $sort: { lastName: 1, firstName: 1 } }]) + +// $lookup stage (join) +db.orders.aggregate([{ $lookup: { from: "users", localField: "customerId", foreignField: "_id", as: "customer" } }]) +db.orders.aggregate([{ $lookup: { from: "products", localField: "productIds", foreignField: "_id", as: "products" } }]) + +// Multi-stage pipelines +db.orders.aggregate([ + { $match: { status: "completed" } }, + { $group: { _id: "$customerId", total: { $sum: "$amount" } } }, + { $sort: { total: -1 } }, + { $limit: 10 } +]) + +db.sales.aggregate([ + { $match: { date: { $gte: ISODate("2024-01-01"), $lt: ISODate("2025-01-01") } } }, + { $group: { + _id: { year: { $year: "$date" }, month: { $month: "$date" } }, + totalRevenue: { $sum: "$amount" }, + avgOrderValue: { $avg: "$amount" }, + orderCount: { $sum: 1 } + } }, + { $sort: { "_id.year": 1, "_id.month": 1 } } +]) + +db.users.aggregate([ + { $match: { status: "active" } }, + { $lookup: { from: "orders", localField: "_id", foreignField: "customerId", as: "orders" } }, + { $project: { name: 1, email: 1, orderCount: { $size: "$orders" } } }, + { $sort: { orderCount: -1 } }, + { $limit: 100 } +]) + +// Pipeline with $addFields +db.orders.aggregate([ + { $addFields: { totalWithTax: { $multiply: ["$total", 1.1] } } } +]) + +// Pipeline with $set (alias for $addFields) +db.orders.aggregate([ + { $set: { processed: true, processedAt: ISODate() } } +]) + +// Pipeline with $unset +db.users.aggregate([ + { $unset: ["password", "ssn", "internalNotes"] } +]) + +// Pipeline with $replaceRoot +db.orders.aggregate([ + { $replaceRoot: { newRoot: "$shipping" } } +]) + +// Pipeline with $facet (multiple pipelines) +db.products.aggregate([ + { $facet: { + categoryCounts: [{ $group: { _id: "$category", count: { $sum: 1 } } }], + priceStats: [{ $group: { _id: null, avgPrice: { $avg: "$price" }, maxPrice: { $max: "$price" } } }] + } } +]) + +// Aggregate with options (options passed to driver) +db.orders.aggregate([{ $match: { status: "completed" } }], { allowDiskUse: true }) +db.orders.aggregate([{ $group: { _id: "$category" } }], { maxTimeMS: 60000 }) +db.orders.aggregate([{ $sort: { total: -1 } }], { collation: { locale: "en" } }) + +// Aggregate with collection access patterns +db["orders"].aggregate([{ $match: { status: "pending" } }]) +db['audit-logs'].aggregate([{ $group: { _id: "$action", count: { $sum: 1 } } }]) +db.getCollection("sales").aggregate([{ $match: { year: 2024 } }]) diff --git a/mongodb/examples/collection-countDocuments.js b/mongodb/examples/collection-countDocuments.js new file mode 100644 index 0000000..95c1d4f --- /dev/null +++ b/mongodb/examples/collection-countDocuments.js @@ -0,0 +1,45 @@ +// db.collection.countDocuments() - Count documents matching a filter + +// Count all documents +db.users.countDocuments() +db.users.countDocuments({}) + +// Count with simple filter +db.users.countDocuments({ status: "active" }) +db.users.countDocuments({ verified: true }) +db.users.countDocuments({ role: "admin" }) + +// Count with comparison operators +db.users.countDocuments({ age: { $gt: 18 } }) +db.users.countDocuments({ age: { $gte: 21, $lt: 65 } }) +db.users.countDocuments({ loginCount: { $gte: 10 } }) + +// Count with logical operators +db.users.countDocuments({ $or: [{ status: "active" }, { status: "pending" }] }) +db.users.countDocuments({ $and: [{ verified: true }, { active: true }] }) + +// Count with array operators +db.users.countDocuments({ tags: { $in: ["premium", "enterprise"] } }) +db.users.countDocuments({ roles: { $all: ["read", "write"] } }) + +// Count with existence check +db.users.countDocuments({ email: { $exists: true } }) +db.users.countDocuments({ deletedAt: { $exists: false } }) + +// Count with nested documents +db.users.countDocuments({ "address.country": "USA" }) +db.users.countDocuments({ "profile.verified": true }) + +// Count with helper functions +db.users.countDocuments({ createdAt: { $gt: ISODate("2024-01-01") } }) +db.users.countDocuments({ lastLogin: { $lt: ISODate("2024-06-01") } }) + +// Count with options (options passed to driver) +db.users.countDocuments({ status: "active" }, { skip: 10, limit: 100 }) +db.users.countDocuments({ verified: true }, { maxTimeMS: 5000 }) +db.users.countDocuments({}, { hint: { status: 1 } }) + +// Count with collection access patterns +db["users"].countDocuments({ active: true }) +db['audit-logs'].countDocuments({ level: "error" }) +db.getCollection("orders").countDocuments({ status: "completed" }) diff --git a/mongodb/examples/collection-distinct.js b/mongodb/examples/collection-distinct.js new file mode 100644 index 0000000..6deb17a --- /dev/null +++ b/mongodb/examples/collection-distinct.js @@ -0,0 +1,43 @@ +// db.collection.distinct() - Find distinct values for a field + +// Distinct with field only (required) +db.users.distinct("status") +db.users.distinct("country") +db.users.distinct("role") +db.orders.distinct("category") +db.products.distinct("brand") + +// Distinct with nested field +db.users.distinct("address.city") +db.users.distinct("address.country") +db.users.distinct("profile.department") + +// Distinct with field and empty query +db.users.distinct("status", {}) +db.users.distinct("city", {}) + +// Distinct with field and filter query +db.users.distinct("city", { country: "USA" }) +db.users.distinct("status", { active: true }) +db.users.distinct("role", { department: "engineering" }) +db.orders.distinct("productId", { status: "completed" }) + +// Distinct with comparison operators in query +db.users.distinct("city", { age: { $gt: 18 } }) +db.users.distinct("status", { createdAt: { $gt: ISODate("2024-01-01") } }) + +// Distinct with logical operators in query +db.users.distinct("role", { $or: [{ active: true }, { verified: true }] }) +db.users.distinct("department", { $and: [{ status: "active" }, { role: "employee" }] }) + +// Distinct with array operators in query +db.users.distinct("city", { tags: { $in: ["premium", "enterprise"] } }) + +// Distinct with field, query, and options (options passed to driver) +db.users.distinct("email", { status: "active" }, { collation: { locale: "en" } }) +db.users.distinct("name", {}, { maxTimeMS: 5000 }) + +// Distinct with collection access patterns +db["users"].distinct("status") +db['audit-logs'].distinct("action") +db.getCollection("orders").distinct("status", { year: 2024 }) diff --git a/mongodb/examples/collection-estimatedDocumentCount.js b/mongodb/examples/collection-estimatedDocumentCount.js new file mode 100644 index 0000000..6f39356 --- /dev/null +++ b/mongodb/examples/collection-estimatedDocumentCount.js @@ -0,0 +1,17 @@ +// db.collection.estimatedDocumentCount() - Fast estimated count using collection metadata + +// Basic estimated count (no filter - uses metadata) +db.users.estimatedDocumentCount() +db.orders.estimatedDocumentCount() +db.products.estimatedDocumentCount() + +// Estimated count with options (options passed to driver) +db.users.estimatedDocumentCount({}) +db.users.estimatedDocumentCount({ maxTimeMS: 1000 }) +db.users.estimatedDocumentCount({ maxTimeMS: 5000 }) + +// Estimated count with collection access patterns +db["users"].estimatedDocumentCount() +db['audit-logs'].estimatedDocumentCount() +db.getCollection("orders").estimatedDocumentCount() +db.getCollection("large-collection").estimatedDocumentCount({ maxTimeMS: 10000 }) diff --git a/mongodb/examples/collection-find.js b/mongodb/examples/collection-find.js new file mode 100644 index 0000000..72d3e51 --- /dev/null +++ b/mongodb/examples/collection-find.js @@ -0,0 +1,76 @@ +// db.collection.find() - Query documents in a collection + +// Basic find +db.users.find() +db.users.find({}) + +// Find with simple filter +db.users.find({ name: "alice" }) +db.users.find({ age: 25 }) +db.users.find({ status: "active" }) + +// Find with comparison operators +db.users.find({ age: { $gt: 25 } }) +db.users.find({ age: { $gte: 18 } }) +db.users.find({ age: { $lt: 65 } }) +db.users.find({ age: { $lte: 30 } }) +db.users.find({ age: { $ne: 0 } }) +db.users.find({ age: { $gte: 18, $lt: 65 } }) + +// Find with array operators +db.users.find({ status: { $in: ["active", "pending"] } }) +db.users.find({ status: { $nin: ["deleted", "banned"] } }) +db.users.find({ tags: { $all: ["mongodb", "database"] } }) +db.users.find({ scores: { $elemMatch: { $gt: 80, $lt: 90 } } }) + +// Find with logical operators +db.users.find({ $or: [{ name: "alice" }, { name: "bob" }] }) +db.users.find({ $and: [{ age: { $gt: 18 } }, { status: "active" }] }) +db.users.find({ age: { $not: { $lt: 18 } } }) +db.users.find({ $nor: [{ status: "deleted" }, { status: "banned" }] }) + +// Find with nested documents +db.users.find({ "address.city": "New York" }) +db.users.find({ "profile.settings.theme": "dark" }) +db.users.find({ profile: { name: "test", active: true } }) + +// Find with array fields +db.users.find({ tags: "mongodb" }) +db.users.find({ "tags.0": "primary" }) + +// Find with existence check +db.users.find({ email: { $exists: true } }) +db.users.find({ deletedAt: { $exists: false } }) + +// Find with type check +db.users.find({ age: { $type: "number" } }) +db.users.find({ name: { $type: "string" } }) + +// Find with regex +db.users.find({ name: /^alice/i }) +db.users.find({ email: { $regex: /.*@example\.com$/ } }) + +// Find with helper functions +db.users.find({ _id: ObjectId("507f1f77bcf86cd799439011") }) +db.users.find({ createdAt: { $gt: ISODate("2024-01-01T00:00:00Z") } }) +db.users.find({ sessionId: UUID("550e8400-e29b-41d4-a716-446655440000") }) + +// Find with cursor modifiers +db.users.find().sort({ age: -1 }) +db.users.find().limit(10) +db.users.find().skip(5) +db.users.find().count() +db.users.find().projection({ name: 1, age: 1 }) +db.users.find().project({ name: 1, email: 1, _id: 0 }) + +// Find with chained cursor modifiers +db.users.find().sort({ age: -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) +db.users.find({ status: "active" }).sort({ name: 1 }).limit(100).count() + +// Find with collection access patterns +db["users"].find({ name: "alice" }) +db['user-logs'].find({ level: "error" }) +db.getCollection("users").find({ active: true }) +db.getCollection("my.collection").find() diff --git a/mongodb/examples/collection-findOne.js b/mongodb/examples/collection-findOne.js new file mode 100644 index 0000000..661d1cb --- /dev/null +++ b/mongodb/examples/collection-findOne.js @@ -0,0 +1,36 @@ +// db.collection.findOne() - Find a single document in a collection + +// Basic findOne +db.users.findOne() +db.users.findOne({}) + +// FindOne with simple filter +db.users.findOne({ name: "alice" }) +db.users.findOne({ _id: ObjectId("507f1f77bcf86cd799439011") }) +db.users.findOne({ email: "alice@example.com" }) + +// FindOne with comparison operators +db.users.findOne({ age: { $gt: 18 } }) +db.users.findOne({ age: { $gte: 21, $lt: 65 } }) + +// FindOne with logical operators +db.users.findOne({ $or: [{ name: "alice" }, { email: "alice@example.com" }] }) +db.users.findOne({ $and: [{ status: "active" }, { verified: true }] }) + +// FindOne with nested documents +db.users.findOne({ "address.city": "New York" }) +db.users.findOne({ "profile.settings.notifications": true }) + +// FindOne with array operators +db.users.findOne({ tags: { $in: ["admin", "moderator"] } }) +db.users.findOne({ roles: { $all: ["read", "write"] } }) + +// FindOne with helper functions +db.users.findOne({ createdAt: { $gt: ISODate("2024-01-01") } }) +db.sessions.findOne({ sessionId: UUID("550e8400-e29b-41d4-a716-446655440000") }) +db.orders.findOne({ total: NumberDecimal("99.99") }) + +// FindOne with collection access patterns +db["users"].findOne({ name: "bob" }) +db['audit-logs'].findOne({ action: "login" }) +db.getCollection("users").findOne({ active: true }) diff --git a/mongodb/examples/collection-getIndexes.js b/mongodb/examples/collection-getIndexes.js new file mode 100644 index 0000000..8a5308a --- /dev/null +++ b/mongodb/examples/collection-getIndexes.js @@ -0,0 +1,15 @@ +// db.collection.getIndexes() - Get all indexes on a collection + +// Basic getIndexes +db.users.getIndexes() +db.orders.getIndexes() +db.products.getIndexes() +db.sessions.getIndexes() + +// GetIndexes with collection access patterns +db["users"].getIndexes() +db['audit-logs'].getIndexes() +db["user-sessions"].getIndexes() +db.getCollection("users").getIndexes() +db.getCollection("my.collection").getIndexes() +db.getCollection("special-collection").getIndexes() diff --git a/mongodb/examples/collection_access.js b/mongodb/examples/collection_access.js deleted file mode 100644 index 88f9033..0000000 --- a/mongodb/examples/collection_access.js +++ /dev/null @@ -1,14 +0,0 @@ -// Collection access patterns -db.users.find() -db["users"].find() -db['users'].find() -db.getCollection("users").find() -db.getCollection('users').find() - -// Collection names with special characters -db["user-logs"].find() -db["my.collection"].find() -db.getCollection("user-events").find() - -// Method on getCollectionNames -db.getCollectionNames() diff --git a/mongodb/examples/cursor_modifiers.js b/mongodb/examples/cursor_modifiers.js deleted file mode 100644 index 4b1a130..0000000 --- a/mongodb/examples/cursor_modifiers.js +++ /dev/null @@ -1,17 +0,0 @@ -// Cursor modifiers -db.users.find().sort({ age: -1 }) -db.users.find().limit(10) -db.users.find().skip(5) -db.users.find().projection({ name: 1, age: 1 }) -db.users.find().project({ name: 1, email: 1 }) - -// Chained modifiers -db.users.find().sort({ age: -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) - -// With projection -db.users.find().sort({ age: 1 }).projection({ name: 1, age: 1, _id: 0 }) - -// Complex query with all modifiers -db.users.find({ age: { $gt: 18 } }).sort({ lastName: 1, firstName: 1 }).skip(10).limit(20).projection({ firstName: 1, lastName: 1, email: 1 }) diff --git a/mongodb/examples/find_operations.js b/mongodb/examples/find_operations.js deleted file mode 100644 index 63d2d48..0000000 --- a/mongodb/examples/find_operations.js +++ /dev/null @@ -1,25 +0,0 @@ -// Basic find operations -db.users.find() -db.users.find({}) -db.users.findOne() -db.users.findOne({}) - -// Find with filter -db.users.find({ name: "alice" }) -db.users.find({ age: 25 }) -db.users.findOne({ name: "bob" }) - -// Find with query operators -db.users.find({ age: { $gt: 25 } }) -db.users.find({ age: { $gte: 18, $lt: 65 } }) -db.users.find({ status: { $in: ["active", "pending"] } }) -db.users.find({ $or: [{ name: "alice" }, { name: "bob" }] }) -db.users.find({ tags: { $all: ["mongodb", "database"] } }) - -// Find with nested documents -db.users.find({ "address.city": "New York" }) -db.users.find({ profile: { name: "test", active: true } }) - -// Find with array fields -db.users.find({ tags: "mongodb" }) -db.users.find({ scores: { $elemMatch: { $gt: 80, $lt: 90 } } }) diff --git a/mongodb/mongoshell_lexer.go b/mongodb/mongoshell_lexer.go index 89c6c61..04797dc 100644 --- a/mongodb/mongoshell_lexer.go +++ b/mongodb/mongoshell_lexer.go @@ -48,35 +48,39 @@ func mongoshelllexerLexerInit() { "'getCollectionInfos'", "'ObjectId'", "'ISODate'", "'Date'", "'UUID'", "'Long'", "'NumberLong'", "'Int32'", "'NumberInt'", "'Double'", "'Decimal128'", "'NumberDecimal'", "'Timestamp'", "'RegExp'", "'find'", "'findOne'", - "'sort'", "'limit'", "'skip'", "'projection'", "'project'", "'('", "')'", - "'{'", "'}'", "'['", "']'", "':'", "','", "'.'", "';'", "'$'", + "'countDocuments'", "'estimatedDocumentCount'", "'distinct'", "'aggregate'", + "'getIndexes'", "'sort'", "'limit'", "'skip'", "'projection'", "'project'", + "'count'", "'('", "')'", "'{'", "'}'", "'['", "']'", "':'", "','", "'.'", + "';'", "'$'", } 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", "SORT", "LIMIT", "SKIP_", "PROJECTION", - "PROJECT", "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", "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", } 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", "SORT", "LIMIT", "SKIP_", "PROJECTION", - "PROJECT", "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", "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", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 0, 51, 545, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, + 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, @@ -87,239 +91,276 @@ func mongoshelllexerLexerInit() { 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, 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, + 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, - 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, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 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, 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, 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, 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, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, - 31, 1, 31, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, - 1, 35, 1, 35, 1, 36, 1, 36, 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, 43, 1, 43, 5, 43, - 408, 8, 43, 10, 43, 12, 43, 411, 9, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, - 44, 1, 44, 5, 44, 419, 8, 44, 10, 44, 12, 44, 422, 9, 44, 1, 44, 1, 44, - 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 45, 3, 45, 433, 8, 45, 1, - 46, 4, 46, 436, 8, 46, 11, 46, 12, 46, 437, 1, 47, 1, 47, 1, 47, 3, 47, - 443, 8, 47, 1, 48, 4, 48, 446, 8, 48, 11, 48, 12, 48, 447, 1, 49, 3, 49, - 451, 8, 49, 1, 49, 1, 49, 1, 49, 4, 49, 456, 8, 49, 11, 49, 12, 49, 457, - 3, 49, 460, 8, 49, 1, 49, 3, 49, 463, 8, 49, 1, 49, 3, 49, 466, 8, 49, - 1, 49, 1, 49, 4, 49, 470, 8, 49, 11, 49, 12, 49, 471, 1, 49, 3, 49, 475, - 8, 49, 3, 49, 477, 8, 49, 1, 50, 1, 50, 1, 50, 5, 50, 482, 8, 50, 10, 50, - 12, 50, 485, 9, 50, 3, 50, 487, 8, 50, 1, 51, 1, 51, 3, 51, 491, 8, 51, - 1, 51, 4, 51, 494, 8, 51, 11, 51, 12, 51, 495, 1, 52, 1, 52, 1, 52, 5, - 52, 501, 8, 52, 10, 52, 12, 52, 504, 9, 52, 1, 52, 1, 52, 1, 53, 1, 53, - 1, 53, 5, 53, 511, 8, 53, 10, 53, 12, 53, 514, 9, 53, 1, 53, 1, 53, 1, - 54, 1, 54, 1, 54, 1, 54, 3, 54, 522, 8, 54, 1, 55, 1, 55, 1, 55, 1, 55, - 1, 55, 1, 55, 1, 56, 1, 56, 1, 57, 1, 57, 5, 57, 534, 8, 57, 10, 57, 12, - 57, 537, 9, 57, 1, 58, 4, 58, 540, 8, 58, 11, 58, 12, 58, 541, 1, 58, 1, - 58, 1, 420, 0, 59, 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, 0, 95, 0, 97, 0, 99, 47, 101, 0, 103, 0, 105, 48, 107, - 49, 109, 0, 111, 0, 113, 0, 115, 50, 117, 51, 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, 562, 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, 99, 1, 0, 0, 0, 0, 105, 1, 0, 0, 0, 0, 107, 1, 0, - 0, 0, 0, 115, 1, 0, 0, 0, 0, 117, 1, 0, 0, 0, 1, 119, 1, 0, 0, 0, 3, 124, - 1, 0, 0, 0, 5, 128, 1, 0, 0, 0, 7, 138, 1, 0, 0, 0, 9, 150, 1, 0, 0, 0, - 11, 153, 1, 0, 0, 0, 13, 157, 1, 0, 0, 0, 15, 162, 1, 0, 0, 0, 17, 168, - 1, 0, 0, 0, 19, 173, 1, 0, 0, 0, 21, 187, 1, 0, 0, 0, 23, 206, 1, 0, 0, - 0, 25, 225, 1, 0, 0, 0, 27, 234, 1, 0, 0, 0, 29, 242, 1, 0, 0, 0, 31, 247, - 1, 0, 0, 0, 33, 252, 1, 0, 0, 0, 35, 257, 1, 0, 0, 0, 37, 268, 1, 0, 0, - 0, 39, 274, 1, 0, 0, 0, 41, 284, 1, 0, 0, 0, 43, 291, 1, 0, 0, 0, 45, 302, - 1, 0, 0, 0, 47, 316, 1, 0, 0, 0, 49, 326, 1, 0, 0, 0, 51, 333, 1, 0, 0, - 0, 53, 338, 1, 0, 0, 0, 55, 346, 1, 0, 0, 0, 57, 351, 1, 0, 0, 0, 59, 357, - 1, 0, 0, 0, 61, 362, 1, 0, 0, 0, 63, 373, 1, 0, 0, 0, 65, 381, 1, 0, 0, - 0, 67, 383, 1, 0, 0, 0, 69, 385, 1, 0, 0, 0, 71, 387, 1, 0, 0, 0, 73, 389, - 1, 0, 0, 0, 75, 391, 1, 0, 0, 0, 77, 393, 1, 0, 0, 0, 79, 395, 1, 0, 0, - 0, 81, 397, 1, 0, 0, 0, 83, 399, 1, 0, 0, 0, 85, 401, 1, 0, 0, 0, 87, 403, - 1, 0, 0, 0, 89, 414, 1, 0, 0, 0, 91, 428, 1, 0, 0, 0, 93, 435, 1, 0, 0, - 0, 95, 442, 1, 0, 0, 0, 97, 445, 1, 0, 0, 0, 99, 476, 1, 0, 0, 0, 101, - 486, 1, 0, 0, 0, 103, 488, 1, 0, 0, 0, 105, 497, 1, 0, 0, 0, 107, 507, - 1, 0, 0, 0, 109, 517, 1, 0, 0, 0, 111, 523, 1, 0, 0, 0, 113, 529, 1, 0, - 0, 0, 115, 531, 1, 0, 0, 0, 117, 539, 1, 0, 0, 0, 119, 120, 5, 115, 0, - 0, 120, 121, 5, 104, 0, 0, 121, 122, 5, 111, 0, 0, 122, 123, 5, 119, 0, - 0, 123, 2, 1, 0, 0, 0, 124, 125, 5, 100, 0, 0, 125, 126, 5, 98, 0, 0, 126, - 127, 5, 115, 0, 0, 127, 4, 1, 0, 0, 0, 128, 129, 5, 100, 0, 0, 129, 130, - 5, 97, 0, 0, 130, 131, 5, 116, 0, 0, 131, 132, 5, 97, 0, 0, 132, 133, 5, - 98, 0, 0, 133, 134, 5, 97, 0, 0, 134, 135, 5, 115, 0, 0, 135, 136, 5, 101, - 0, 0, 136, 137, 5, 115, 0, 0, 137, 6, 1, 0, 0, 0, 138, 139, 5, 99, 0, 0, - 139, 140, 5, 111, 0, 0, 140, 141, 5, 108, 0, 0, 141, 142, 5, 108, 0, 0, - 142, 143, 5, 101, 0, 0, 143, 144, 5, 99, 0, 0, 144, 145, 5, 116, 0, 0, - 145, 146, 5, 105, 0, 0, 146, 147, 5, 111, 0, 0, 147, 148, 5, 110, 0, 0, - 148, 149, 5, 115, 0, 0, 149, 8, 1, 0, 0, 0, 150, 151, 5, 100, 0, 0, 151, - 152, 5, 98, 0, 0, 152, 10, 1, 0, 0, 0, 153, 154, 5, 110, 0, 0, 154, 155, - 5, 101, 0, 0, 155, 156, 5, 119, 0, 0, 156, 12, 1, 0, 0, 0, 157, 158, 5, - 116, 0, 0, 158, 159, 5, 114, 0, 0, 159, 160, 5, 117, 0, 0, 160, 161, 5, - 101, 0, 0, 161, 14, 1, 0, 0, 0, 162, 163, 5, 102, 0, 0, 163, 164, 5, 97, - 0, 0, 164, 165, 5, 108, 0, 0, 165, 166, 5, 115, 0, 0, 166, 167, 5, 101, - 0, 0, 167, 16, 1, 0, 0, 0, 168, 169, 5, 110, 0, 0, 169, 170, 5, 117, 0, - 0, 170, 171, 5, 108, 0, 0, 171, 172, 5, 108, 0, 0, 172, 18, 1, 0, 0, 0, - 173, 174, 5, 103, 0, 0, 174, 175, 5, 101, 0, 0, 175, 176, 5, 116, 0, 0, - 176, 177, 5, 67, 0, 0, 177, 178, 5, 111, 0, 0, 178, 179, 5, 108, 0, 0, - 179, 180, 5, 108, 0, 0, 180, 181, 5, 101, 0, 0, 181, 182, 5, 99, 0, 0, - 182, 183, 5, 116, 0, 0, 183, 184, 5, 105, 0, 0, 184, 185, 5, 111, 0, 0, - 185, 186, 5, 110, 0, 0, 186, 20, 1, 0, 0, 0, 187, 188, 5, 103, 0, 0, 188, - 189, 5, 101, 0, 0, 189, 190, 5, 116, 0, 0, 190, 191, 5, 67, 0, 0, 191, - 192, 5, 111, 0, 0, 192, 193, 5, 108, 0, 0, 193, 194, 5, 108, 0, 0, 194, - 195, 5, 101, 0, 0, 195, 196, 5, 99, 0, 0, 196, 197, 5, 116, 0, 0, 197, - 198, 5, 105, 0, 0, 198, 199, 5, 111, 0, 0, 199, 200, 5, 110, 0, 0, 200, - 201, 5, 78, 0, 0, 201, 202, 5, 97, 0, 0, 202, 203, 5, 109, 0, 0, 203, 204, - 5, 101, 0, 0, 204, 205, 5, 115, 0, 0, 205, 22, 1, 0, 0, 0, 206, 207, 5, - 103, 0, 0, 207, 208, 5, 101, 0, 0, 208, 209, 5, 116, 0, 0, 209, 210, 5, - 67, 0, 0, 210, 211, 5, 111, 0, 0, 211, 212, 5, 108, 0, 0, 212, 213, 5, - 108, 0, 0, 213, 214, 5, 101, 0, 0, 214, 215, 5, 99, 0, 0, 215, 216, 5, - 116, 0, 0, 216, 217, 5, 105, 0, 0, 217, 218, 5, 111, 0, 0, 218, 219, 5, - 110, 0, 0, 219, 220, 5, 73, 0, 0, 220, 221, 5, 110, 0, 0, 221, 222, 5, - 102, 0, 0, 222, 223, 5, 111, 0, 0, 223, 224, 5, 115, 0, 0, 224, 24, 1, - 0, 0, 0, 225, 226, 5, 79, 0, 0, 226, 227, 5, 98, 0, 0, 227, 228, 5, 106, - 0, 0, 228, 229, 5, 101, 0, 0, 229, 230, 5, 99, 0, 0, 230, 231, 5, 116, - 0, 0, 231, 232, 5, 73, 0, 0, 232, 233, 5, 100, 0, 0, 233, 26, 1, 0, 0, - 0, 234, 235, 5, 73, 0, 0, 235, 236, 5, 83, 0, 0, 236, 237, 5, 79, 0, 0, - 237, 238, 5, 68, 0, 0, 238, 239, 5, 97, 0, 0, 239, 240, 5, 116, 0, 0, 240, - 241, 5, 101, 0, 0, 241, 28, 1, 0, 0, 0, 242, 243, 5, 68, 0, 0, 243, 244, - 5, 97, 0, 0, 244, 245, 5, 116, 0, 0, 245, 246, 5, 101, 0, 0, 246, 30, 1, - 0, 0, 0, 247, 248, 5, 85, 0, 0, 248, 249, 5, 85, 0, 0, 249, 250, 5, 73, - 0, 0, 250, 251, 5, 68, 0, 0, 251, 32, 1, 0, 0, 0, 252, 253, 5, 76, 0, 0, - 253, 254, 5, 111, 0, 0, 254, 255, 5, 110, 0, 0, 255, 256, 5, 103, 0, 0, - 256, 34, 1, 0, 0, 0, 257, 258, 5, 78, 0, 0, 258, 259, 5, 117, 0, 0, 259, - 260, 5, 109, 0, 0, 260, 261, 5, 98, 0, 0, 261, 262, 5, 101, 0, 0, 262, - 263, 5, 114, 0, 0, 263, 264, 5, 76, 0, 0, 264, 265, 5, 111, 0, 0, 265, - 266, 5, 110, 0, 0, 266, 267, 5, 103, 0, 0, 267, 36, 1, 0, 0, 0, 268, 269, - 5, 73, 0, 0, 269, 270, 5, 110, 0, 0, 270, 271, 5, 116, 0, 0, 271, 272, - 5, 51, 0, 0, 272, 273, 5, 50, 0, 0, 273, 38, 1, 0, 0, 0, 274, 275, 5, 78, - 0, 0, 275, 276, 5, 117, 0, 0, 276, 277, 5, 109, 0, 0, 277, 278, 5, 98, - 0, 0, 278, 279, 5, 101, 0, 0, 279, 280, 5, 114, 0, 0, 280, 281, 5, 73, - 0, 0, 281, 282, 5, 110, 0, 0, 282, 283, 5, 116, 0, 0, 283, 40, 1, 0, 0, - 0, 284, 285, 5, 68, 0, 0, 285, 286, 5, 111, 0, 0, 286, 287, 5, 117, 0, - 0, 287, 288, 5, 98, 0, 0, 288, 289, 5, 108, 0, 0, 289, 290, 5, 101, 0, - 0, 290, 42, 1, 0, 0, 0, 291, 292, 5, 68, 0, 0, 292, 293, 5, 101, 0, 0, - 293, 294, 5, 99, 0, 0, 294, 295, 5, 105, 0, 0, 295, 296, 5, 109, 0, 0, - 296, 297, 5, 97, 0, 0, 297, 298, 5, 108, 0, 0, 298, 299, 5, 49, 0, 0, 299, - 300, 5, 50, 0, 0, 300, 301, 5, 56, 0, 0, 301, 44, 1, 0, 0, 0, 302, 303, - 5, 78, 0, 0, 303, 304, 5, 117, 0, 0, 304, 305, 5, 109, 0, 0, 305, 306, - 5, 98, 0, 0, 306, 307, 5, 101, 0, 0, 307, 308, 5, 114, 0, 0, 308, 309, - 5, 68, 0, 0, 309, 310, 5, 101, 0, 0, 310, 311, 5, 99, 0, 0, 311, 312, 5, - 105, 0, 0, 312, 313, 5, 109, 0, 0, 313, 314, 5, 97, 0, 0, 314, 315, 5, - 108, 0, 0, 315, 46, 1, 0, 0, 0, 316, 317, 5, 84, 0, 0, 317, 318, 5, 105, - 0, 0, 318, 319, 5, 109, 0, 0, 319, 320, 5, 101, 0, 0, 320, 321, 5, 115, - 0, 0, 321, 322, 5, 116, 0, 0, 322, 323, 5, 97, 0, 0, 323, 324, 5, 109, - 0, 0, 324, 325, 5, 112, 0, 0, 325, 48, 1, 0, 0, 0, 326, 327, 5, 82, 0, - 0, 327, 328, 5, 101, 0, 0, 328, 329, 5, 103, 0, 0, 329, 330, 5, 69, 0, - 0, 330, 331, 5, 120, 0, 0, 331, 332, 5, 112, 0, 0, 332, 50, 1, 0, 0, 0, - 333, 334, 5, 102, 0, 0, 334, 335, 5, 105, 0, 0, 335, 336, 5, 110, 0, 0, - 336, 337, 5, 100, 0, 0, 337, 52, 1, 0, 0, 0, 338, 339, 5, 102, 0, 0, 339, - 340, 5, 105, 0, 0, 340, 341, 5, 110, 0, 0, 341, 342, 5, 100, 0, 0, 342, - 343, 5, 79, 0, 0, 343, 344, 5, 110, 0, 0, 344, 345, 5, 101, 0, 0, 345, - 54, 1, 0, 0, 0, 346, 347, 5, 115, 0, 0, 347, 348, 5, 111, 0, 0, 348, 349, - 5, 114, 0, 0, 349, 350, 5, 116, 0, 0, 350, 56, 1, 0, 0, 0, 351, 352, 5, - 108, 0, 0, 352, 353, 5, 105, 0, 0, 353, 354, 5, 109, 0, 0, 354, 355, 5, - 105, 0, 0, 355, 356, 5, 116, 0, 0, 356, 58, 1, 0, 0, 0, 357, 358, 5, 115, - 0, 0, 358, 359, 5, 107, 0, 0, 359, 360, 5, 105, 0, 0, 360, 361, 5, 112, - 0, 0, 361, 60, 1, 0, 0, 0, 362, 363, 5, 112, 0, 0, 363, 364, 5, 114, 0, - 0, 364, 365, 5, 111, 0, 0, 365, 366, 5, 106, 0, 0, 366, 367, 5, 101, 0, - 0, 367, 368, 5, 99, 0, 0, 368, 369, 5, 116, 0, 0, 369, 370, 5, 105, 0, - 0, 370, 371, 5, 111, 0, 0, 371, 372, 5, 110, 0, 0, 372, 62, 1, 0, 0, 0, - 373, 374, 5, 112, 0, 0, 374, 375, 5, 114, 0, 0, 375, 376, 5, 111, 0, 0, - 376, 377, 5, 106, 0, 0, 377, 378, 5, 101, 0, 0, 378, 379, 5, 99, 0, 0, - 379, 380, 5, 116, 0, 0, 380, 64, 1, 0, 0, 0, 381, 382, 5, 40, 0, 0, 382, - 66, 1, 0, 0, 0, 383, 384, 5, 41, 0, 0, 384, 68, 1, 0, 0, 0, 385, 386, 5, - 123, 0, 0, 386, 70, 1, 0, 0, 0, 387, 388, 5, 125, 0, 0, 388, 72, 1, 0, - 0, 0, 389, 390, 5, 91, 0, 0, 390, 74, 1, 0, 0, 0, 391, 392, 5, 93, 0, 0, - 392, 76, 1, 0, 0, 0, 393, 394, 5, 58, 0, 0, 394, 78, 1, 0, 0, 0, 395, 396, - 5, 44, 0, 0, 396, 80, 1, 0, 0, 0, 397, 398, 5, 46, 0, 0, 398, 82, 1, 0, - 0, 0, 399, 400, 5, 59, 0, 0, 400, 84, 1, 0, 0, 0, 401, 402, 5, 36, 0, 0, - 402, 86, 1, 0, 0, 0, 403, 404, 5, 47, 0, 0, 404, 405, 5, 47, 0, 0, 405, - 409, 1, 0, 0, 0, 406, 408, 8, 0, 0, 0, 407, 406, 1, 0, 0, 0, 408, 411, - 1, 0, 0, 0, 409, 407, 1, 0, 0, 0, 409, 410, 1, 0, 0, 0, 410, 412, 1, 0, - 0, 0, 411, 409, 1, 0, 0, 0, 412, 413, 6, 43, 0, 0, 413, 88, 1, 0, 0, 0, - 414, 415, 5, 47, 0, 0, 415, 416, 5, 42, 0, 0, 416, 420, 1, 0, 0, 0, 417, - 419, 9, 0, 0, 0, 418, 417, 1, 0, 0, 0, 419, 422, 1, 0, 0, 0, 420, 421, - 1, 0, 0, 0, 420, 418, 1, 0, 0, 0, 421, 423, 1, 0, 0, 0, 422, 420, 1, 0, - 0, 0, 423, 424, 5, 42, 0, 0, 424, 425, 5, 47, 0, 0, 425, 426, 1, 0, 0, - 0, 426, 427, 6, 44, 0, 0, 427, 90, 1, 0, 0, 0, 428, 429, 5, 47, 0, 0, 429, - 430, 3, 93, 46, 0, 430, 432, 5, 47, 0, 0, 431, 433, 3, 97, 48, 0, 432, - 431, 1, 0, 0, 0, 432, 433, 1, 0, 0, 0, 433, 92, 1, 0, 0, 0, 434, 436, 3, - 95, 47, 0, 435, 434, 1, 0, 0, 0, 436, 437, 1, 0, 0, 0, 437, 435, 1, 0, - 0, 0, 437, 438, 1, 0, 0, 0, 438, 94, 1, 0, 0, 0, 439, 443, 8, 1, 0, 0, - 440, 441, 5, 92, 0, 0, 441, 443, 9, 0, 0, 0, 442, 439, 1, 0, 0, 0, 442, - 440, 1, 0, 0, 0, 443, 96, 1, 0, 0, 0, 444, 446, 7, 2, 0, 0, 445, 444, 1, - 0, 0, 0, 446, 447, 1, 0, 0, 0, 447, 445, 1, 0, 0, 0, 447, 448, 1, 0, 0, - 0, 448, 98, 1, 0, 0, 0, 449, 451, 5, 45, 0, 0, 450, 449, 1, 0, 0, 0, 450, - 451, 1, 0, 0, 0, 451, 452, 1, 0, 0, 0, 452, 459, 3, 101, 50, 0, 453, 455, - 5, 46, 0, 0, 454, 456, 7, 3, 0, 0, 455, 454, 1, 0, 0, 0, 456, 457, 1, 0, - 0, 0, 457, 455, 1, 0, 0, 0, 457, 458, 1, 0, 0, 0, 458, 460, 1, 0, 0, 0, - 459, 453, 1, 0, 0, 0, 459, 460, 1, 0, 0, 0, 460, 462, 1, 0, 0, 0, 461, - 463, 3, 103, 51, 0, 462, 461, 1, 0, 0, 0, 462, 463, 1, 0, 0, 0, 463, 477, - 1, 0, 0, 0, 464, 466, 5, 45, 0, 0, 465, 464, 1, 0, 0, 0, 465, 466, 1, 0, - 0, 0, 466, 467, 1, 0, 0, 0, 467, 469, 5, 46, 0, 0, 468, 470, 7, 3, 0, 0, - 469, 468, 1, 0, 0, 0, 470, 471, 1, 0, 0, 0, 471, 469, 1, 0, 0, 0, 471, - 472, 1, 0, 0, 0, 472, 474, 1, 0, 0, 0, 473, 475, 3, 103, 51, 0, 474, 473, - 1, 0, 0, 0, 474, 475, 1, 0, 0, 0, 475, 477, 1, 0, 0, 0, 476, 450, 1, 0, - 0, 0, 476, 465, 1, 0, 0, 0, 477, 100, 1, 0, 0, 0, 478, 487, 5, 48, 0, 0, - 479, 483, 7, 4, 0, 0, 480, 482, 7, 3, 0, 0, 481, 480, 1, 0, 0, 0, 482, - 485, 1, 0, 0, 0, 483, 481, 1, 0, 0, 0, 483, 484, 1, 0, 0, 0, 484, 487, - 1, 0, 0, 0, 485, 483, 1, 0, 0, 0, 486, 478, 1, 0, 0, 0, 486, 479, 1, 0, - 0, 0, 487, 102, 1, 0, 0, 0, 488, 490, 7, 5, 0, 0, 489, 491, 7, 6, 0, 0, - 490, 489, 1, 0, 0, 0, 490, 491, 1, 0, 0, 0, 491, 493, 1, 0, 0, 0, 492, - 494, 7, 3, 0, 0, 493, 492, 1, 0, 0, 0, 494, 495, 1, 0, 0, 0, 495, 493, - 1, 0, 0, 0, 495, 496, 1, 0, 0, 0, 496, 104, 1, 0, 0, 0, 497, 502, 5, 34, - 0, 0, 498, 501, 3, 109, 54, 0, 499, 501, 8, 7, 0, 0, 500, 498, 1, 0, 0, - 0, 500, 499, 1, 0, 0, 0, 501, 504, 1, 0, 0, 0, 502, 500, 1, 0, 0, 0, 502, - 503, 1, 0, 0, 0, 503, 505, 1, 0, 0, 0, 504, 502, 1, 0, 0, 0, 505, 506, - 5, 34, 0, 0, 506, 106, 1, 0, 0, 0, 507, 512, 5, 39, 0, 0, 508, 511, 3, - 109, 54, 0, 509, 511, 8, 8, 0, 0, 510, 508, 1, 0, 0, 0, 510, 509, 1, 0, - 0, 0, 511, 514, 1, 0, 0, 0, 512, 510, 1, 0, 0, 0, 512, 513, 1, 0, 0, 0, - 513, 515, 1, 0, 0, 0, 514, 512, 1, 0, 0, 0, 515, 516, 5, 39, 0, 0, 516, - 108, 1, 0, 0, 0, 517, 521, 5, 92, 0, 0, 518, 522, 7, 9, 0, 0, 519, 522, - 3, 111, 55, 0, 520, 522, 5, 39, 0, 0, 521, 518, 1, 0, 0, 0, 521, 519, 1, - 0, 0, 0, 521, 520, 1, 0, 0, 0, 522, 110, 1, 0, 0, 0, 523, 524, 5, 117, - 0, 0, 524, 525, 3, 113, 56, 0, 525, 526, 3, 113, 56, 0, 526, 527, 3, 113, - 56, 0, 527, 528, 3, 113, 56, 0, 528, 112, 1, 0, 0, 0, 529, 530, 7, 10, - 0, 0, 530, 114, 1, 0, 0, 0, 531, 535, 7, 11, 0, 0, 532, 534, 7, 12, 0, - 0, 533, 532, 1, 0, 0, 0, 534, 537, 1, 0, 0, 0, 535, 533, 1, 0, 0, 0, 535, - 536, 1, 0, 0, 0, 536, 116, 1, 0, 0, 0, 537, 535, 1, 0, 0, 0, 538, 540, - 7, 13, 0, 0, 539, 538, 1, 0, 0, 0, 540, 541, 1, 0, 0, 0, 541, 539, 1, 0, - 0, 0, 541, 542, 1, 0, 0, 0, 542, 543, 1, 0, 0, 0, 543, 544, 6, 58, 0, 0, - 544, 118, 1, 0, 0, 0, 26, 0, 409, 420, 432, 437, 442, 447, 450, 457, 459, - 462, 465, 471, 474, 476, 483, 486, 490, 495, 500, 502, 510, 512, 521, 535, - 541, 1, 0, 1, 0, + 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, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -360,55 +401,61 @@ 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 - MongoShellLexerSORT = 28 - MongoShellLexerLIMIT = 29 - MongoShellLexerSKIP_ = 30 - MongoShellLexerPROJECTION = 31 - MongoShellLexerPROJECT = 32 - MongoShellLexerLPAREN = 33 - MongoShellLexerRPAREN = 34 - MongoShellLexerLBRACE = 35 - MongoShellLexerRBRACE = 36 - MongoShellLexerLBRACKET = 37 - MongoShellLexerRBRACKET = 38 - MongoShellLexerCOLON = 39 - MongoShellLexerCOMMA = 40 - MongoShellLexerDOT = 41 - MongoShellLexerSEMI = 42 - MongoShellLexerDOLLAR = 43 - MongoShellLexerLINE_COMMENT = 44 - MongoShellLexerBLOCK_COMMENT = 45 - MongoShellLexerREGEX_LITERAL = 46 - MongoShellLexerNUMBER = 47 - MongoShellLexerDOUBLE_QUOTED_STRING = 48 - MongoShellLexerSINGLE_QUOTED_STRING = 49 - MongoShellLexerIDENTIFIER = 50 - MongoShellLexerWS = 51 + 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 ) diff --git a/mongodb/mongoshell_parser.go b/mongodb/mongoshell_parser.go index 45c355b..67f5c08 100644 --- a/mongodb/mongoshell_parser.go +++ b/mongodb/mongoshell_parser.go @@ -37,217 +37,245 @@ func mongoshellparserParserInit() { "'getCollectionInfos'", "'ObjectId'", "'ISODate'", "'Date'", "'UUID'", "'Long'", "'NumberLong'", "'Int32'", "'NumberInt'", "'Double'", "'Decimal128'", "'NumberDecimal'", "'Timestamp'", "'RegExp'", "'find'", "'findOne'", - "'sort'", "'limit'", "'skip'", "'projection'", "'project'", "'('", "')'", - "'{'", "'}'", "'['", "']'", "':'", "','", "'.'", "';'", "'$'", + "'countDocuments'", "'estimatedDocumentCount'", "'distinct'", "'aggregate'", + "'getIndexes'", "'sort'", "'limit'", "'skip'", "'projection'", "'project'", + "'count'", "'('", "')'", "'{'", "'}'", "'['", "']'", "':'", "','", "'.'", + "';'", "'$'", } 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", "SORT", "LIMIT", "SKIP_", "PROJECTION", - "PROJECT", "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", "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", } staticData.RuleNames = []string{ "program", "statement", "shellCommand", "dbStatement", "collectionAccess", - "methodChain", "methodCall", "findMethod", "findOneMethod", "sortMethod", - "limitMethod", "skipMethod", "projectionMethod", "genericMethod", "arguments", - "argument", "document", "pair", "key", "value", "array", "helperFunction", + "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", } staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 51, 400, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 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, 1, 0, 5, 0, 72, 8, 0, 10, - 0, 12, 0, 75, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 3, 1, 81, 8, 1, 1, 1, 1, 1, - 3, 1, 85, 8, 1, 3, 1, 87, 8, 1, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 93, 8, 2, - 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 101, 8, 3, 1, 3, 1, 3, 1, 3, - 1, 3, 1, 3, 3, 3, 108, 8, 3, 1, 3, 1, 3, 3, 3, 112, 8, 3, 1, 3, 1, 3, 1, - 3, 1, 3, 3, 3, 118, 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, 132, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 5, - 5, 138, 8, 5, 10, 5, 12, 5, 141, 9, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, - 6, 1, 6, 3, 6, 150, 8, 6, 1, 7, 1, 7, 1, 7, 3, 7, 155, 8, 7, 1, 7, 1, 7, - 1, 8, 1, 8, 1, 8, 3, 8, 162, 8, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, - 1, 9, 1, 10, 1, 10, 1, 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, 3, 13, 189, - 8, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 5, 14, 196, 8, 14, 10, 14, 12, - 14, 199, 9, 14, 1, 14, 3, 14, 202, 8, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, - 16, 1, 16, 5, 16, 210, 8, 16, 10, 16, 12, 16, 213, 9, 16, 1, 16, 3, 16, - 216, 8, 16, 3, 16, 218, 8, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, - 1, 18, 1, 18, 3, 18, 228, 8, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, - 19, 3, 19, 236, 8, 19, 1, 20, 1, 20, 1, 20, 1, 20, 5, 20, 242, 8, 20, 10, - 20, 12, 20, 245, 9, 20, 1, 20, 3, 20, 248, 8, 20, 3, 20, 250, 8, 20, 1, - 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, - 3, 21, 263, 8, 21, 1, 22, 1, 22, 1, 22, 3, 22, 268, 8, 22, 1, 22, 1, 22, - 1, 22, 1, 22, 3, 22, 274, 8, 22, 1, 23, 1, 23, 1, 23, 3, 23, 279, 8, 23, - 1, 23, 1, 23, 1, 23, 1, 23, 3, 23, 285, 8, 23, 1, 24, 1, 24, 1, 24, 1, - 24, 3, 24, 291, 8, 24, 1, 24, 1, 24, 1, 24, 1, 24, 3, 24, 297, 8, 24, 1, - 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 3, 26, 308, - 8, 26, 1, 26, 1, 26, 1, 27, 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, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 3, 30, 338, 8, - 30, 1, 31, 1, 31, 1, 31, 1, 31, 1, 31, 3, 31, 345, 8, 31, 1, 31, 1, 31, - 1, 31, 1, 31, 1, 31, 3, 31, 352, 8, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, - 32, 3, 32, 359, 8, 32, 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, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, - 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, - 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 3, 34, 398, - 8, 34, 1, 34, 0, 0, 35, 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, 0, 6, 1, 0, 2, 3, 1, 0, 31, 32, 1, 0, 17, 18, 1, 0, 19, - 20, 1, 0, 22, 23, 1, 0, 48, 49, 456, 0, 73, 1, 0, 0, 0, 2, 86, 1, 0, 0, - 0, 4, 92, 1, 0, 0, 0, 6, 117, 1, 0, 0, 0, 8, 131, 1, 0, 0, 0, 10, 133, - 1, 0, 0, 0, 12, 149, 1, 0, 0, 0, 14, 151, 1, 0, 0, 0, 16, 158, 1, 0, 0, - 0, 18, 165, 1, 0, 0, 0, 20, 170, 1, 0, 0, 0, 22, 175, 1, 0, 0, 0, 24, 180, - 1, 0, 0, 0, 26, 185, 1, 0, 0, 0, 28, 192, 1, 0, 0, 0, 30, 203, 1, 0, 0, - 0, 32, 205, 1, 0, 0, 0, 34, 221, 1, 0, 0, 0, 36, 227, 1, 0, 0, 0, 38, 235, - 1, 0, 0, 0, 40, 237, 1, 0, 0, 0, 42, 262, 1, 0, 0, 0, 44, 273, 1, 0, 0, - 0, 46, 284, 1, 0, 0, 0, 48, 296, 1, 0, 0, 0, 50, 298, 1, 0, 0, 0, 52, 303, - 1, 0, 0, 0, 54, 311, 1, 0, 0, 0, 56, 316, 1, 0, 0, 0, 58, 321, 1, 0, 0, - 0, 60, 337, 1, 0, 0, 0, 62, 351, 1, 0, 0, 0, 64, 358, 1, 0, 0, 0, 66, 360, - 1, 0, 0, 0, 68, 397, 1, 0, 0, 0, 70, 72, 3, 2, 1, 0, 71, 70, 1, 0, 0, 0, - 72, 75, 1, 0, 0, 0, 73, 71, 1, 0, 0, 0, 73, 74, 1, 0, 0, 0, 74, 76, 1, - 0, 0, 0, 75, 73, 1, 0, 0, 0, 76, 77, 5, 0, 0, 1, 77, 1, 1, 0, 0, 0, 78, - 80, 3, 4, 2, 0, 79, 81, 5, 42, 0, 0, 80, 79, 1, 0, 0, 0, 80, 81, 1, 0, - 0, 0, 81, 87, 1, 0, 0, 0, 82, 84, 3, 6, 3, 0, 83, 85, 5, 42, 0, 0, 84, - 83, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 87, 1, 0, 0, 0, 86, 78, 1, 0, 0, - 0, 86, 82, 1, 0, 0, 0, 87, 3, 1, 0, 0, 0, 88, 89, 5, 1, 0, 0, 89, 93, 7, - 0, 0, 0, 90, 91, 5, 1, 0, 0, 91, 93, 5, 4, 0, 0, 92, 88, 1, 0, 0, 0, 92, - 90, 1, 0, 0, 0, 93, 5, 1, 0, 0, 0, 94, 95, 5, 5, 0, 0, 95, 96, 5, 41, 0, - 0, 96, 97, 5, 11, 0, 0, 97, 98, 5, 33, 0, 0, 98, 100, 5, 34, 0, 0, 99, - 101, 3, 10, 5, 0, 100, 99, 1, 0, 0, 0, 100, 101, 1, 0, 0, 0, 101, 118, - 1, 0, 0, 0, 102, 103, 5, 5, 0, 0, 103, 104, 5, 41, 0, 0, 104, 105, 5, 12, - 0, 0, 105, 107, 5, 33, 0, 0, 106, 108, 3, 28, 14, 0, 107, 106, 1, 0, 0, - 0, 107, 108, 1, 0, 0, 0, 108, 109, 1, 0, 0, 0, 109, 111, 5, 34, 0, 0, 110, - 112, 3, 10, 5, 0, 111, 110, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 118, - 1, 0, 0, 0, 113, 114, 5, 5, 0, 0, 114, 115, 3, 8, 4, 0, 115, 116, 3, 10, - 5, 0, 116, 118, 1, 0, 0, 0, 117, 94, 1, 0, 0, 0, 117, 102, 1, 0, 0, 0, - 117, 113, 1, 0, 0, 0, 118, 7, 1, 0, 0, 0, 119, 120, 5, 41, 0, 0, 120, 132, - 3, 68, 34, 0, 121, 122, 5, 37, 0, 0, 122, 123, 3, 66, 33, 0, 123, 124, - 5, 38, 0, 0, 124, 132, 1, 0, 0, 0, 125, 126, 5, 41, 0, 0, 126, 127, 5, - 10, 0, 0, 127, 128, 5, 33, 0, 0, 128, 129, 3, 66, 33, 0, 129, 130, 5, 34, - 0, 0, 130, 132, 1, 0, 0, 0, 131, 119, 1, 0, 0, 0, 131, 121, 1, 0, 0, 0, - 131, 125, 1, 0, 0, 0, 132, 9, 1, 0, 0, 0, 133, 134, 5, 41, 0, 0, 134, 139, - 3, 12, 6, 0, 135, 136, 5, 41, 0, 0, 136, 138, 3, 12, 6, 0, 137, 135, 1, - 0, 0, 0, 138, 141, 1, 0, 0, 0, 139, 137, 1, 0, 0, 0, 139, 140, 1, 0, 0, - 0, 140, 11, 1, 0, 0, 0, 141, 139, 1, 0, 0, 0, 142, 150, 3, 14, 7, 0, 143, - 150, 3, 16, 8, 0, 144, 150, 3, 18, 9, 0, 145, 150, 3, 20, 10, 0, 146, 150, - 3, 22, 11, 0, 147, 150, 3, 24, 12, 0, 148, 150, 3, 26, 13, 0, 149, 142, - 1, 0, 0, 0, 149, 143, 1, 0, 0, 0, 149, 144, 1, 0, 0, 0, 149, 145, 1, 0, - 0, 0, 149, 146, 1, 0, 0, 0, 149, 147, 1, 0, 0, 0, 149, 148, 1, 0, 0, 0, - 150, 13, 1, 0, 0, 0, 151, 152, 5, 26, 0, 0, 152, 154, 5, 33, 0, 0, 153, - 155, 3, 30, 15, 0, 154, 153, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 156, - 1, 0, 0, 0, 156, 157, 5, 34, 0, 0, 157, 15, 1, 0, 0, 0, 158, 159, 5, 27, - 0, 0, 159, 161, 5, 33, 0, 0, 160, 162, 3, 30, 15, 0, 161, 160, 1, 0, 0, - 0, 161, 162, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 164, 5, 34, 0, 0, 164, - 17, 1, 0, 0, 0, 165, 166, 5, 28, 0, 0, 166, 167, 5, 33, 0, 0, 167, 168, - 3, 32, 16, 0, 168, 169, 5, 34, 0, 0, 169, 19, 1, 0, 0, 0, 170, 171, 5, - 29, 0, 0, 171, 172, 5, 33, 0, 0, 172, 173, 5, 47, 0, 0, 173, 174, 5, 34, - 0, 0, 174, 21, 1, 0, 0, 0, 175, 176, 5, 30, 0, 0, 176, 177, 5, 33, 0, 0, - 177, 178, 5, 47, 0, 0, 178, 179, 5, 34, 0, 0, 179, 23, 1, 0, 0, 0, 180, - 181, 7, 1, 0, 0, 181, 182, 5, 33, 0, 0, 182, 183, 3, 32, 16, 0, 183, 184, - 5, 34, 0, 0, 184, 25, 1, 0, 0, 0, 185, 186, 3, 68, 34, 0, 186, 188, 5, - 33, 0, 0, 187, 189, 3, 28, 14, 0, 188, 187, 1, 0, 0, 0, 188, 189, 1, 0, - 0, 0, 189, 190, 1, 0, 0, 0, 190, 191, 5, 34, 0, 0, 191, 27, 1, 0, 0, 0, - 192, 197, 3, 30, 15, 0, 193, 194, 5, 40, 0, 0, 194, 196, 3, 30, 15, 0, - 195, 193, 1, 0, 0, 0, 196, 199, 1, 0, 0, 0, 197, 195, 1, 0, 0, 0, 197, - 198, 1, 0, 0, 0, 198, 201, 1, 0, 0, 0, 199, 197, 1, 0, 0, 0, 200, 202, - 5, 40, 0, 0, 201, 200, 1, 0, 0, 0, 201, 202, 1, 0, 0, 0, 202, 29, 1, 0, - 0, 0, 203, 204, 3, 38, 19, 0, 204, 31, 1, 0, 0, 0, 205, 217, 5, 35, 0, - 0, 206, 211, 3, 34, 17, 0, 207, 208, 5, 40, 0, 0, 208, 210, 3, 34, 17, - 0, 209, 207, 1, 0, 0, 0, 210, 213, 1, 0, 0, 0, 211, 209, 1, 0, 0, 0, 211, - 212, 1, 0, 0, 0, 212, 215, 1, 0, 0, 0, 213, 211, 1, 0, 0, 0, 214, 216, - 5, 40, 0, 0, 215, 214, 1, 0, 0, 0, 215, 216, 1, 0, 0, 0, 216, 218, 1, 0, - 0, 0, 217, 206, 1, 0, 0, 0, 217, 218, 1, 0, 0, 0, 218, 219, 1, 0, 0, 0, - 219, 220, 5, 36, 0, 0, 220, 33, 1, 0, 0, 0, 221, 222, 3, 36, 18, 0, 222, - 223, 5, 39, 0, 0, 223, 224, 3, 38, 19, 0, 224, 35, 1, 0, 0, 0, 225, 228, - 3, 68, 34, 0, 226, 228, 3, 66, 33, 0, 227, 225, 1, 0, 0, 0, 227, 226, 1, - 0, 0, 0, 228, 37, 1, 0, 0, 0, 229, 236, 3, 32, 16, 0, 230, 236, 3, 40, - 20, 0, 231, 236, 3, 42, 21, 0, 232, 236, 5, 46, 0, 0, 233, 236, 3, 62, - 31, 0, 234, 236, 3, 64, 32, 0, 235, 229, 1, 0, 0, 0, 235, 230, 1, 0, 0, - 0, 235, 231, 1, 0, 0, 0, 235, 232, 1, 0, 0, 0, 235, 233, 1, 0, 0, 0, 235, - 234, 1, 0, 0, 0, 236, 39, 1, 0, 0, 0, 237, 249, 5, 37, 0, 0, 238, 243, - 3, 38, 19, 0, 239, 240, 5, 40, 0, 0, 240, 242, 3, 38, 19, 0, 241, 239, - 1, 0, 0, 0, 242, 245, 1, 0, 0, 0, 243, 241, 1, 0, 0, 0, 243, 244, 1, 0, - 0, 0, 244, 247, 1, 0, 0, 0, 245, 243, 1, 0, 0, 0, 246, 248, 5, 40, 0, 0, - 247, 246, 1, 0, 0, 0, 247, 248, 1, 0, 0, 0, 248, 250, 1, 0, 0, 0, 249, - 238, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 251, 1, 0, 0, 0, 251, 252, - 5, 38, 0, 0, 252, 41, 1, 0, 0, 0, 253, 263, 3, 44, 22, 0, 254, 263, 3, - 46, 23, 0, 255, 263, 3, 48, 24, 0, 256, 263, 3, 50, 25, 0, 257, 263, 3, - 52, 26, 0, 258, 263, 3, 54, 27, 0, 259, 263, 3, 56, 28, 0, 260, 263, 3, - 58, 29, 0, 261, 263, 3, 60, 30, 0, 262, 253, 1, 0, 0, 0, 262, 254, 1, 0, - 0, 0, 262, 255, 1, 0, 0, 0, 262, 256, 1, 0, 0, 0, 262, 257, 1, 0, 0, 0, - 262, 258, 1, 0, 0, 0, 262, 259, 1, 0, 0, 0, 262, 260, 1, 0, 0, 0, 262, - 261, 1, 0, 0, 0, 263, 43, 1, 0, 0, 0, 264, 265, 5, 13, 0, 0, 265, 267, - 5, 33, 0, 0, 266, 268, 3, 66, 33, 0, 267, 266, 1, 0, 0, 0, 267, 268, 1, - 0, 0, 0, 268, 269, 1, 0, 0, 0, 269, 274, 5, 34, 0, 0, 270, 271, 5, 6, 0, - 0, 271, 272, 5, 13, 0, 0, 272, 274, 6, 22, -1, 0, 273, 264, 1, 0, 0, 0, - 273, 270, 1, 0, 0, 0, 274, 45, 1, 0, 0, 0, 275, 276, 5, 14, 0, 0, 276, - 278, 5, 33, 0, 0, 277, 279, 3, 66, 33, 0, 278, 277, 1, 0, 0, 0, 278, 279, - 1, 0, 0, 0, 279, 280, 1, 0, 0, 0, 280, 285, 5, 34, 0, 0, 281, 282, 5, 6, - 0, 0, 282, 283, 5, 14, 0, 0, 283, 285, 6, 23, -1, 0, 284, 275, 1, 0, 0, - 0, 284, 281, 1, 0, 0, 0, 285, 47, 1, 0, 0, 0, 286, 287, 5, 15, 0, 0, 287, - 290, 5, 33, 0, 0, 288, 291, 3, 66, 33, 0, 289, 291, 5, 47, 0, 0, 290, 288, - 1, 0, 0, 0, 290, 289, 1, 0, 0, 0, 290, 291, 1, 0, 0, 0, 291, 292, 1, 0, - 0, 0, 292, 297, 5, 34, 0, 0, 293, 294, 5, 6, 0, 0, 294, 295, 5, 15, 0, - 0, 295, 297, 6, 24, -1, 0, 296, 286, 1, 0, 0, 0, 296, 293, 1, 0, 0, 0, - 297, 49, 1, 0, 0, 0, 298, 299, 5, 16, 0, 0, 299, 300, 5, 33, 0, 0, 300, - 301, 3, 66, 33, 0, 301, 302, 5, 34, 0, 0, 302, 51, 1, 0, 0, 0, 303, 304, - 7, 2, 0, 0, 304, 307, 5, 33, 0, 0, 305, 308, 5, 47, 0, 0, 306, 308, 3, - 66, 33, 0, 307, 305, 1, 0, 0, 0, 307, 306, 1, 0, 0, 0, 308, 309, 1, 0, - 0, 0, 309, 310, 5, 34, 0, 0, 310, 53, 1, 0, 0, 0, 311, 312, 7, 3, 0, 0, - 312, 313, 5, 33, 0, 0, 313, 314, 5, 47, 0, 0, 314, 315, 5, 34, 0, 0, 315, - 55, 1, 0, 0, 0, 316, 317, 5, 21, 0, 0, 317, 318, 5, 33, 0, 0, 318, 319, - 5, 47, 0, 0, 319, 320, 5, 34, 0, 0, 320, 57, 1, 0, 0, 0, 321, 322, 7, 4, - 0, 0, 322, 323, 5, 33, 0, 0, 323, 324, 3, 66, 33, 0, 324, 325, 5, 34, 0, - 0, 325, 59, 1, 0, 0, 0, 326, 327, 5, 24, 0, 0, 327, 328, 5, 33, 0, 0, 328, - 329, 3, 32, 16, 0, 329, 330, 5, 34, 0, 0, 330, 338, 1, 0, 0, 0, 331, 332, - 5, 24, 0, 0, 332, 333, 5, 33, 0, 0, 333, 334, 5, 47, 0, 0, 334, 335, 5, - 40, 0, 0, 335, 336, 5, 47, 0, 0, 336, 338, 5, 34, 0, 0, 337, 326, 1, 0, - 0, 0, 337, 331, 1, 0, 0, 0, 338, 61, 1, 0, 0, 0, 339, 340, 5, 25, 0, 0, - 340, 341, 5, 33, 0, 0, 341, 344, 3, 66, 33, 0, 342, 343, 5, 40, 0, 0, 343, - 345, 3, 66, 33, 0, 344, 342, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 346, - 1, 0, 0, 0, 346, 347, 5, 34, 0, 0, 347, 352, 1, 0, 0, 0, 348, 349, 5, 6, - 0, 0, 349, 350, 5, 25, 0, 0, 350, 352, 6, 31, -1, 0, 351, 339, 1, 0, 0, - 0, 351, 348, 1, 0, 0, 0, 352, 63, 1, 0, 0, 0, 353, 359, 3, 66, 33, 0, 354, - 359, 5, 47, 0, 0, 355, 359, 5, 7, 0, 0, 356, 359, 5, 8, 0, 0, 357, 359, - 5, 9, 0, 0, 358, 353, 1, 0, 0, 0, 358, 354, 1, 0, 0, 0, 358, 355, 1, 0, - 0, 0, 358, 356, 1, 0, 0, 0, 358, 357, 1, 0, 0, 0, 359, 65, 1, 0, 0, 0, - 360, 361, 7, 5, 0, 0, 361, 67, 1, 0, 0, 0, 362, 398, 5, 50, 0, 0, 363, - 364, 5, 43, 0, 0, 364, 398, 5, 50, 0, 0, 365, 398, 5, 1, 0, 0, 366, 398, - 5, 2, 0, 0, 367, 398, 5, 3, 0, 0, 368, 398, 5, 4, 0, 0, 369, 398, 5, 5, - 0, 0, 370, 398, 5, 6, 0, 0, 371, 398, 5, 7, 0, 0, 372, 398, 5, 8, 0, 0, - 373, 398, 5, 9, 0, 0, 374, 398, 5, 26, 0, 0, 375, 398, 5, 27, 0, 0, 376, - 398, 5, 28, 0, 0, 377, 398, 5, 29, 0, 0, 378, 398, 5, 30, 0, 0, 379, 398, - 5, 31, 0, 0, 380, 398, 5, 32, 0, 0, 381, 398, 5, 10, 0, 0, 382, 398, 5, - 11, 0, 0, 383, 398, 5, 12, 0, 0, 384, 398, 5, 13, 0, 0, 385, 398, 5, 14, - 0, 0, 386, 398, 5, 15, 0, 0, 387, 398, 5, 16, 0, 0, 388, 398, 5, 17, 0, - 0, 389, 398, 5, 18, 0, 0, 390, 398, 5, 19, 0, 0, 391, 398, 5, 20, 0, 0, - 392, 398, 5, 21, 0, 0, 393, 398, 5, 22, 0, 0, 394, 398, 5, 23, 0, 0, 395, - 398, 5, 24, 0, 0, 396, 398, 5, 25, 0, 0, 397, 362, 1, 0, 0, 0, 397, 363, - 1, 0, 0, 0, 397, 365, 1, 0, 0, 0, 397, 366, 1, 0, 0, 0, 397, 367, 1, 0, - 0, 0, 397, 368, 1, 0, 0, 0, 397, 369, 1, 0, 0, 0, 397, 370, 1, 0, 0, 0, - 397, 371, 1, 0, 0, 0, 397, 372, 1, 0, 0, 0, 397, 373, 1, 0, 0, 0, 397, - 374, 1, 0, 0, 0, 397, 375, 1, 0, 0, 0, 397, 376, 1, 0, 0, 0, 397, 377, - 1, 0, 0, 0, 397, 378, 1, 0, 0, 0, 397, 379, 1, 0, 0, 0, 397, 380, 1, 0, - 0, 0, 397, 381, 1, 0, 0, 0, 397, 382, 1, 0, 0, 0, 397, 383, 1, 0, 0, 0, - 397, 384, 1, 0, 0, 0, 397, 385, 1, 0, 0, 0, 397, 386, 1, 0, 0, 0, 397, - 387, 1, 0, 0, 0, 397, 388, 1, 0, 0, 0, 397, 389, 1, 0, 0, 0, 397, 390, - 1, 0, 0, 0, 397, 391, 1, 0, 0, 0, 397, 392, 1, 0, 0, 0, 397, 393, 1, 0, - 0, 0, 397, 394, 1, 0, 0, 0, 397, 395, 1, 0, 0, 0, 397, 396, 1, 0, 0, 0, - 398, 69, 1, 0, 0, 0, 38, 73, 80, 84, 86, 92, 100, 107, 111, 117, 131, 139, - 149, 154, 161, 188, 197, 201, 211, 215, 217, 227, 235, 243, 247, 249, 262, - 267, 273, 278, 284, 290, 296, 307, 337, 344, 351, 358, 397, + 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, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -285,97 +313,110 @@ 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 - MongoShellParserSORT = 28 - MongoShellParserLIMIT = 29 - MongoShellParserSKIP_ = 30 - MongoShellParserPROJECTION = 31 - MongoShellParserPROJECT = 32 - MongoShellParserLPAREN = 33 - MongoShellParserRPAREN = 34 - MongoShellParserLBRACE = 35 - MongoShellParserRBRACE = 36 - MongoShellParserLBRACKET = 37 - MongoShellParserRBRACKET = 38 - MongoShellParserCOLON = 39 - MongoShellParserCOMMA = 40 - MongoShellParserDOT = 41 - MongoShellParserSEMI = 42 - MongoShellParserDOLLAR = 43 - MongoShellParserLINE_COMMENT = 44 - MongoShellParserBLOCK_COMMENT = 45 - MongoShellParserREGEX_LITERAL = 46 - MongoShellParserNUMBER = 47 - MongoShellParserDOUBLE_QUOTED_STRING = 48 - MongoShellParserSINGLE_QUOTED_STRING = 49 - MongoShellParserIDENTIFIER = 50 - MongoShellParserWS = 51 + 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 ) // MongoShellParser rules. const ( - MongoShellParserRULE_program = 0 - 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_sortMethod = 9 - MongoShellParserRULE_limitMethod = 10 - MongoShellParserRULE_skipMethod = 11 - MongoShellParserRULE_projectionMethod = 12 - MongoShellParserRULE_genericMethod = 13 - MongoShellParserRULE_arguments = 14 - MongoShellParserRULE_argument = 15 - MongoShellParserRULE_document = 16 - MongoShellParserRULE_pair = 17 - MongoShellParserRULE_key = 18 - MongoShellParserRULE_value = 19 - MongoShellParserRULE_array = 20 - MongoShellParserRULE_helperFunction = 21 - MongoShellParserRULE_objectIdHelper = 22 - MongoShellParserRULE_isoDateHelper = 23 - MongoShellParserRULE_dateHelper = 24 - MongoShellParserRULE_uuidHelper = 25 - MongoShellParserRULE_longHelper = 26 - MongoShellParserRULE_int32Helper = 27 - MongoShellParserRULE_doubleHelper = 28 - MongoShellParserRULE_decimal128Helper = 29 - MongoShellParserRULE_timestampHelper = 30 - MongoShellParserRULE_regExpConstructor = 31 - MongoShellParserRULE_literal = 32 - MongoShellParserRULE_stringLiteral = 33 - MongoShellParserRULE_identifier = 34 + MongoShellParserRULE_program = 0 + 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 ) // IProgramContext is an interface to support dynamic dispatch. @@ -507,7 +548,7 @@ func (p *MongoShellParser) Program() (localctx IProgramContext) { var _la int p.EnterOuterAlt(localctx, 1) - p.SetState(73) + p.SetState(87) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -516,11 +557,11 @@ func (p *MongoShellParser) Program() (localctx IProgramContext) { for _la == MongoShellParserSHOW || _la == MongoShellParserDB { { - p.SetState(70) + p.SetState(84) p.Statement() } - p.SetState(75) + p.SetState(89) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -528,7 +569,7 @@ func (p *MongoShellParser) Program() (localctx IProgramContext) { _la = p.GetTokenStream().LA(1) } { - p.SetState(76) + p.SetState(90) p.Match(MongoShellParserEOF) if p.HasError() { // Recognition error - abort rule @@ -668,7 +709,7 @@ func (p *MongoShellParser) Statement() (localctx IStatementContext) { p.EnterRule(localctx, 2, MongoShellParserRULE_statement) var _la int - p.SetState(86) + p.SetState(100) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -678,10 +719,10 @@ func (p *MongoShellParser) Statement() (localctx IStatementContext) { case MongoShellParserSHOW: p.EnterOuterAlt(localctx, 1) { - p.SetState(78) + p.SetState(92) p.ShellCommand() } - p.SetState(80) + p.SetState(94) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -690,7 +731,7 @@ func (p *MongoShellParser) Statement() (localctx IStatementContext) { if _la == MongoShellParserSEMI { { - p.SetState(79) + p.SetState(93) p.Match(MongoShellParserSEMI) if p.HasError() { // Recognition error - abort rule @@ -703,10 +744,10 @@ func (p *MongoShellParser) Statement() (localctx IStatementContext) { case MongoShellParserDB: p.EnterOuterAlt(localctx, 2) { - p.SetState(82) + p.SetState(96) p.DbStatement() } - p.SetState(84) + p.SetState(98) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -715,7 +756,7 @@ func (p *MongoShellParser) Statement() (localctx IStatementContext) { if _la == MongoShellParserSEMI { { - p.SetState(83) + p.SetState(97) p.Match(MongoShellParserSEMI) if p.HasError() { // Recognition error - abort rule @@ -902,7 +943,7 @@ func (p *MongoShellParser) ShellCommand() (localctx IShellCommandContext) { p.EnterRule(localctx, 4, MongoShellParserRULE_shellCommand) var _la int - p.SetState(92) + p.SetState(106) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -913,7 +954,7 @@ func (p *MongoShellParser) ShellCommand() (localctx IShellCommandContext) { localctx = NewShowDatabasesContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(88) + p.SetState(102) p.Match(MongoShellParserSHOW) if p.HasError() { // Recognition error - abort rule @@ -921,7 +962,7 @@ func (p *MongoShellParser) ShellCommand() (localctx IShellCommandContext) { } } { - p.SetState(89) + p.SetState(103) _la = p.GetTokenStream().LA(1) if !(_la == MongoShellParserDBS || _la == MongoShellParserDATABASES) { @@ -936,7 +977,7 @@ func (p *MongoShellParser) ShellCommand() (localctx IShellCommandContext) { localctx = NewShowCollectionsContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(90) + p.SetState(104) p.Match(MongoShellParserSHOW) if p.HasError() { // Recognition error - abort rule @@ -944,7 +985,7 @@ func (p *MongoShellParser) ShellCommand() (localctx IShellCommandContext) { } } { - p.SetState(91) + p.SetState(105) p.Match(MongoShellParserCOLLECTIONS) if p.HasError() { // Recognition error - abort rule @@ -1272,7 +1313,7 @@ func (p *MongoShellParser) DbStatement() (localctx IDbStatementContext) { p.EnterRule(localctx, 6, MongoShellParserRULE_dbStatement) var _la int - p.SetState(117) + p.SetState(131) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1283,7 +1324,7 @@ func (p *MongoShellParser) DbStatement() (localctx IDbStatementContext) { localctx = NewGetCollectionNamesContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(94) + p.SetState(108) p.Match(MongoShellParserDB) if p.HasError() { // Recognition error - abort rule @@ -1291,7 +1332,7 @@ func (p *MongoShellParser) DbStatement() (localctx IDbStatementContext) { } } { - p.SetState(95) + p.SetState(109) p.Match(MongoShellParserDOT) if p.HasError() { // Recognition error - abort rule @@ -1299,7 +1340,7 @@ func (p *MongoShellParser) DbStatement() (localctx IDbStatementContext) { } } { - p.SetState(96) + p.SetState(110) p.Match(MongoShellParserGET_COLLECTION_NAMES) if p.HasError() { // Recognition error - abort rule @@ -1307,7 +1348,7 @@ func (p *MongoShellParser) DbStatement() (localctx IDbStatementContext) { } } { - p.SetState(97) + p.SetState(111) p.Match(MongoShellParserLPAREN) if p.HasError() { // Recognition error - abort rule @@ -1315,14 +1356,14 @@ func (p *MongoShellParser) DbStatement() (localctx IDbStatementContext) { } } { - p.SetState(98) + p.SetState(112) p.Match(MongoShellParserRPAREN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(100) + p.SetState(114) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1331,7 +1372,7 @@ func (p *MongoShellParser) DbStatement() (localctx IDbStatementContext) { if _la == MongoShellParserDOT { { - p.SetState(99) + p.SetState(113) p.MethodChain() } @@ -1341,7 +1382,7 @@ func (p *MongoShellParser) DbStatement() (localctx IDbStatementContext) { localctx = NewGetCollectionInfosContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(102) + p.SetState(116) p.Match(MongoShellParserDB) if p.HasError() { // Recognition error - abort rule @@ -1349,7 +1390,7 @@ func (p *MongoShellParser) DbStatement() (localctx IDbStatementContext) { } } { - p.SetState(103) + p.SetState(117) p.Match(MongoShellParserDOT) if p.HasError() { // Recognition error - abort rule @@ -1357,7 +1398,7 @@ func (p *MongoShellParser) DbStatement() (localctx IDbStatementContext) { } } { - p.SetState(104) + p.SetState(118) p.Match(MongoShellParserGET_COLLECTION_INFOS) if p.HasError() { // Recognition error - abort rule @@ -1365,36 +1406,36 @@ func (p *MongoShellParser) DbStatement() (localctx IDbStatementContext) { } } { - p.SetState(105) + p.SetState(119) p.Match(MongoShellParserLPAREN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(107) + p.SetState(121) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1055703028458432) != 0 { + if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&67564989593936832) != 0 { { - p.SetState(106) + p.SetState(120) p.Arguments() } } { - p.SetState(109) + p.SetState(123) p.Match(MongoShellParserRPAREN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(111) + p.SetState(125) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1403,7 +1444,7 @@ func (p *MongoShellParser) DbStatement() (localctx IDbStatementContext) { if _la == MongoShellParserDOT { { - p.SetState(110) + p.SetState(124) p.MethodChain() } @@ -1413,7 +1454,7 @@ func (p *MongoShellParser) DbStatement() (localctx IDbStatementContext) { localctx = NewCollectionOperationContext(p, localctx) p.EnterOuterAlt(localctx, 3) { - p.SetState(113) + p.SetState(127) p.Match(MongoShellParserDB) if p.HasError() { // Recognition error - abort rule @@ -1421,11 +1462,11 @@ func (p *MongoShellParser) DbStatement() (localctx IDbStatementContext) { } } { - p.SetState(114) + p.SetState(128) p.CollectionAccess() } { - p.SetState(115) + p.SetState(129) p.MethodChain() } @@ -1699,7 +1740,7 @@ func (s *BracketAccessContext) Accept(visitor antlr.ParseTreeVisitor) interface{ func (p *MongoShellParser) CollectionAccess() (localctx ICollectionAccessContext) { localctx = NewCollectionAccessContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 8, MongoShellParserRULE_collectionAccess) - p.SetState(131) + p.SetState(145) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1710,7 +1751,7 @@ func (p *MongoShellParser) CollectionAccess() (localctx ICollectionAccessContext localctx = NewDotAccessContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(119) + p.SetState(133) p.Match(MongoShellParserDOT) if p.HasError() { // Recognition error - abort rule @@ -1718,7 +1759,7 @@ func (p *MongoShellParser) CollectionAccess() (localctx ICollectionAccessContext } } { - p.SetState(120) + p.SetState(134) p.Identifier() } @@ -1726,7 +1767,7 @@ func (p *MongoShellParser) CollectionAccess() (localctx ICollectionAccessContext localctx = NewBracketAccessContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(121) + p.SetState(135) p.Match(MongoShellParserLBRACKET) if p.HasError() { // Recognition error - abort rule @@ -1734,11 +1775,11 @@ func (p *MongoShellParser) CollectionAccess() (localctx ICollectionAccessContext } } { - p.SetState(122) + p.SetState(136) p.StringLiteral() } { - p.SetState(123) + p.SetState(137) p.Match(MongoShellParserRBRACKET) if p.HasError() { // Recognition error - abort rule @@ -1750,7 +1791,7 @@ func (p *MongoShellParser) CollectionAccess() (localctx ICollectionAccessContext localctx = NewGetCollectionAccessContext(p, localctx) p.EnterOuterAlt(localctx, 3) { - p.SetState(125) + p.SetState(139) p.Match(MongoShellParserDOT) if p.HasError() { // Recognition error - abort rule @@ -1758,7 +1799,7 @@ func (p *MongoShellParser) CollectionAccess() (localctx ICollectionAccessContext } } { - p.SetState(126) + p.SetState(140) p.Match(MongoShellParserGET_COLLECTION) if p.HasError() { // Recognition error - abort rule @@ -1766,7 +1807,7 @@ func (p *MongoShellParser) CollectionAccess() (localctx ICollectionAccessContext } } { - p.SetState(127) + p.SetState(141) p.Match(MongoShellParserLPAREN) if p.HasError() { // Recognition error - abort rule @@ -1774,11 +1815,11 @@ func (p *MongoShellParser) CollectionAccess() (localctx ICollectionAccessContext } } { - p.SetState(128) + p.SetState(142) p.StringLiteral() } { - p.SetState(129) + p.SetState(143) p.Match(MongoShellParserRPAREN) if p.HasError() { // Recognition error - abort rule @@ -1938,7 +1979,7 @@ func (p *MongoShellParser) MethodChain() (localctx IMethodChainContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(133) + p.SetState(147) p.Match(MongoShellParserDOT) if p.HasError() { // Recognition error - abort rule @@ -1946,10 +1987,10 @@ func (p *MongoShellParser) MethodChain() (localctx IMethodChainContext) { } } { - p.SetState(134) + p.SetState(148) p.MethodCall() } - p.SetState(139) + p.SetState(153) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -1958,7 +1999,7 @@ func (p *MongoShellParser) MethodChain() (localctx IMethodChainContext) { for _la == MongoShellParserDOT { { - p.SetState(135) + p.SetState(149) p.Match(MongoShellParserDOT) if p.HasError() { // Recognition error - abort rule @@ -1966,11 +2007,11 @@ func (p *MongoShellParser) MethodChain() (localctx IMethodChainContext) { } } { - p.SetState(136) + p.SetState(150) p.MethodCall() } - p.SetState(141) + p.SetState(155) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2001,9 +2042,15 @@ type IMethodCallContext interface { // 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 @@ -2075,6 +2122,86 @@ func (s *MethodCallContext) FindOneMethod() IFindOneMethodContext { 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) SortMethod() ISortMethodContext { var t antlr.RuleContext for _, ctx := range s.GetChildren() { @@ -2123,6 +2250,22 @@ func (s *MethodCallContext) SkipMethod() ISkipMethodContext { 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() { @@ -2188,7 +2331,7 @@ func (s *MethodCallContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *MongoShellParser) MethodCall() (localctx IMethodCallContext) { localctx = NewMethodCallContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 12, MongoShellParserRULE_methodCall) - p.SetState(149) + p.SetState(169) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -2198,49 +2341,91 @@ func (p *MongoShellParser) MethodCall() (localctx IMethodCallContext) { case 1: p.EnterOuterAlt(localctx, 1) { - p.SetState(142) + p.SetState(156) p.FindMethod() } case 2: p.EnterOuterAlt(localctx, 2) { - p.SetState(143) + p.SetState(157) p.FindOneMethod() } case 3: p.EnterOuterAlt(localctx, 3) { - p.SetState(144) - p.SortMethod() + p.SetState(158) + p.CountDocumentsMethod() } case 4: p.EnterOuterAlt(localctx, 4) { - p.SetState(145) - p.LimitMethod() + p.SetState(159) + p.EstimatedDocumentCountMethod() } case 5: p.EnterOuterAlt(localctx, 5) { - p.SetState(146) - p.SkipMethod() + p.SetState(160) + p.DistinctMethod() } case 6: p.EnterOuterAlt(localctx, 6) { - p.SetState(147) - p.ProjectionMethod() + p.SetState(161) + p.AggregateMethod() } case 7: p.EnterOuterAlt(localctx, 7) { - p.SetState(148) + p.SetState(162) + p.GetIndexesMethod() + } + + case 8: + p.EnterOuterAlt(localctx, 8) + { + p.SetState(163) + p.SortMethod() + } + + case 9: + p.EnterOuterAlt(localctx, 9) + { + p.SetState(164) + p.LimitMethod() + } + + case 10: + p.EnterOuterAlt(localctx, 10) + { + p.SetState(165) + p.SkipMethod() + } + + case 11: + p.EnterOuterAlt(localctx, 11) + { + p.SetState(166) + p.CountMethod() + } + + case 12: + p.EnterOuterAlt(localctx, 12) + { + p.SetState(167) + p.ProjectionMethod() + } + + case 13: + p.EnterOuterAlt(localctx, 13) + { + p.SetState(168) p.GenericMethod() } @@ -2375,7 +2560,7 @@ func (p *MongoShellParser) FindMethod() (localctx IFindMethodContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(151) + p.SetState(171) p.Match(MongoShellParserFIND) if p.HasError() { // Recognition error - abort rule @@ -2383,29 +2568,29 @@ func (p *MongoShellParser) FindMethod() (localctx IFindMethodContext) { } } { - p.SetState(152) + p.SetState(172) p.Match(MongoShellParserLPAREN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(154) + 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)&1055703028458432) != 0 { + if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&67564989593936832) != 0 { { - p.SetState(153) + p.SetState(173) p.Argument() } } { - p.SetState(156) + p.SetState(176) p.Match(MongoShellParserRPAREN) if p.HasError() { // Recognition error - abort rule @@ -2540,7 +2725,7 @@ func (p *MongoShellParser) FindOneMethod() (localctx IFindOneMethodContext) { p.EnterOuterAlt(localctx, 1) { - p.SetState(158) + p.SetState(178) p.Match(MongoShellParserFIND_ONE) if p.HasError() { // Recognition error - abort rule @@ -2548,29 +2733,29 @@ func (p *MongoShellParser) FindOneMethod() (localctx IFindOneMethodContext) { } } { - p.SetState(159) + p.SetState(179) p.Match(MongoShellParserLPAREN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(161) + p.SetState(181) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1055703028458432) != 0 { + if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&67564989593936832) != 0 { { - p.SetState(160) + p.SetState(180) p.Argument() } } { - p.SetState(163) + p.SetState(183) p.Match(MongoShellParserRPAREN) if p.HasError() { // Recognition error - abort rule @@ -2591,67 +2776,71 @@ 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 { +// ICountDocumentsMethodContext is an interface to support dynamic dispatch. +type ICountDocumentsMethodContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - SORT() antlr.TerminalNode + COUNT_DOCUMENTS() antlr.TerminalNode LPAREN() antlr.TerminalNode - Document() IDocumentContext RPAREN() antlr.TerminalNode + Arguments() IArgumentsContext - // IsSortMethodContext differentiates from other interfaces. - IsSortMethodContext() + // IsCountDocumentsMethodContext differentiates from other interfaces. + IsCountDocumentsMethodContext() } -type SortMethodContext struct { +type CountDocumentsMethodContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptySortMethodContext() *SortMethodContext { - var p = new(SortMethodContext) +func NewEmptyCountDocumentsMethodContext() *CountDocumentsMethodContext { + var p = new(CountDocumentsMethodContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_sortMethod + p.RuleIndex = MongoShellParserRULE_countDocumentsMethod return p } -func InitEmptySortMethodContext(p *SortMethodContext) { +func InitEmptyCountDocumentsMethodContext(p *CountDocumentsMethodContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_sortMethod + p.RuleIndex = MongoShellParserRULE_countDocumentsMethod } -func (*SortMethodContext) IsSortMethodContext() {} +func (*CountDocumentsMethodContext) IsCountDocumentsMethodContext() {} -func NewSortMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SortMethodContext { - var p = new(SortMethodContext) +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_sortMethod + p.RuleIndex = MongoShellParserRULE_countDocumentsMethod return p } -func (s *SortMethodContext) GetParser() antlr.Parser { return s.parser } +func (s *CountDocumentsMethodContext) GetParser() antlr.Parser { return s.parser } -func (s *SortMethodContext) SORT() antlr.TerminalNode { - return s.GetToken(MongoShellParserSORT, 0) +func (s *CountDocumentsMethodContext) COUNT_DOCUMENTS() antlr.TerminalNode { + return s.GetToken(MongoShellParserCOUNT_DOCUMENTS, 0) } -func (s *SortMethodContext) LPAREN() antlr.TerminalNode { +func (s *CountDocumentsMethodContext) LPAREN() antlr.TerminalNode { return s.GetToken(MongoShellParserLPAREN, 0) } -func (s *SortMethodContext) Document() IDocumentContext { +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.(IDocumentContext); ok { + if _, ok := ctx.(IArgumentsContext); ok { t = ctx.(antlr.RuleContext) break } @@ -2661,69 +2850,77 @@ func (s *SortMethodContext) Document() IDocumentContext { return nil } - return t.(IDocumentContext) -} - -func (s *SortMethodContext) RPAREN() antlr.TerminalNode { - return s.GetToken(MongoShellParserRPAREN, 0) + return t.(IArgumentsContext) } -func (s *SortMethodContext) GetRuleContext() antlr.RuleContext { +func (s *CountDocumentsMethodContext) GetRuleContext() antlr.RuleContext { return s } -func (s *SortMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *CountDocumentsMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *SortMethodContext) EnterRule(listener antlr.ParseTreeListener) { +func (s *CountDocumentsMethodContext) EnterRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.EnterSortMethod(s) + listenerT.EnterCountDocumentsMethod(s) } } -func (s *SortMethodContext) ExitRule(listener antlr.ParseTreeListener) { +func (s *CountDocumentsMethodContext) ExitRule(listener antlr.ParseTreeListener) { if listenerT, ok := listener.(MongoShellParserListener); ok { - listenerT.ExitSortMethod(s) + listenerT.ExitCountDocumentsMethod(s) } } -func (s *SortMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { +func (s *CountDocumentsMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { switch t := visitor.(type) { case MongoShellParserVisitor: - return t.VisitSortMethod(s) + return t.VisitCountDocumentsMethod(s) default: return t.VisitChildren(s) } } -func (p *MongoShellParser) SortMethod() (localctx ISortMethodContext) { - localctx = NewSortMethodContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 18, MongoShellParserRULE_sortMethod) +func (p *MongoShellParser) CountDocumentsMethod() (localctx ICountDocumentsMethodContext) { + localctx = NewCountDocumentsMethodContext(p, p.GetParserRuleContext(), p.GetState()) + p.EnterRule(localctx, 18, MongoShellParserRULE_countDocumentsMethod) + var _la int + p.EnterOuterAlt(localctx, 1) { - p.SetState(165) - p.Match(MongoShellParserSORT) + p.SetState(185) + p.Match(MongoShellParserCOUNT_DOCUMENTS) if p.HasError() { // Recognition error - abort rule goto errorExit } } { - p.SetState(166) + p.SetState(186) p.Match(MongoShellParserLPAREN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - { - p.SetState(167) - p.Document() + 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(168) + p.SetState(190) p.Match(MongoShellParserRPAREN) if p.HasError() { // Recognition error - abort rule @@ -2744,80 +2941,836 @@ 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 { +// IEstimatedDocumentCountMethodContext is an interface to support dynamic dispatch. +type IEstimatedDocumentCountMethodContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // Getter signatures - LIMIT() antlr.TerminalNode + ESTIMATED_DOCUMENT_COUNT() antlr.TerminalNode LPAREN() antlr.TerminalNode - NUMBER() antlr.TerminalNode RPAREN() antlr.TerminalNode + Argument() IArgumentContext - // IsLimitMethodContext differentiates from other interfaces. - IsLimitMethodContext() + // IsEstimatedDocumentCountMethodContext differentiates from other interfaces. + IsEstimatedDocumentCountMethodContext() } -type LimitMethodContext struct { +type EstimatedDocumentCountMethodContext struct { antlr.BaseParserRuleContext parser antlr.Parser } -func NewEmptyLimitMethodContext() *LimitMethodContext { - var p = new(LimitMethodContext) +func NewEmptyEstimatedDocumentCountMethodContext() *EstimatedDocumentCountMethodContext { + var p = new(EstimatedDocumentCountMethodContext) antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_limitMethod + p.RuleIndex = MongoShellParserRULE_estimatedDocumentCountMethod return p } -func InitEmptyLimitMethodContext(p *LimitMethodContext) { +func InitEmptyEstimatedDocumentCountMethodContext(p *EstimatedDocumentCountMethodContext) { antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) - p.RuleIndex = MongoShellParserRULE_limitMethod + p.RuleIndex = MongoShellParserRULE_estimatedDocumentCountMethod } -func (*LimitMethodContext) IsLimitMethodContext() {} +func (*EstimatedDocumentCountMethodContext) IsEstimatedDocumentCountMethodContext() {} -func NewLimitMethodContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LimitMethodContext { - var p = new(LimitMethodContext) +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_limitMethod + p.RuleIndex = MongoShellParserRULE_estimatedDocumentCountMethod return p } -func (s *LimitMethodContext) GetParser() antlr.Parser { return s.parser } +func (s *EstimatedDocumentCountMethodContext) GetParser() antlr.Parser { return s.parser } -func (s *LimitMethodContext) LIMIT() antlr.TerminalNode { - return s.GetToken(MongoShellParserLIMIT, 0) +func (s *EstimatedDocumentCountMethodContext) ESTIMATED_DOCUMENT_COUNT() antlr.TerminalNode { + return s.GetToken(MongoShellParserESTIMATED_DOCUMENT_COUNT, 0) } -func (s *LimitMethodContext) LPAREN() antlr.TerminalNode { +func (s *EstimatedDocumentCountMethodContext) LPAREN() antlr.TerminalNode { return s.GetToken(MongoShellParserLPAREN, 0) } -func (s *LimitMethodContext) NUMBER() antlr.TerminalNode { - return s.GetToken(MongoShellParserNUMBER, 0) +func (s *EstimatedDocumentCountMethodContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) } -func (s *LimitMethodContext) 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 *LimitMethodContext) GetRuleContext() antlr.RuleContext { +func (s *EstimatedDocumentCountMethodContext) GetRuleContext() antlr.RuleContext { return s } -func (s *LimitMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { +func (s *EstimatedDocumentCountMethodContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { return antlr.TreesStringTree(s, ruleNames, recog) } -func (s *LimitMethodContext) EnterRule(listener antlr.ParseTreeListener) { +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, 20, MongoShellParserRULE_estimatedDocumentCountMethod) + 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(193) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(195) + 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(194) + p.Argument() + } + + } + { + p.SetState(197) + 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, 22, MongoShellParserRULE_distinctMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(199) + p.Match(MongoShellParserDISTINCT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(200) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(201) + p.Arguments() + } + { + p.SetState(202) + 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, 24, MongoShellParserRULE_aggregateMethod) + 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 + } + } + +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, 26, MongoShellParserRULE_getIndexesMethod) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(209) + p.Match(MongoShellParserGET_INDEXES) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(210) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(211) + 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, 28, MongoShellParserRULE_sortMethod) + 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(216) + 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) } @@ -2841,10 +3794,10 @@ func (s *LimitMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *MongoShellParser) LimitMethod() (localctx ILimitMethodContext) { localctx = NewLimitMethodContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 20, MongoShellParserRULE_limitMethod) + p.EnterRule(localctx, 30, MongoShellParserRULE_limitMethod) p.EnterOuterAlt(localctx, 1) { - p.SetState(170) + p.SetState(218) p.Match(MongoShellParserLIMIT) if p.HasError() { // Recognition error - abort rule @@ -2852,7 +3805,7 @@ func (p *MongoShellParser) LimitMethod() (localctx ILimitMethodContext) { } } { - p.SetState(171) + p.SetState(219) p.Match(MongoShellParserLPAREN) if p.HasError() { // Recognition error - abort rule @@ -2860,7 +3813,7 @@ func (p *MongoShellParser) LimitMethod() (localctx ILimitMethodContext) { } } { - p.SetState(172) + p.SetState(220) p.Match(MongoShellParserNUMBER) if p.HasError() { // Recognition error - abort rule @@ -2868,7 +3821,7 @@ func (p *MongoShellParser) LimitMethod() (localctx ILimitMethodContext) { } } { - p.SetState(173) + p.SetState(221) p.Match(MongoShellParserRPAREN) if p.HasError() { // Recognition error - abort rule @@ -2986,10 +3939,10 @@ func (s *SkipMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *MongoShellParser) SkipMethod() (localctx ISkipMethodContext) { localctx = NewSkipMethodContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 22, MongoShellParserRULE_skipMethod) + p.EnterRule(localctx, 32, MongoShellParserRULE_skipMethod) p.EnterOuterAlt(localctx, 1) { - p.SetState(175) + p.SetState(223) p.Match(MongoShellParserSKIP_) if p.HasError() { // Recognition error - abort rule @@ -2997,7 +3950,7 @@ func (p *MongoShellParser) SkipMethod() (localctx ISkipMethodContext) { } } { - p.SetState(176) + p.SetState(224) p.Match(MongoShellParserLPAREN) if p.HasError() { // Recognition error - abort rule @@ -3005,7 +3958,7 @@ func (p *MongoShellParser) SkipMethod() (localctx ISkipMethodContext) { } } { - p.SetState(177) + p.SetState(225) p.Match(MongoShellParserNUMBER) if p.HasError() { // Recognition error - abort rule @@ -3013,7 +3966,139 @@ func (p *MongoShellParser) SkipMethod() (localctx ISkipMethodContext) { } } { - p.SetState(178) + p.SetState(226) + 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, 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 @@ -3148,12 +4233,12 @@ func (s *ProjectionMethodContext) Accept(visitor antlr.ParseTreeVisitor) interfa func (p *MongoShellParser) ProjectionMethod() (localctx IProjectionMethodContext) { localctx = NewProjectionMethodContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 24, MongoShellParserRULE_projectionMethod) + p.EnterRule(localctx, 36, MongoShellParserRULE_projectionMethod) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(180) + p.SetState(232) _la = p.GetTokenStream().LA(1) if !(_la == MongoShellParserPROJECTION || _la == MongoShellParserPROJECT) { @@ -3164,7 +4249,7 @@ func (p *MongoShellParser) ProjectionMethod() (localctx IProjectionMethodContext } } { - p.SetState(181) + p.SetState(233) p.Match(MongoShellParserLPAREN) if p.HasError() { // Recognition error - abort rule @@ -3172,11 +4257,11 @@ func (p *MongoShellParser) ProjectionMethod() (localctx IProjectionMethodContext } } { - p.SetState(182) + p.SetState(234) p.Document() } { - p.SetState(183) + p.SetState(235) p.Match(MongoShellParserRPAREN) if p.HasError() { // Recognition error - abort rule @@ -3318,38 +4403,38 @@ func (s *GenericMethodContext) Accept(visitor antlr.ParseTreeVisitor) interface{ func (p *MongoShellParser) GenericMethod() (localctx IGenericMethodContext) { localctx = NewGenericMethodContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 26, MongoShellParserRULE_genericMethod) + p.EnterRule(localctx, 38, MongoShellParserRULE_genericMethod) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(185) + p.SetState(237) p.Identifier() } { - p.SetState(186) + p.SetState(238) p.Match(MongoShellParserLPAREN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(188) + p.SetState(240) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1055703028458432) != 0 { + if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&67564989593936832) != 0 { { - p.SetState(187) + p.SetState(239) p.Arguments() } } { - p.SetState(190) + p.SetState(242) p.Match(MongoShellParserRPAREN) if p.HasError() { // Recognition error - abort rule @@ -3500,29 +4585,29 @@ func (s *ArgumentsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *MongoShellParser) Arguments() (localctx IArgumentsContext) { localctx = NewArgumentsContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 28, MongoShellParserRULE_arguments) + p.EnterRule(localctx, 40, MongoShellParserRULE_arguments) var _la int var _alt int p.EnterOuterAlt(localctx, 1) { - p.SetState(192) + p.SetState(244) p.Argument() } - p.SetState(197) + p.SetState(249) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 15, p.GetParserRuleContext()) + _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(193) + p.SetState(245) p.Match(MongoShellParserCOMMA) if p.HasError() { // Recognition error - abort rule @@ -3530,22 +4615,22 @@ func (p *MongoShellParser) Arguments() (localctx IArgumentsContext) { } } { - p.SetState(194) + p.SetState(246) p.Argument() } } - p.SetState(199) + p.SetState(251) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 15, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 17, p.GetParserRuleContext()) if p.HasError() { goto errorExit } } - p.SetState(201) + p.SetState(253) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3554,7 +4639,7 @@ func (p *MongoShellParser) Arguments() (localctx IArgumentsContext) { if _la == MongoShellParserCOMMA { { - p.SetState(200) + p.SetState(252) p.Match(MongoShellParserCOMMA) if p.HasError() { // Recognition error - abort rule @@ -3671,10 +4756,10 @@ func (s *ArgumentContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *MongoShellParser) Argument() (localctx IArgumentContext) { localctx = NewArgumentContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 30, MongoShellParserRULE_argument) + p.EnterRule(localctx, 42, MongoShellParserRULE_argument) p.EnterOuterAlt(localctx, 1) { - p.SetState(203) + p.SetState(255) p.Value() } @@ -3831,45 +4916,45 @@ func (s *DocumentContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *MongoShellParser) Document() (localctx IDocumentContext) { localctx = NewDocumentContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 32, MongoShellParserRULE_document) + p.EnterRule(localctx, 44, MongoShellParserRULE_document) var _la int var _alt int p.EnterOuterAlt(localctx, 1) { - p.SetState(205) + p.SetState(257) p.Match(MongoShellParserLBRACE) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(217) + p.SetState(269) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1979129519931390) != 0 { + if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&126664289275609086) != 0 { { - p.SetState(206) + p.SetState(258) p.Pair() } - p.SetState(211) + p.SetState(263) 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(), 19, p.GetParserRuleContext()) if p.HasError() { goto errorExit } for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { if _alt == 1 { { - p.SetState(207) + p.SetState(259) p.Match(MongoShellParserCOMMA) if p.HasError() { // Recognition error - abort rule @@ -3877,22 +4962,22 @@ func (p *MongoShellParser) Document() (localctx IDocumentContext) { } } { - p.SetState(208) + p.SetState(260) p.Pair() } } - p.SetState(213) + p.SetState(265) 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(), 19, p.GetParserRuleContext()) if p.HasError() { goto errorExit } } - p.SetState(215) + p.SetState(267) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -3901,7 +4986,7 @@ func (p *MongoShellParser) Document() (localctx IDocumentContext) { if _la == MongoShellParserCOMMA { { - p.SetState(214) + p.SetState(266) p.Match(MongoShellParserCOMMA) if p.HasError() { // Recognition error - abort rule @@ -3913,7 +4998,7 @@ func (p *MongoShellParser) Document() (localctx IDocumentContext) { } { - p.SetState(219) + p.SetState(271) p.Match(MongoShellParserRBRACE) if p.HasError() { // Recognition error - abort rule @@ -4050,14 +5135,14 @@ func (s *PairContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *MongoShellParser) Pair() (localctx IPairContext) { localctx = NewPairContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 34, MongoShellParserRULE_pair) + p.EnterRule(localctx, 46, MongoShellParserRULE_pair) p.EnterOuterAlt(localctx, 1) { - p.SetState(221) + p.SetState(273) p.Key() } { - p.SetState(222) + p.SetState(274) p.Match(MongoShellParserCOLON) if p.HasError() { // Recognition error - abort rule @@ -4065,7 +5150,7 @@ func (p *MongoShellParser) Pair() (localctx IPairContext) { } } { - p.SetState(223) + p.SetState(275) p.Value() } @@ -4250,19 +5335,19 @@ func (s *UnquotedKeyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *MongoShellParser) Key() (localctx IKeyContext) { localctx = NewKeyContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 36, MongoShellParserRULE_key) - p.SetState(227) + p.EnterRule(localctx, 48, MongoShellParserRULE_key) + p.SetState(279) 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, MongoShellParserFIND, MongoShellParserFIND_ONE, MongoShellParserSORT, MongoShellParserLIMIT, MongoShellParserSKIP_, MongoShellParserPROJECTION, MongoShellParserPROJECT, MongoShellParserDOLLAR, MongoShellParserIDENTIFIER: + 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(225) + p.SetState(277) p.Identifier() } @@ -4270,7 +5355,7 @@ func (p *MongoShellParser) Key() (localctx IKeyContext) { localctx = NewQuotedKeyContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(226) + p.SetState(278) p.StringLiteral() } @@ -4502,6 +5587,62 @@ func (s *ArrayValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { } } +type NewKeywordValueContext struct { + ValueContext +} + +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 (s *NewKeywordValueContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *NewKeywordValueContext) NewKeywordError() INewKeywordErrorContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(INewKeywordErrorContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(INewKeywordErrorContext) +} + +func (s *NewKeywordValueContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterNewKeywordValue(s) + } +} + +func (s *NewKeywordValueContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitNewKeywordValue(s) + } +} + +func (s *NewKeywordValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitNewKeywordValue(s) + + default: + return t.VisitChildren(s) + } +} + type DocumentValueContext struct { ValueContext } @@ -4672,43 +5813,43 @@ func (s *LiteralValueContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *MongoShellParser) Value() (localctx IValueContext) { localctx = NewValueContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 38, MongoShellParserRULE_value) - p.SetState(235) + p.EnterRule(localctx, 50, MongoShellParserRULE_value) + p.SetState(288) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 21, p.GetParserRuleContext()) { - case 1: + switch p.GetTokenStream().LA(1) { + case MongoShellParserLBRACE: localctx = NewDocumentValueContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(229) + p.SetState(281) p.Document() } - case 2: + case MongoShellParserLBRACKET: localctx = NewArrayValueContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(230) + p.SetState(282) p.Array() } - case 3: + 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(231) + p.SetState(283) p.HelperFunction() } - case 4: + case MongoShellParserREGEX_LITERAL: localctx = NewRegexLiteralValueContext(p, localctx) p.EnterOuterAlt(localctx, 4) { - p.SetState(232) + p.SetState(284) p.Match(MongoShellParserREGEX_LITERAL) if p.HasError() { // Recognition error - abort rule @@ -4716,24 +5857,275 @@ func (p *MongoShellParser) Value() (localctx IValueContext) { } } - case 5: - localctx = NewRegexpConstructorValueContext(p, localctx) - p.EnterOuterAlt(localctx, 5) + 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) + { + p.SetState(287) + p.NewKeywordError() + } + + 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 +} + +// INewKeywordErrorContext is an interface to support dynamic dispatch. +type INewKeywordErrorContext interface { + antlr.ParserRuleContext + + // GetParser returns the parser. + GetParser() antlr.Parser + + // Getter signatures + 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 + Arguments() IArgumentsContext + + // IsNewKeywordErrorContext differentiates from other interfaces. + IsNewKeywordErrorContext() +} + +type NewKeywordErrorContext struct { + antlr.BaseParserRuleContext + parser antlr.Parser +} + +func NewEmptyNewKeywordErrorContext() *NewKeywordErrorContext { + var p = new(NewKeywordErrorContext) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_newKeywordError + return p +} + +func InitEmptyNewKeywordErrorContext(p *NewKeywordErrorContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = MongoShellParserRULE_newKeywordError +} + +func (*NewKeywordErrorContext) IsNewKeywordErrorContext() {} + +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_newKeywordError + + return p +} + +func (s *NewKeywordErrorContext) GetParser() antlr.Parser { return s.parser } + +func (s *NewKeywordErrorContext) NEW() antlr.TerminalNode { + return s.GetToken(MongoShellParserNEW, 0) +} + +func (s *NewKeywordErrorContext) LPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserLPAREN, 0) +} + +func (s *NewKeywordErrorContext) RPAREN() antlr.TerminalNode { + return s.GetToken(MongoShellParserRPAREN, 0) +} + +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) 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 *NewKeywordErrorContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *NewKeywordErrorContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string { + return antlr.TreesStringTree(s, ruleNames, recog) +} + +func (s *NewKeywordErrorContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.EnterNewKeywordError(s) + } +} + +func (s *NewKeywordErrorContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(MongoShellParserListener); ok { + listenerT.ExitNewKeywordError(s) + } +} + +func (s *NewKeywordErrorContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case MongoShellParserVisitor: + return t.VisitNewKeywordError(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 + + p.EnterOuterAlt(localctx, 1) + { + p.SetState(290) + p.Match(MongoShellParserNEW) + 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.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(233) - p.RegExpConstructor() + p.SetState(294) + p.Arguments() } - case 6: - localctx = NewLiteralValueContext(p, localctx) - p.EnterOuterAlt(localctx, 6) - { - p.SetState(234) - p.Literal() + } + { + p.SetState(297) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit } - - case antlr.ATNInvalidAltNumber: - goto errorExit } errorExit: @@ -4889,45 +6281,45 @@ func (s *ArrayContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *MongoShellParser) Array() (localctx IArrayContext) { localctx = NewArrayContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 40, MongoShellParserRULE_array) + p.EnterRule(localctx, 54, MongoShellParserRULE_array) var _la int var _alt int p.EnterOuterAlt(localctx, 1) { - p.SetState(237) + p.SetState(299) p.Match(MongoShellParserLBRACKET) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(249) + p.SetState(311) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } _la = p.GetTokenStream().LA(1) - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&1055703028458432) != 0 { + if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&67564989593936832) != 0 { { - p.SetState(238) + p.SetState(300) p.Value() } - p.SetState(243) + p.SetState(305) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 22, p.GetParserRuleContext()) + _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(239) + p.SetState(301) p.Match(MongoShellParserCOMMA) if p.HasError() { // Recognition error - abort rule @@ -4935,22 +6327,22 @@ func (p *MongoShellParser) Array() (localctx IArrayContext) { } } { - p.SetState(240) + p.SetState(302) p.Value() } } - p.SetState(245) + p.SetState(307) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 22, p.GetParserRuleContext()) + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 25, p.GetParserRuleContext()) if p.HasError() { goto errorExit } } - p.SetState(247) + p.SetState(309) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -4959,7 +6351,7 @@ func (p *MongoShellParser) Array() (localctx IArrayContext) { if _la == MongoShellParserCOMMA { { - p.SetState(246) + p.SetState(308) p.Match(MongoShellParserCOMMA) if p.HasError() { // Recognition error - abort rule @@ -4971,7 +6363,7 @@ func (p *MongoShellParser) Array() (localctx IArrayContext) { } { - p.SetState(251) + p.SetState(313) p.Match(MongoShellParserRBRACKET) if p.HasError() { // Recognition error - abort rule @@ -5222,78 +6614,79 @@ func (s *HelperFunctionContext) Accept(visitor antlr.ParseTreeVisitor) interface func (p *MongoShellParser) HelperFunction() (localctx IHelperFunctionContext) { localctx = NewHelperFunctionContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 42, MongoShellParserRULE_helperFunction) - p.SetState(262) + p.EnterRule(localctx, 56, MongoShellParserRULE_helperFunction) + p.SetState(324) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } - switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 25, p.GetParserRuleContext()) { - case 1: + switch p.GetTokenStream().LA(1) { + case MongoShellParserOBJECT_ID: p.EnterOuterAlt(localctx, 1) { - p.SetState(253) + p.SetState(315) p.ObjectIdHelper() } - case 2: + case MongoShellParserISO_DATE: p.EnterOuterAlt(localctx, 2) { - p.SetState(254) + p.SetState(316) p.IsoDateHelper() } - case 3: + case MongoShellParserDATE: p.EnterOuterAlt(localctx, 3) { - p.SetState(255) + p.SetState(317) p.DateHelper() } - case 4: + case MongoShellParserUUID: p.EnterOuterAlt(localctx, 4) { - p.SetState(256) + p.SetState(318) p.UuidHelper() } - case 5: + case MongoShellParserLONG, MongoShellParserNUMBER_LONG: p.EnterOuterAlt(localctx, 5) { - p.SetState(257) + p.SetState(319) p.LongHelper() } - case 6: + case MongoShellParserINT32, MongoShellParserNUMBER_INT: p.EnterOuterAlt(localctx, 6) { - p.SetState(258) + p.SetState(320) p.Int32Helper() } - case 7: + case MongoShellParserDOUBLE: p.EnterOuterAlt(localctx, 7) { - p.SetState(259) + p.SetState(321) p.DoubleHelper() } - case 8: + case MongoShellParserDECIMAL128, MongoShellParserNUMBER_DECIMAL: p.EnterOuterAlt(localctx, 8) { - p.SetState(260) + p.SetState(322) p.Decimal128Helper() } - case 9: + case MongoShellParserTIMESTAMP: p.EnterOuterAlt(localctx, 9) { - p.SetState(261) + p.SetState(323) p.TimestampHelper() } - case antlr.ATNInvalidAltNumber: + default: + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) goto errorExit } @@ -5322,7 +6715,6 @@ type IObjectIdHelperContext interface { LPAREN() antlr.TerminalNode RPAREN() antlr.TerminalNode StringLiteral() IStringLiteralContext - NEW() antlr.TerminalNode // IsObjectIdHelperContext differentiates from other interfaces. IsObjectIdHelperContext() @@ -5388,10 +6780,6 @@ func (s *ObjectIdHelperContext) StringLiteral() IStringLiteralContext { return t.(IStringLiteralContext) } -func (s *ObjectIdHelperContext) NEW() antlr.TerminalNode { - return s.GetToken(MongoShellParserNEW, 0) -} - func (s *ObjectIdHelperContext) GetRuleContext() antlr.RuleContext { return s } @@ -5424,80 +6812,47 @@ func (s *ObjectIdHelperContext) Accept(visitor antlr.ParseTreeVisitor) interface func (p *MongoShellParser) ObjectIdHelper() (localctx IObjectIdHelperContext) { localctx = NewObjectIdHelperContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 44, MongoShellParserRULE_objectIdHelper) + p.EnterRule(localctx, 58, MongoShellParserRULE_objectIdHelper) var _la int - p.SetState(273) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(326) + p.Match(MongoShellParserOBJECT_ID) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(327) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + p.SetState(329) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } + _la = p.GetTokenStream().LA(1) - switch p.GetTokenStream().LA(1) { - case MongoShellParserOBJECT_ID: - p.EnterOuterAlt(localctx, 1) - { - p.SetState(264) - p.Match(MongoShellParserOBJECT_ID) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } + if _la == MongoShellParserDOUBLE_QUOTED_STRING || _la == MongoShellParserSINGLE_QUOTED_STRING { { - p.SetState(265) - p.Match(MongoShellParserLPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } + p.SetState(328) + p.StringLiteral() } - p.SetState(267) - p.GetErrorHandler().Sync(p) + + } + { + p.SetState(331) + p.Match(MongoShellParserRPAREN) 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(266) - p.StringLiteral() - } - - } - { - p.SetState(269) - p.Match(MongoShellParserRPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - case MongoShellParserNEW: - p.EnterOuterAlt(localctx, 2) - { - p.SetState(270) - p.Match(MongoShellParserNEW) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(271) - p.Match(MongoShellParserOBJECT_ID) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.NotifyErrorListeners("'new' keyword is not supported. Use ObjectId() directly", nil, nil) - - default: - p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) - goto errorExit } errorExit: @@ -5525,7 +6880,6 @@ type IIsoDateHelperContext interface { LPAREN() antlr.TerminalNode RPAREN() antlr.TerminalNode StringLiteral() IStringLiteralContext - NEW() antlr.TerminalNode // IsIsoDateHelperContext differentiates from other interfaces. IsIsoDateHelperContext() @@ -5591,10 +6945,6 @@ func (s *IsoDateHelperContext) StringLiteral() IStringLiteralContext { return t.(IStringLiteralContext) } -func (s *IsoDateHelperContext) NEW() antlr.TerminalNode { - return s.GetToken(MongoShellParserNEW, 0) -} - func (s *IsoDateHelperContext) GetRuleContext() antlr.RuleContext { return s } @@ -5627,80 +6977,47 @@ func (s *IsoDateHelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{ func (p *MongoShellParser) IsoDateHelper() (localctx IIsoDateHelperContext) { localctx = NewIsoDateHelperContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 46, MongoShellParserRULE_isoDateHelper) + p.EnterRule(localctx, 60, MongoShellParserRULE_isoDateHelper) var _la int - p.SetState(284) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(333) + p.Match(MongoShellParserISO_DATE) + 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(336) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit } + _la = p.GetTokenStream().LA(1) - switch p.GetTokenStream().LA(1) { - case MongoShellParserISO_DATE: - p.EnterOuterAlt(localctx, 1) - { - p.SetState(275) - p.Match(MongoShellParserISO_DATE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } + if _la == MongoShellParserDOUBLE_QUOTED_STRING || _la == MongoShellParserSINGLE_QUOTED_STRING { { - p.SetState(276) - p.Match(MongoShellParserLPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } + p.SetState(335) + p.StringLiteral() } - p.SetState(278) - p.GetErrorHandler().Sync(p) + + } + { + p.SetState(338) + p.Match(MongoShellParserRPAREN) 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(277) - p.StringLiteral() - } - - } - { - p.SetState(280) - p.Match(MongoShellParserRPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - case MongoShellParserNEW: - p.EnterOuterAlt(localctx, 2) - { - p.SetState(281) - p.Match(MongoShellParserNEW) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(282) - p.Match(MongoShellParserISO_DATE) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.NotifyErrorListeners("'new' keyword is not supported. Use ISODate() directly", nil, nil) - - default: - p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) - goto errorExit } errorExit: @@ -5729,7 +7046,6 @@ type IDateHelperContext interface { RPAREN() antlr.TerminalNode StringLiteral() IStringLiteralContext NUMBER() antlr.TerminalNode - NEW() antlr.TerminalNode // IsDateHelperContext differentiates from other interfaces. IsDateHelperContext() @@ -5799,10 +7115,6 @@ func (s *DateHelperContext) NUMBER() antlr.TerminalNode { return s.GetToken(MongoShellParserNUMBER, 0) } -func (s *DateHelperContext) NEW() antlr.TerminalNode { - return s.GetToken(MongoShellParserNEW, 0) -} - func (s *DateHelperContext) GetRuleContext() antlr.RuleContext { return s } @@ -5835,90 +7147,57 @@ func (s *DateHelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *MongoShellParser) DateHelper() (localctx IDateHelperContext) { localctx = NewDateHelperContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 48, MongoShellParserRULE_dateHelper) - p.SetState(296) - p.GetErrorHandler().Sync(p) - if p.HasError() { - goto errorExit - } - - switch p.GetTokenStream().LA(1) { - case MongoShellParserDATE: - p.EnterOuterAlt(localctx, 1) - { - p.SetState(286) - p.Match(MongoShellParserDATE) - 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(290) - p.GetErrorHandler().Sync(p) + p.EnterRule(localctx, 62, MongoShellParserRULE_dateHelper) + p.EnterOuterAlt(localctx, 1) + { + p.SetState(340) + p.Match(MongoShellParserDATE) if p.HasError() { - goto errorExit - } - switch p.GetTokenStream().LA(1) { - case MongoShellParserDOUBLE_QUOTED_STRING, MongoShellParserSINGLE_QUOTED_STRING: - { - p.SetState(288) - p.StringLiteral() - } - - case MongoShellParserNUMBER: - { - p.SetState(289) - p.Match(MongoShellParserNUMBER) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - case MongoShellParserRPAREN: - - default: + // Recognition error - abort rule + goto errorExit } - { - p.SetState(292) - p.Match(MongoShellParserRPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } + } + { + p.SetState(341) + p.Match(MongoShellParserLPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit } - - case MongoShellParserNEW: - p.EnterOuterAlt(localctx, 2) + } + p.SetState(344) + p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } + switch p.GetTokenStream().LA(1) { + case MongoShellParserDOUBLE_QUOTED_STRING, MongoShellParserSINGLE_QUOTED_STRING: { - p.SetState(293) - p.Match(MongoShellParserNEW) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } + p.SetState(342) + p.StringLiteral() } + + case MongoShellParserNUMBER: { - p.SetState(294) - p.Match(MongoShellParserDATE) + p.SetState(343) + p.Match(MongoShellParserNUMBER) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.NotifyErrorListeners("'new' keyword is not supported. Use Date() directly", nil, nil) + + case MongoShellParserRPAREN: default: - p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) - goto errorExit + } + { + p.SetState(346) + p.Match(MongoShellParserRPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } errorExit: @@ -6043,10 +7322,10 @@ func (s *UuidHelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *MongoShellParser) UuidHelper() (localctx IUuidHelperContext) { localctx = NewUuidHelperContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 50, MongoShellParserRULE_uuidHelper) + p.EnterRule(localctx, 64, MongoShellParserRULE_uuidHelper) p.EnterOuterAlt(localctx, 1) { - p.SetState(298) + p.SetState(348) p.Match(MongoShellParserUUID) if p.HasError() { // Recognition error - abort rule @@ -6054,7 +7333,7 @@ func (p *MongoShellParser) UuidHelper() (localctx IUuidHelperContext) { } } { - p.SetState(299) + p.SetState(349) p.Match(MongoShellParserLPAREN) if p.HasError() { // Recognition error - abort rule @@ -6062,11 +7341,11 @@ func (p *MongoShellParser) UuidHelper() (localctx IUuidHelperContext) { } } { - p.SetState(300) + p.SetState(350) p.StringLiteral() } { - p.SetState(301) + p.SetState(351) p.Match(MongoShellParserRPAREN) if p.HasError() { // Recognition error - abort rule @@ -6206,12 +7485,12 @@ func (s *LongHelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *MongoShellParser) LongHelper() (localctx ILongHelperContext) { localctx = NewLongHelperContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 52, MongoShellParserRULE_longHelper) + p.EnterRule(localctx, 66, MongoShellParserRULE_longHelper) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(303) + p.SetState(353) _la = p.GetTokenStream().LA(1) if !(_la == MongoShellParserLONG || _la == MongoShellParserNUMBER_LONG) { @@ -6222,14 +7501,14 @@ func (p *MongoShellParser) LongHelper() (localctx ILongHelperContext) { } } { - p.SetState(304) + p.SetState(354) p.Match(MongoShellParserLPAREN) if p.HasError() { // Recognition error - abort rule goto errorExit } } - p.SetState(307) + p.SetState(357) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -6238,7 +7517,7 @@ func (p *MongoShellParser) LongHelper() (localctx ILongHelperContext) { switch p.GetTokenStream().LA(1) { case MongoShellParserNUMBER: { - p.SetState(305) + p.SetState(355) p.Match(MongoShellParserNUMBER) if p.HasError() { // Recognition error - abort rule @@ -6248,7 +7527,7 @@ func (p *MongoShellParser) LongHelper() (localctx ILongHelperContext) { case MongoShellParserDOUBLE_QUOTED_STRING, MongoShellParserSINGLE_QUOTED_STRING: { - p.SetState(306) + p.SetState(356) p.StringLiteral() } @@ -6257,7 +7536,7 @@ func (p *MongoShellParser) LongHelper() (localctx ILongHelperContext) { goto errorExit } { - p.SetState(309) + p.SetState(359) p.Match(MongoShellParserRPAREN) if p.HasError() { // Recognition error - abort rule @@ -6380,12 +7659,12 @@ func (s *Int32HelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *MongoShellParser) Int32Helper() (localctx IInt32HelperContext) { localctx = NewInt32HelperContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 54, MongoShellParserRULE_int32Helper) + p.EnterRule(localctx, 68, MongoShellParserRULE_int32Helper) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(311) + p.SetState(361) _la = p.GetTokenStream().LA(1) if !(_la == MongoShellParserINT32 || _la == MongoShellParserNUMBER_INT) { @@ -6396,7 +7675,7 @@ func (p *MongoShellParser) Int32Helper() (localctx IInt32HelperContext) { } } { - p.SetState(312) + p.SetState(362) p.Match(MongoShellParserLPAREN) if p.HasError() { // Recognition error - abort rule @@ -6404,7 +7683,7 @@ func (p *MongoShellParser) Int32Helper() (localctx IInt32HelperContext) { } } { - p.SetState(313) + p.SetState(363) p.Match(MongoShellParserNUMBER) if p.HasError() { // Recognition error - abort rule @@ -6412,7 +7691,7 @@ func (p *MongoShellParser) Int32Helper() (localctx IInt32HelperContext) { } } { - p.SetState(314) + p.SetState(364) p.Match(MongoShellParserRPAREN) if p.HasError() { // Recognition error - abort rule @@ -6530,10 +7809,10 @@ func (s *DoubleHelperContext) Accept(visitor antlr.ParseTreeVisitor) interface{} func (p *MongoShellParser) DoubleHelper() (localctx IDoubleHelperContext) { localctx = NewDoubleHelperContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 56, MongoShellParserRULE_doubleHelper) + p.EnterRule(localctx, 70, MongoShellParserRULE_doubleHelper) p.EnterOuterAlt(localctx, 1) { - p.SetState(316) + p.SetState(366) p.Match(MongoShellParserDOUBLE) if p.HasError() { // Recognition error - abort rule @@ -6541,7 +7820,7 @@ func (p *MongoShellParser) DoubleHelper() (localctx IDoubleHelperContext) { } } { - p.SetState(317) + p.SetState(367) p.Match(MongoShellParserLPAREN) if p.HasError() { // Recognition error - abort rule @@ -6549,7 +7828,7 @@ func (p *MongoShellParser) DoubleHelper() (localctx IDoubleHelperContext) { } } { - p.SetState(318) + p.SetState(368) p.Match(MongoShellParserNUMBER) if p.HasError() { // Recognition error - abort rule @@ -6557,7 +7836,7 @@ func (p *MongoShellParser) DoubleHelper() (localctx IDoubleHelperContext) { } } { - p.SetState(319) + p.SetState(369) p.Match(MongoShellParserRPAREN) if p.HasError() { // Recognition error - abort rule @@ -6692,12 +7971,12 @@ func (s *Decimal128HelperContext) Accept(visitor antlr.ParseTreeVisitor) interfa func (p *MongoShellParser) Decimal128Helper() (localctx IDecimal128HelperContext) { localctx = NewDecimal128HelperContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 58, MongoShellParserRULE_decimal128Helper) + p.EnterRule(localctx, 72, MongoShellParserRULE_decimal128Helper) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(321) + p.SetState(371) _la = p.GetTokenStream().LA(1) if !(_la == MongoShellParserDECIMAL128 || _la == MongoShellParserNUMBER_DECIMAL) { @@ -6708,7 +7987,7 @@ func (p *MongoShellParser) Decimal128Helper() (localctx IDecimal128HelperContext } } { - p.SetState(322) + p.SetState(372) p.Match(MongoShellParserLPAREN) if p.HasError() { // Recognition error - abort rule @@ -6716,11 +7995,11 @@ func (p *MongoShellParser) Decimal128Helper() (localctx IDecimal128HelperContext } } { - p.SetState(323) + p.SetState(373) p.StringLiteral() } { - p.SetState(324) + p.SetState(374) p.Match(MongoShellParserRPAREN) if p.HasError() { // Recognition error - abort rule @@ -6929,8 +8208,8 @@ func (s *TimestampDocHelperContext) Accept(visitor antlr.ParseTreeVisitor) inter func (p *MongoShellParser) TimestampHelper() (localctx ITimestampHelperContext) { localctx = NewTimestampHelperContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 60, MongoShellParserRULE_timestampHelper) - p.SetState(337) + p.EnterRule(localctx, 74, MongoShellParserRULE_timestampHelper) + p.SetState(387) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -6941,7 +8220,7 @@ func (p *MongoShellParser) TimestampHelper() (localctx ITimestampHelperContext) localctx = NewTimestampDocHelperContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(326) + p.SetState(376) p.Match(MongoShellParserTIMESTAMP) if p.HasError() { // Recognition error - abort rule @@ -6949,7 +8228,7 @@ func (p *MongoShellParser) TimestampHelper() (localctx ITimestampHelperContext) } } { - p.SetState(327) + p.SetState(377) p.Match(MongoShellParserLPAREN) if p.HasError() { // Recognition error - abort rule @@ -6957,11 +8236,11 @@ func (p *MongoShellParser) TimestampHelper() (localctx ITimestampHelperContext) } } { - p.SetState(328) + p.SetState(378) p.Document() } { - p.SetState(329) + p.SetState(379) p.Match(MongoShellParserRPAREN) if p.HasError() { // Recognition error - abort rule @@ -6973,7 +8252,7 @@ func (p *MongoShellParser) TimestampHelper() (localctx ITimestampHelperContext) localctx = NewTimestampArgsHelperContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(331) + p.SetState(381) p.Match(MongoShellParserTIMESTAMP) if p.HasError() { // Recognition error - abort rule @@ -6981,7 +8260,7 @@ func (p *MongoShellParser) TimestampHelper() (localctx ITimestampHelperContext) } } { - p.SetState(332) + p.SetState(382) p.Match(MongoShellParserLPAREN) if p.HasError() { // Recognition error - abort rule @@ -6989,7 +8268,7 @@ func (p *MongoShellParser) TimestampHelper() (localctx ITimestampHelperContext) } } { - p.SetState(333) + p.SetState(383) p.Match(MongoShellParserNUMBER) if p.HasError() { // Recognition error - abort rule @@ -6997,7 +8276,7 @@ func (p *MongoShellParser) TimestampHelper() (localctx ITimestampHelperContext) } } { - p.SetState(334) + p.SetState(384) p.Match(MongoShellParserCOMMA) if p.HasError() { // Recognition error - abort rule @@ -7005,7 +8284,7 @@ func (p *MongoShellParser) TimestampHelper() (localctx ITimestampHelperContext) } } { - p.SetState(335) + p.SetState(385) p.Match(MongoShellParserNUMBER) if p.HasError() { // Recognition error - abort rule @@ -7013,7 +8292,7 @@ func (p *MongoShellParser) TimestampHelper() (localctx ITimestampHelperContext) } } { - p.SetState(336) + p.SetState(386) p.Match(MongoShellParserRPAREN) if p.HasError() { // Recognition error - abort rule @@ -7052,7 +8331,6 @@ type IRegExpConstructorContext interface { StringLiteral(i int) IStringLiteralContext RPAREN() antlr.TerminalNode COMMA() antlr.TerminalNode - NEW() antlr.TerminalNode // IsRegExpConstructorContext differentiates from other interfaces. IsRegExpConstructorContext() @@ -7147,10 +8425,6 @@ func (s *RegExpConstructorContext) COMMA() antlr.TerminalNode { return s.GetToken(MongoShellParserCOMMA, 0) } -func (s *RegExpConstructorContext) NEW() antlr.TerminalNode { - return s.GetToken(MongoShellParserNEW, 0) -} - func (s *RegExpConstructorContext) GetRuleContext() antlr.RuleContext { return s } @@ -7183,92 +8457,59 @@ func (s *RegExpConstructorContext) Accept(visitor antlr.ParseTreeVisitor) interf func (p *MongoShellParser) RegExpConstructor() (localctx IRegExpConstructorContext) { localctx = NewRegExpConstructorContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 62, MongoShellParserRULE_regExpConstructor) + p.EnterRule(localctx, 76, MongoShellParserRULE_regExpConstructor) var _la int - p.SetState(351) + 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) - switch p.GetTokenStream().LA(1) { - case MongoShellParserREG_EXP: - p.EnterOuterAlt(localctx, 1) - { - p.SetState(339) - p.Match(MongoShellParserREG_EXP) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } + if _la == MongoShellParserCOMMA { { - p.SetState(340) - p.Match(MongoShellParserLPAREN) + p.SetState(392) + p.Match(MongoShellParserCOMMA) if p.HasError() { // Recognition error - abort rule goto errorExit } } { - p.SetState(341) + p.SetState(393) p.StringLiteral() } - p.SetState(344) - p.GetErrorHandler().Sync(p) + + } + { + p.SetState(396) + p.Match(MongoShellParserRPAREN) if p.HasError() { + // Recognition error - abort rule goto errorExit } - _la = p.GetTokenStream().LA(1) - - if _la == MongoShellParserCOMMA { - { - p.SetState(342) - p.Match(MongoShellParserCOMMA) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(343) - p.StringLiteral() - } - - } - { - p.SetState(346) - p.Match(MongoShellParserRPAREN) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - - case MongoShellParserNEW: - p.EnterOuterAlt(localctx, 2) - { - p.SetState(348) - p.Match(MongoShellParserNEW) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - { - p.SetState(349) - p.Match(MongoShellParserREG_EXP) - if p.HasError() { - // Recognition error - abort rule - goto errorExit - } - } - p.NotifyErrorListeners("'new' keyword is not supported. Use RegExp() directly", nil, nil) - - default: - p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) - goto errorExit } errorExit: @@ -7572,8 +8813,8 @@ func (s *NumberLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{ func (p *MongoShellParser) Literal() (localctx ILiteralContext) { localctx = NewLiteralContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 64, MongoShellParserRULE_literal) - p.SetState(358) + p.EnterRule(localctx, 78, MongoShellParserRULE_literal) + p.SetState(403) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -7584,7 +8825,7 @@ func (p *MongoShellParser) Literal() (localctx ILiteralContext) { localctx = NewStringLiteralValueContext(p, localctx) p.EnterOuterAlt(localctx, 1) { - p.SetState(353) + p.SetState(398) p.StringLiteral() } @@ -7592,7 +8833,7 @@ func (p *MongoShellParser) Literal() (localctx ILiteralContext) { localctx = NewNumberLiteralContext(p, localctx) p.EnterOuterAlt(localctx, 2) { - p.SetState(354) + p.SetState(399) p.Match(MongoShellParserNUMBER) if p.HasError() { // Recognition error - abort rule @@ -7604,7 +8845,7 @@ func (p *MongoShellParser) Literal() (localctx ILiteralContext) { localctx = NewTrueLiteralContext(p, localctx) p.EnterOuterAlt(localctx, 3) { - p.SetState(355) + p.SetState(400) p.Match(MongoShellParserTRUE) if p.HasError() { // Recognition error - abort rule @@ -7616,7 +8857,7 @@ func (p *MongoShellParser) Literal() (localctx ILiteralContext) { localctx = NewFalseLiteralContext(p, localctx) p.EnterOuterAlt(localctx, 4) { - p.SetState(356) + p.SetState(401) p.Match(MongoShellParserFALSE) if p.HasError() { // Recognition error - abort rule @@ -7628,7 +8869,7 @@ func (p *MongoShellParser) Literal() (localctx ILiteralContext) { localctx = NewNullLiteralContext(p, localctx) p.EnterOuterAlt(localctx, 5) { - p.SetState(357) + p.SetState(402) p.Match(MongoShellParserNULL) if p.HasError() { // Recognition error - abort rule @@ -7741,12 +8982,12 @@ func (s *StringLiteralContext) Accept(visitor antlr.ParseTreeVisitor) interface{ func (p *MongoShellParser) StringLiteral() (localctx IStringLiteralContext) { localctx = NewStringLiteralContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 66, MongoShellParserRULE_stringLiteral) + p.EnterRule(localctx, 80, MongoShellParserRULE_stringLiteral) var _la int p.EnterOuterAlt(localctx, 1) { - p.SetState(360) + p.SetState(405) _la = p.GetTokenStream().LA(1) if !(_la == MongoShellParserDOUBLE_QUOTED_STRING || _la == MongoShellParserSINGLE_QUOTED_STRING) { @@ -7791,9 +9032,15 @@ type IIdentifierContext interface { 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 @@ -7901,6 +9148,26 @@ func (s *IdentifierContext) FIND_ONE() antlr.TerminalNode { return s.GetToken(MongoShellParserFIND_ONE, 0) } +func (s *IdentifierContext) COUNT_DOCUMENTS() antlr.TerminalNode { + return s.GetToken(MongoShellParserCOUNT_DOCUMENTS, 0) +} + +func (s *IdentifierContext) ESTIMATED_DOCUMENT_COUNT() antlr.TerminalNode { + return s.GetToken(MongoShellParserESTIMATED_DOCUMENT_COUNT, 0) +} + +func (s *IdentifierContext) DISTINCT() antlr.TerminalNode { + return s.GetToken(MongoShellParserDISTINCT, 0) +} + +func (s *IdentifierContext) AGGREGATE() antlr.TerminalNode { + return s.GetToken(MongoShellParserAGGREGATE, 0) +} + +func (s *IdentifierContext) GET_INDEXES() antlr.TerminalNode { + return s.GetToken(MongoShellParserGET_INDEXES, 0) +} + func (s *IdentifierContext) SORT() antlr.TerminalNode { return s.GetToken(MongoShellParserSORT, 0) } @@ -7913,6 +9180,10 @@ func (s *IdentifierContext) SKIP_() antlr.TerminalNode { return s.GetToken(MongoShellParserSKIP_, 0) } +func (s *IdentifierContext) COUNT() antlr.TerminalNode { + return s.GetToken(MongoShellParserCOUNT, 0) +} + func (s *IdentifierContext) PROJECTION() antlr.TerminalNode { return s.GetToken(MongoShellParserPROJECTION, 0) } @@ -8017,8 +9288,8 @@ func (s *IdentifierContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { localctx = NewIdentifierContext(p, p.GetParserRuleContext(), p.GetState()) - p.EnterRule(localctx, 68, MongoShellParserRULE_identifier) - p.SetState(397) + p.EnterRule(localctx, 82, MongoShellParserRULE_identifier) + p.SetState(448) p.GetErrorHandler().Sync(p) if p.HasError() { goto errorExit @@ -8028,7 +9299,7 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { case MongoShellParserIDENTIFIER: p.EnterOuterAlt(localctx, 1) { - p.SetState(362) + p.SetState(407) p.Match(MongoShellParserIDENTIFIER) if p.HasError() { // Recognition error - abort rule @@ -8039,7 +9310,7 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { case MongoShellParserDOLLAR: p.EnterOuterAlt(localctx, 2) { - p.SetState(363) + p.SetState(408) p.Match(MongoShellParserDOLLAR) if p.HasError() { // Recognition error - abort rule @@ -8047,7 +9318,7 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { } } { - p.SetState(364) + p.SetState(409) p.Match(MongoShellParserIDENTIFIER) if p.HasError() { // Recognition error - abort rule @@ -8058,7 +9329,7 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { case MongoShellParserSHOW: p.EnterOuterAlt(localctx, 3) { - p.SetState(365) + p.SetState(410) p.Match(MongoShellParserSHOW) if p.HasError() { // Recognition error - abort rule @@ -8069,7 +9340,7 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { case MongoShellParserDBS: p.EnterOuterAlt(localctx, 4) { - p.SetState(366) + p.SetState(411) p.Match(MongoShellParserDBS) if p.HasError() { // Recognition error - abort rule @@ -8080,7 +9351,7 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { case MongoShellParserDATABASES: p.EnterOuterAlt(localctx, 5) { - p.SetState(367) + p.SetState(412) p.Match(MongoShellParserDATABASES) if p.HasError() { // Recognition error - abort rule @@ -8091,7 +9362,7 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { case MongoShellParserCOLLECTIONS: p.EnterOuterAlt(localctx, 6) { - p.SetState(368) + p.SetState(413) p.Match(MongoShellParserCOLLECTIONS) if p.HasError() { // Recognition error - abort rule @@ -8102,7 +9373,7 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { case MongoShellParserDB: p.EnterOuterAlt(localctx, 7) { - p.SetState(369) + p.SetState(414) p.Match(MongoShellParserDB) if p.HasError() { // Recognition error - abort rule @@ -8113,7 +9384,7 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { case MongoShellParserNEW: p.EnterOuterAlt(localctx, 8) { - p.SetState(370) + p.SetState(415) p.Match(MongoShellParserNEW) if p.HasError() { // Recognition error - abort rule @@ -8124,7 +9395,7 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { case MongoShellParserTRUE: p.EnterOuterAlt(localctx, 9) { - p.SetState(371) + p.SetState(416) p.Match(MongoShellParserTRUE) if p.HasError() { // Recognition error - abort rule @@ -8135,7 +9406,7 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { case MongoShellParserFALSE: p.EnterOuterAlt(localctx, 10) { - p.SetState(372) + p.SetState(417) p.Match(MongoShellParserFALSE) if p.HasError() { // Recognition error - abort rule @@ -8146,7 +9417,7 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { case MongoShellParserNULL: p.EnterOuterAlt(localctx, 11) { - p.SetState(373) + p.SetState(418) p.Match(MongoShellParserNULL) if p.HasError() { // Recognition error - abort rule @@ -8157,7 +9428,7 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { case MongoShellParserFIND: p.EnterOuterAlt(localctx, 12) { - p.SetState(374) + p.SetState(419) p.Match(MongoShellParserFIND) if p.HasError() { // Recognition error - abort rule @@ -8168,7 +9439,7 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { case MongoShellParserFIND_ONE: p.EnterOuterAlt(localctx, 13) { - p.SetState(375) + p.SetState(420) p.Match(MongoShellParserFIND_ONE) if p.HasError() { // Recognition error - abort rule @@ -8176,10 +9447,65 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { } } - case MongoShellParserSORT: + case MongoShellParserCOUNT_DOCUMENTS: p.EnterOuterAlt(localctx, 14) { - p.SetState(376) + p.SetState(421) + p.Match(MongoShellParserCOUNT_DOCUMENTS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case MongoShellParserESTIMATED_DOCUMENT_COUNT: + p.EnterOuterAlt(localctx, 15) + { + p.SetState(422) + p.Match(MongoShellParserESTIMATED_DOCUMENT_COUNT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case MongoShellParserDISTINCT: + p.EnterOuterAlt(localctx, 16) + { + p.SetState(423) + p.Match(MongoShellParserDISTINCT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case MongoShellParserAGGREGATE: + p.EnterOuterAlt(localctx, 17) + { + p.SetState(424) + p.Match(MongoShellParserAGGREGATE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case MongoShellParserGET_INDEXES: + p.EnterOuterAlt(localctx, 18) + { + p.SetState(425) + p.Match(MongoShellParserGET_INDEXES) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case MongoShellParserSORT: + p.EnterOuterAlt(localctx, 19) + { + p.SetState(426) p.Match(MongoShellParserSORT) if p.HasError() { // Recognition error - abort rule @@ -8188,9 +9514,9 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { } case MongoShellParserLIMIT: - p.EnterOuterAlt(localctx, 15) + p.EnterOuterAlt(localctx, 20) { - p.SetState(377) + p.SetState(427) p.Match(MongoShellParserLIMIT) if p.HasError() { // Recognition error - abort rule @@ -8199,9 +9525,9 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { } case MongoShellParserSKIP_: - p.EnterOuterAlt(localctx, 16) + p.EnterOuterAlt(localctx, 21) { - p.SetState(378) + p.SetState(428) p.Match(MongoShellParserSKIP_) if p.HasError() { // Recognition error - abort rule @@ -8209,10 +9535,21 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { } } + case MongoShellParserCOUNT: + p.EnterOuterAlt(localctx, 22) + { + p.SetState(429) + p.Match(MongoShellParserCOUNT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + case MongoShellParserPROJECTION: - p.EnterOuterAlt(localctx, 17) + p.EnterOuterAlt(localctx, 23) { - p.SetState(379) + p.SetState(430) p.Match(MongoShellParserPROJECTION) if p.HasError() { // Recognition error - abort rule @@ -8221,9 +9558,9 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { } case MongoShellParserPROJECT: - p.EnterOuterAlt(localctx, 18) + p.EnterOuterAlt(localctx, 24) { - p.SetState(380) + p.SetState(431) p.Match(MongoShellParserPROJECT) if p.HasError() { // Recognition error - abort rule @@ -8232,9 +9569,9 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { } case MongoShellParserGET_COLLECTION: - p.EnterOuterAlt(localctx, 19) + p.EnterOuterAlt(localctx, 25) { - p.SetState(381) + p.SetState(432) p.Match(MongoShellParserGET_COLLECTION) if p.HasError() { // Recognition error - abort rule @@ -8243,9 +9580,9 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { } case MongoShellParserGET_COLLECTION_NAMES: - p.EnterOuterAlt(localctx, 20) + p.EnterOuterAlt(localctx, 26) { - p.SetState(382) + p.SetState(433) p.Match(MongoShellParserGET_COLLECTION_NAMES) if p.HasError() { // Recognition error - abort rule @@ -8254,9 +9591,9 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { } case MongoShellParserGET_COLLECTION_INFOS: - p.EnterOuterAlt(localctx, 21) + p.EnterOuterAlt(localctx, 27) { - p.SetState(383) + p.SetState(434) p.Match(MongoShellParserGET_COLLECTION_INFOS) if p.HasError() { // Recognition error - abort rule @@ -8265,9 +9602,9 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { } case MongoShellParserOBJECT_ID: - p.EnterOuterAlt(localctx, 22) + p.EnterOuterAlt(localctx, 28) { - p.SetState(384) + p.SetState(435) p.Match(MongoShellParserOBJECT_ID) if p.HasError() { // Recognition error - abort rule @@ -8276,9 +9613,9 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { } case MongoShellParserISO_DATE: - p.EnterOuterAlt(localctx, 23) + p.EnterOuterAlt(localctx, 29) { - p.SetState(385) + p.SetState(436) p.Match(MongoShellParserISO_DATE) if p.HasError() { // Recognition error - abort rule @@ -8287,9 +9624,9 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { } case MongoShellParserDATE: - p.EnterOuterAlt(localctx, 24) + p.EnterOuterAlt(localctx, 30) { - p.SetState(386) + p.SetState(437) p.Match(MongoShellParserDATE) if p.HasError() { // Recognition error - abort rule @@ -8298,9 +9635,9 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { } case MongoShellParserUUID: - p.EnterOuterAlt(localctx, 25) + p.EnterOuterAlt(localctx, 31) { - p.SetState(387) + p.SetState(438) p.Match(MongoShellParserUUID) if p.HasError() { // Recognition error - abort rule @@ -8309,9 +9646,9 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { } case MongoShellParserLONG: - p.EnterOuterAlt(localctx, 26) + p.EnterOuterAlt(localctx, 32) { - p.SetState(388) + p.SetState(439) p.Match(MongoShellParserLONG) if p.HasError() { // Recognition error - abort rule @@ -8320,9 +9657,9 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { } case MongoShellParserNUMBER_LONG: - p.EnterOuterAlt(localctx, 27) + p.EnterOuterAlt(localctx, 33) { - p.SetState(389) + p.SetState(440) p.Match(MongoShellParserNUMBER_LONG) if p.HasError() { // Recognition error - abort rule @@ -8331,9 +9668,9 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { } case MongoShellParserINT32: - p.EnterOuterAlt(localctx, 28) + p.EnterOuterAlt(localctx, 34) { - p.SetState(390) + p.SetState(441) p.Match(MongoShellParserINT32) if p.HasError() { // Recognition error - abort rule @@ -8342,9 +9679,9 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { } case MongoShellParserNUMBER_INT: - p.EnterOuterAlt(localctx, 29) + p.EnterOuterAlt(localctx, 35) { - p.SetState(391) + p.SetState(442) p.Match(MongoShellParserNUMBER_INT) if p.HasError() { // Recognition error - abort rule @@ -8353,9 +9690,9 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { } case MongoShellParserDOUBLE: - p.EnterOuterAlt(localctx, 30) + p.EnterOuterAlt(localctx, 36) { - p.SetState(392) + p.SetState(443) p.Match(MongoShellParserDOUBLE) if p.HasError() { // Recognition error - abort rule @@ -8364,9 +9701,9 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { } case MongoShellParserDECIMAL128: - p.EnterOuterAlt(localctx, 31) + p.EnterOuterAlt(localctx, 37) { - p.SetState(393) + p.SetState(444) p.Match(MongoShellParserDECIMAL128) if p.HasError() { // Recognition error - abort rule @@ -8375,9 +9712,9 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { } case MongoShellParserNUMBER_DECIMAL: - p.EnterOuterAlt(localctx, 32) + p.EnterOuterAlt(localctx, 38) { - p.SetState(394) + p.SetState(445) p.Match(MongoShellParserNUMBER_DECIMAL) if p.HasError() { // Recognition error - abort rule @@ -8386,9 +9723,9 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { } case MongoShellParserTIMESTAMP: - p.EnterOuterAlt(localctx, 33) + p.EnterOuterAlt(localctx, 39) { - p.SetState(395) + p.SetState(446) p.Match(MongoShellParserTIMESTAMP) if p.HasError() { // Recognition error - abort rule @@ -8397,9 +9734,9 @@ func (p *MongoShellParser) Identifier() (localctx IIdentifierContext) { } case MongoShellParserREG_EXP: - p.EnterOuterAlt(localctx, 34) + p.EnterOuterAlt(localctx, 40) { - p.SetState(396) + p.SetState(447) p.Match(MongoShellParserREG_EXP) if p.HasError() { // Recognition error - abort rule diff --git a/mongodb/mongoshellparser_base_listener.go b/mongodb/mongoshellparser_base_listener.go index 2aa24ad..772b5e8 100644 --- a/mongodb/mongoshellparser_base_listener.go +++ b/mongodb/mongoshellparser_base_listener.go @@ -104,6 +104,38 @@ func (s *BaseMongoShellParserListener) EnterFindOneMethod(ctx *FindOneMethodCont // ExitFindOneMethod is called when production findOneMethod is exited. func (s *BaseMongoShellParserListener) ExitFindOneMethod(ctx *FindOneMethodContext) {} +// EnterCountDocumentsMethod is called when production countDocumentsMethod is entered. +func (s *BaseMongoShellParserListener) EnterCountDocumentsMethod(ctx *CountDocumentsMethodContext) {} + +// ExitCountDocumentsMethod is called when production countDocumentsMethod is exited. +func (s *BaseMongoShellParserListener) ExitCountDocumentsMethod(ctx *CountDocumentsMethodContext) {} + +// EnterEstimatedDocumentCountMethod is called when production estimatedDocumentCountMethod is entered. +func (s *BaseMongoShellParserListener) EnterEstimatedDocumentCountMethod(ctx *EstimatedDocumentCountMethodContext) { +} + +// ExitEstimatedDocumentCountMethod is called when production estimatedDocumentCountMethod is exited. +func (s *BaseMongoShellParserListener) ExitEstimatedDocumentCountMethod(ctx *EstimatedDocumentCountMethodContext) { +} + +// EnterDistinctMethod is called when production distinctMethod is entered. +func (s *BaseMongoShellParserListener) EnterDistinctMethod(ctx *DistinctMethodContext) {} + +// ExitDistinctMethod is called when production distinctMethod is exited. +func (s *BaseMongoShellParserListener) ExitDistinctMethod(ctx *DistinctMethodContext) {} + +// EnterAggregateMethod is called when production aggregateMethod is entered. +func (s *BaseMongoShellParserListener) EnterAggregateMethod(ctx *AggregateMethodContext) {} + +// ExitAggregateMethod is called when production aggregateMethod is exited. +func (s *BaseMongoShellParserListener) ExitAggregateMethod(ctx *AggregateMethodContext) {} + +// EnterGetIndexesMethod is called when production getIndexesMethod is entered. +func (s *BaseMongoShellParserListener) EnterGetIndexesMethod(ctx *GetIndexesMethodContext) {} + +// ExitGetIndexesMethod is called when production getIndexesMethod is exited. +func (s *BaseMongoShellParserListener) ExitGetIndexesMethod(ctx *GetIndexesMethodContext) {} + // EnterSortMethod is called when production sortMethod is entered. func (s *BaseMongoShellParserListener) EnterSortMethod(ctx *SortMethodContext) {} @@ -122,6 +154,12 @@ func (s *BaseMongoShellParserListener) EnterSkipMethod(ctx *SkipMethodContext) { // ExitSkipMethod is called when production skipMethod is exited. func (s *BaseMongoShellParserListener) ExitSkipMethod(ctx *SkipMethodContext) {} +// EnterCountMethod is called when production countMethod is entered. +func (s *BaseMongoShellParserListener) EnterCountMethod(ctx *CountMethodContext) {} + +// ExitCountMethod is called when production countMethod is exited. +func (s *BaseMongoShellParserListener) ExitCountMethod(ctx *CountMethodContext) {} + // EnterProjectionMethod is called when production projectionMethod is entered. func (s *BaseMongoShellParserListener) EnterProjectionMethod(ctx *ProjectionMethodContext) {} @@ -208,6 +246,18 @@ func (s *BaseMongoShellParserListener) EnterLiteralValue(ctx *LiteralValueContex // ExitLiteralValue is called when production literalValue is exited. func (s *BaseMongoShellParserListener) ExitLiteralValue(ctx *LiteralValueContext) {} +// EnterNewKeywordValue is called when production newKeywordValue is entered. +func (s *BaseMongoShellParserListener) EnterNewKeywordValue(ctx *NewKeywordValueContext) {} + +// ExitNewKeywordValue is called when production newKeywordValue is exited. +func (s *BaseMongoShellParserListener) ExitNewKeywordValue(ctx *NewKeywordValueContext) {} + +// EnterNewKeywordError is called when production newKeywordError is entered. +func (s *BaseMongoShellParserListener) EnterNewKeywordError(ctx *NewKeywordErrorContext) {} + +// ExitNewKeywordError is called when production newKeywordError is exited. +func (s *BaseMongoShellParserListener) ExitNewKeywordError(ctx *NewKeywordErrorContext) {} + // EnterArray is called when production array is entered. func (s *BaseMongoShellParserListener) EnterArray(ctx *ArrayContext) {} diff --git a/mongodb/mongoshellparser_base_visitor.go b/mongodb/mongoshellparser_base_visitor.go index 2b987a4..5b82400 100644 --- a/mongodb/mongoshellparser_base_visitor.go +++ b/mongodb/mongoshellparser_base_visitor.go @@ -63,6 +63,26 @@ func (v *BaseMongoShellParserVisitor) VisitFindOneMethod(ctx *FindOneMethodConte return v.VisitChildren(ctx) } +func (v *BaseMongoShellParserVisitor) VisitCountDocumentsMethod(ctx *CountDocumentsMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitEstimatedDocumentCountMethod(ctx *EstimatedDocumentCountMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitDistinctMethod(ctx *DistinctMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitAggregateMethod(ctx *AggregateMethodContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitGetIndexesMethod(ctx *GetIndexesMethodContext) interface{} { + return v.VisitChildren(ctx) +} + func (v *BaseMongoShellParserVisitor) VisitSortMethod(ctx *SortMethodContext) interface{} { return v.VisitChildren(ctx) } @@ -75,6 +95,10 @@ func (v *BaseMongoShellParserVisitor) VisitSkipMethod(ctx *SkipMethodContext) in return v.VisitChildren(ctx) } +func (v *BaseMongoShellParserVisitor) VisitCountMethod(ctx *CountMethodContext) interface{} { + return v.VisitChildren(ctx) +} + func (v *BaseMongoShellParserVisitor) VisitProjectionMethod(ctx *ProjectionMethodContext) interface{} { return v.VisitChildren(ctx) } @@ -131,6 +155,14 @@ func (v *BaseMongoShellParserVisitor) VisitLiteralValue(ctx *LiteralValueContext return v.VisitChildren(ctx) } +func (v *BaseMongoShellParserVisitor) VisitNewKeywordValue(ctx *NewKeywordValueContext) interface{} { + return v.VisitChildren(ctx) +} + +func (v *BaseMongoShellParserVisitor) VisitNewKeywordError(ctx *NewKeywordErrorContext) interface{} { + return v.VisitChildren(ctx) +} + func (v *BaseMongoShellParserVisitor) VisitArray(ctx *ArrayContext) interface{} { return v.VisitChildren(ctx) } diff --git a/mongodb/mongoshellparser_listener.go b/mongodb/mongoshellparser_listener.go index 0cd4ecf..5cde51e 100644 --- a/mongodb/mongoshellparser_listener.go +++ b/mongodb/mongoshellparser_listener.go @@ -49,6 +49,21 @@ type MongoShellParserListener interface { // EnterFindOneMethod is called when entering the findOneMethod production. EnterFindOneMethod(c *FindOneMethodContext) + // EnterCountDocumentsMethod is called when entering the countDocumentsMethod production. + EnterCountDocumentsMethod(c *CountDocumentsMethodContext) + + // EnterEstimatedDocumentCountMethod is called when entering the estimatedDocumentCountMethod production. + EnterEstimatedDocumentCountMethod(c *EstimatedDocumentCountMethodContext) + + // EnterDistinctMethod is called when entering the distinctMethod production. + EnterDistinctMethod(c *DistinctMethodContext) + + // EnterAggregateMethod is called when entering the aggregateMethod production. + EnterAggregateMethod(c *AggregateMethodContext) + + // EnterGetIndexesMethod is called when entering the getIndexesMethod production. + EnterGetIndexesMethod(c *GetIndexesMethodContext) + // EnterSortMethod is called when entering the sortMethod production. EnterSortMethod(c *SortMethodContext) @@ -58,6 +73,9 @@ type MongoShellParserListener interface { // EnterSkipMethod is called when entering the skipMethod production. EnterSkipMethod(c *SkipMethodContext) + // EnterCountMethod is called when entering the countMethod production. + EnterCountMethod(c *CountMethodContext) + // EnterProjectionMethod is called when entering the projectionMethod production. EnterProjectionMethod(c *ProjectionMethodContext) @@ -100,6 +118,12 @@ type MongoShellParserListener interface { // EnterLiteralValue is called when entering the literalValue production. EnterLiteralValue(c *LiteralValueContext) + // EnterNewKeywordValue is called when entering the newKeywordValue production. + EnterNewKeywordValue(c *NewKeywordValueContext) + + // EnterNewKeywordError is called when entering the newKeywordError production. + EnterNewKeywordError(c *NewKeywordErrorContext) + // EnterArray is called when entering the array production. EnterArray(c *ArrayContext) @@ -202,6 +226,21 @@ type MongoShellParserListener interface { // ExitFindOneMethod is called when exiting the findOneMethod production. ExitFindOneMethod(c *FindOneMethodContext) + // ExitCountDocumentsMethod is called when exiting the countDocumentsMethod production. + ExitCountDocumentsMethod(c *CountDocumentsMethodContext) + + // ExitEstimatedDocumentCountMethod is called when exiting the estimatedDocumentCountMethod production. + ExitEstimatedDocumentCountMethod(c *EstimatedDocumentCountMethodContext) + + // ExitDistinctMethod is called when exiting the distinctMethod production. + ExitDistinctMethod(c *DistinctMethodContext) + + // ExitAggregateMethod is called when exiting the aggregateMethod production. + ExitAggregateMethod(c *AggregateMethodContext) + + // ExitGetIndexesMethod is called when exiting the getIndexesMethod production. + ExitGetIndexesMethod(c *GetIndexesMethodContext) + // ExitSortMethod is called when exiting the sortMethod production. ExitSortMethod(c *SortMethodContext) @@ -211,6 +250,9 @@ type MongoShellParserListener interface { // ExitSkipMethod is called when exiting the skipMethod production. ExitSkipMethod(c *SkipMethodContext) + // ExitCountMethod is called when exiting the countMethod production. + ExitCountMethod(c *CountMethodContext) + // ExitProjectionMethod is called when exiting the projectionMethod production. ExitProjectionMethod(c *ProjectionMethodContext) @@ -253,6 +295,12 @@ type MongoShellParserListener interface { // ExitLiteralValue is called when exiting the literalValue production. ExitLiteralValue(c *LiteralValueContext) + // ExitNewKeywordValue is called when exiting the newKeywordValue production. + ExitNewKeywordValue(c *NewKeywordValueContext) + + // ExitNewKeywordError is called when exiting the newKeywordError production. + ExitNewKeywordError(c *NewKeywordErrorContext) + // ExitArray is called when exiting the array production. ExitArray(c *ArrayContext) diff --git a/mongodb/mongoshellparser_visitor.go b/mongodb/mongoshellparser_visitor.go index 488c3c0..2849981 100644 --- a/mongodb/mongoshellparser_visitor.go +++ b/mongodb/mongoshellparser_visitor.go @@ -49,6 +49,21 @@ type MongoShellParserVisitor interface { // Visit a parse tree produced by MongoShellParser#findOneMethod. VisitFindOneMethod(ctx *FindOneMethodContext) interface{} + // Visit a parse tree produced by MongoShellParser#countDocumentsMethod. + VisitCountDocumentsMethod(ctx *CountDocumentsMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#estimatedDocumentCountMethod. + VisitEstimatedDocumentCountMethod(ctx *EstimatedDocumentCountMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#distinctMethod. + VisitDistinctMethod(ctx *DistinctMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#aggregateMethod. + VisitAggregateMethod(ctx *AggregateMethodContext) interface{} + + // Visit a parse tree produced by MongoShellParser#getIndexesMethod. + VisitGetIndexesMethod(ctx *GetIndexesMethodContext) interface{} + // Visit a parse tree produced by MongoShellParser#sortMethod. VisitSortMethod(ctx *SortMethodContext) interface{} @@ -58,6 +73,9 @@ type MongoShellParserVisitor interface { // Visit a parse tree produced by MongoShellParser#skipMethod. VisitSkipMethod(ctx *SkipMethodContext) interface{} + // Visit a parse tree produced by MongoShellParser#countMethod. + VisitCountMethod(ctx *CountMethodContext) interface{} + // Visit a parse tree produced by MongoShellParser#projectionMethod. VisitProjectionMethod(ctx *ProjectionMethodContext) interface{} @@ -100,6 +118,12 @@ type MongoShellParserVisitor interface { // Visit a parse tree produced by MongoShellParser#literalValue. VisitLiteralValue(ctx *LiteralValueContext) interface{} + // Visit a parse tree produced by MongoShellParser#newKeywordValue. + VisitNewKeywordValue(ctx *NewKeywordValueContext) interface{} + + // Visit a parse tree produced by MongoShellParser#newKeywordError. + VisitNewKeywordError(ctx *NewKeywordErrorContext) interface{} + // Visit a parse tree produced by MongoShellParser#array. VisitArray(ctx *ArrayContext) interface{} diff --git a/mongodb/parser_test.go b/mongodb/parser_test.go index 974fa36..d527b4a 100644 --- a/mongodb/parser_test.go +++ b/mongodb/parser_test.go @@ -23,11 +23,11 @@ func NewTestErrorListener() *TestErrorListener { } func (l *TestErrorListener) SyntaxError( - recognizer antlr.Recognizer, - offendingSymbol interface{}, - line, column int, + _ antlr.Recognizer, + _ any, + _, _ int, msg string, - e antlr.RecognitionException, + _ antlr.RecognitionException, ) { l.errors = append(l.errors, msg) } @@ -36,7 +36,7 @@ func (l *TestErrorListener) HasErrors() bool { return len(l.errors) > 0 } -func parseMongoShell(t *testing.T, input string) (antlr.Tree, *TestErrorListener, *TestErrorListener) { +func parseMongoShell(_ *testing.T, input string) (antlr.Tree, *TestErrorListener, *TestErrorListener) { is := antlr.NewInputStream(input) lexer := mongodb.NewMongoShellLexer(is) @@ -69,6 +69,21 @@ func testFile(t *testing.T, filePath string) { }) } +// TestMongoShellParser runs all .js example files as parser tests. +// Each .js file in the examples/ directory tests a specific feature: +// - collection-find.js: db.collection.find() with filters, operators, cursor modifiers +// - collection-findOne.js: db.collection.findOne() operations +// - collection-countDocuments.js: db.collection.countDocuments() operations +// - collection-estimatedDocumentCount.js: db.collection.estimatedDocumentCount() operations +// - collection-distinct.js: db.collection.distinct() operations +// - collection-aggregate.js: db.collection.aggregate() pipelines +// - collection-getIndexes.js: db.collection.getIndexes() operations +// - shell_commands.js: show dbs, show databases, show collections +// - helper_functions.js: ObjectId(), ISODate(), UUID(), NumberLong(), etc. +// - document_syntax.js: Document syntax with unquoted keys, trailing commas +// - literals.js: String, number, boolean, null literals +// - regex.js: Regex literals and RegExp() constructor +// - comments.js: Line and block comments func TestMongoShellParser(t *testing.T) { entries, err := os.ReadDir("examples") require.NoError(t, err) @@ -80,240 +95,6 @@ func TestMongoShellParser(t *testing.T) { } } -func TestShellCommands(t *testing.T) { - tests := []string{ - "show dbs", - "show databases", - "show collections", - } - - for _, tc := range tests { - t.Run(tc, func(t *testing.T) { - _, lexerErrors, parserErrors := parseMongoShell(t, tc) - require.False(t, lexerErrors.HasErrors(), "Lexer errors: %v", lexerErrors.errors) - require.False(t, parserErrors.HasErrors(), "Parser errors: %v", parserErrors.errors) - }) - } -} - -func TestFindOperations(t *testing.T) { - tests := []string{ - `db.users.find()`, - `db.users.find({})`, - `db.users.findOne()`, - `db.users.findOne({})`, - `db.users.find({ name: "alice" })`, - `db.users.find({ age: { $gt: 25 } })`, - `db.users.find({ age: { $gte: 18, $lt: 65 } })`, - `db.users.find({ status: { $in: ["active", "pending"] } })`, - `db.users.find({ $or: [{ name: "alice" }, { name: "bob" }] })`, - } - - for _, tc := range tests { - t.Run(tc, func(t *testing.T) { - _, lexerErrors, parserErrors := parseMongoShell(t, tc) - require.False(t, lexerErrors.HasErrors(), "Lexer errors: %v", lexerErrors.errors) - require.False(t, parserErrors.HasErrors(), "Parser errors: %v", parserErrors.errors) - }) - } -} - -func TestCursorModifiers(t *testing.T) { - tests := []string{ - `db.users.find().sort({ age: -1 })`, - `db.users.find().limit(10)`, - `db.users.find().skip(5)`, - `db.users.find().projection({ name: 1, age: 1 })`, - `db.users.find().project({ name: 1, email: 1 })`, - `db.users.find().sort({ age: -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)`, - } - - for _, tc := range tests { - t.Run(tc, func(t *testing.T) { - _, lexerErrors, parserErrors := parseMongoShell(t, tc) - require.False(t, lexerErrors.HasErrors(), "Lexer errors: %v", lexerErrors.errors) - require.False(t, parserErrors.HasErrors(), "Parser errors: %v", parserErrors.errors) - }) - } -} - -func TestCollectionAccess(t *testing.T) { - tests := []string{ - `db.users.find()`, - `db["users"].find()`, - `db['users'].find()`, - `db.getCollection("users").find()`, - `db.getCollection('users').find()`, - `db["user-logs"].find()`, - `db.getCollection("my.collection").find()`, - `db.getCollectionNames()`, - `db.getCollectionInfos()`, - `db.getCollectionInfos({ name: "users" })`, - `db.getCollectionInfos({}, { nameOnly: true })`, - } - - for _, tc := range tests { - t.Run(tc, func(t *testing.T) { - _, lexerErrors, parserErrors := parseMongoShell(t, tc) - require.False(t, lexerErrors.HasErrors(), "Lexer errors: %v", lexerErrors.errors) - require.False(t, parserErrors.HasErrors(), "Parser errors: %v", parserErrors.errors) - }) - } -} - -func TestHelperFunctions(t *testing.T) { - tests := []string{ - `db.users.find({ _id: ObjectId("507f1f77bcf86cd799439011") })`, - `db.users.find({ _id: ObjectId() })`, - `db.events.find({ createdAt: ISODate("2024-01-15T00:00:00.000Z") })`, - `db.events.find({ createdAt: { $gt: ISODate() } })`, - `db.events.find({ timestamp: Date() })`, - `db.events.find({ timestamp: Date("2024-01-15") })`, - `db.events.find({ timestamp: Date(1705276800000) })`, - `db.sessions.find({ sessionId: UUID("550e8400-e29b-41d4-a716-446655440000") })`, - `db.stats.find({ count: Long(9007199254740993) })`, - `db.stats.find({ count: Long("9007199254740993") })`, - `db.stats.find({ count: NumberLong(123456789012345) })`, - `db.items.find({ quantity: Int32(100) })`, - `db.items.find({ quantity: NumberInt(100) })`, - `db.measurements.find({ value: Double(3.14159) })`, - `db.financial.find({ amount: Decimal128("1234567890.123456789") })`, - `db.financial.find({ amount: NumberDecimal("99.99") })`, - `db.oplog.find({ ts: Timestamp(1627811580, 1) })`, - `db.oplog.find({ ts: Timestamp({ t: 1627811580, i: 1 }) })`, - } - - for _, tc := range tests { - t.Run(tc, func(t *testing.T) { - _, lexerErrors, parserErrors := parseMongoShell(t, tc) - require.False(t, lexerErrors.HasErrors(), "Lexer errors: %v", lexerErrors.errors) - require.False(t, parserErrors.HasErrors(), "Parser errors: %v", parserErrors.errors) - }) - } -} - -func TestRegex(t *testing.T) { - tests := []string{ - `db.users.find({ name: /alice/ })`, - `db.users.find({ name: /^alice/i })`, - `db.users.find({ email: /.*@example\.com$/ })`, - `db.users.find({ name: RegExp("alice") })`, - `db.users.find({ name: RegExp("^alice", "i") })`, - `db.users.find({ name: RegExp("test", "gi") })`, - } - - for _, tc := range tests { - t.Run(tc, func(t *testing.T) { - _, lexerErrors, parserErrors := parseMongoShell(t, tc) - require.False(t, lexerErrors.HasErrors(), "Lexer errors: %v", lexerErrors.errors) - require.False(t, parserErrors.HasErrors(), "Parser errors: %v", parserErrors.errors) - }) - } -} - -func TestDocumentSyntax(t *testing.T) { - tests := []string{ - // Unquoted keys - `db.users.find({ name: "alice", age: 25 })`, - // Quoted keys - `db.users.find({ "name": "alice", "age": 25 })`, - `db.users.find({ 'name': 'alice' })`, - // Mixed - `db.users.find({ name: "alice", "special-field": "value" })`, - // Nested - `db.users.find({ profile: { name: "test", active: true } })`, - // Arrays - `db.users.find({ tags: ["a", "b", "c"] })`, - // Trailing commas - `db.users.find({ name: "alice", age: 25, })`, - `db.users.find({ tags: ["a", "b", "c",] })`, - } - - for _, tc := range tests { - t.Run(tc, func(t *testing.T) { - _, lexerErrors, parserErrors := parseMongoShell(t, tc) - require.False(t, lexerErrors.HasErrors(), "Lexer errors: %v", lexerErrors.errors) - require.False(t, parserErrors.HasErrors(), "Parser errors: %v", parserErrors.errors) - }) - } -} - -func TestLiterals(t *testing.T) { - tests := []string{ - // Strings - `db.users.find({ name: "alice" })`, - `db.users.find({ name: 'alice' })`, - // Numbers - `db.users.find({ age: 25 })`, - `db.users.find({ score: -10 })`, - `db.users.find({ price: 19.99 })`, - `db.users.find({ tiny: .001 })`, - `db.users.find({ distance: 1.5e10 })`, - `db.users.find({ small: 1e-6 })`, - // Booleans - `db.users.find({ active: true })`, - `db.users.find({ deleted: false })`, - // Null - `db.users.find({ deletedAt: null })`, - } - - for _, tc := range tests { - t.Run(tc, func(t *testing.T) { - _, lexerErrors, parserErrors := parseMongoShell(t, tc) - require.False(t, lexerErrors.HasErrors(), "Lexer errors: %v", lexerErrors.errors) - require.False(t, parserErrors.HasErrors(), "Parser errors: %v", parserErrors.errors) - }) - } -} - -func TestComments(t *testing.T) { - tests := []string{ - `// Line comment -db.users.find()`, - `db.users.find() // inline comment`, - `/* Block comment */ db.users.find()`, - `db.users.find({ /* comment */ name: "alice" })`, - } - - for _, tc := range tests { - t.Run(tc, func(t *testing.T) { - _, lexerErrors, parserErrors := parseMongoShell(t, tc) - require.False(t, lexerErrors.HasErrors(), "Lexer errors: %v", lexerErrors.errors) - require.False(t, parserErrors.HasErrors(), "Parser errors: %v", parserErrors.errors) - }) - } -} - -func TestComplexQueries(t *testing.T) { - tests := []string{ - // Complex filter with helpers - `db.users.find({ - _id: ObjectId("507f1f77bcf86cd799439011"), - createdAt: { $gt: ISODate("2024-01-01T00:00:00Z") }, - lastLogin: { $lt: Date() }, - sessionId: UUID("550e8400-e29b-41d4-a716-446655440000"), - loginCount: NumberLong(1000) - })`, - // Multiple chained methods - `db.users.find({ age: { $gt: 18 } }).sort({ lastName: 1, firstName: 1 }).skip(10).limit(20).projection({ firstName: 1, lastName: 1, email: 1 })`, - // Multiple statements - `show dbs -show collections -db.users.find() -db.users.find({ name: "alice" }).limit(10)`, - } - - for _, tc := range tests { - t.Run(tc, func(t *testing.T) { - _, lexerErrors, parserErrors := parseMongoShell(t, tc) - require.False(t, lexerErrors.HasErrors(), "Lexer errors: %v", lexerErrors.errors) - require.False(t, parserErrors.HasErrors(), "Parser errors: %v", parserErrors.errors) - }) - } -} - func TestErrorPositions(t *testing.T) { // Test that error positions are reported correctly input := `db.users.find({ name: })` @@ -368,9 +149,9 @@ func TestNewKeywordErrorMessage(t *testing.T) { require.True(t, errorListener.HasErrors(), "Expected parse errors for 'new' keyword usage") require.NotEmpty(t, errorListener.Errors) - // Verify error message contains hint about 'new' keyword - require.Contains(t, errorListener.Errors[0].Message, "new", - "Error message should mention 'new' keyword") + // Verify error message provides helpful guidance about 'new' keyword + require.Contains(t, errorListener.Errors[0].Message, "'new' keyword is not supported", + "Error message should provide helpful guidance about 'new' keyword") }) } }