diff options
author | Jacob Evans <jacob.evans@10gen.com> | 2020-08-04 11:16:57 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-08-10 22:23:46 +0000 |
commit | 4ca0dd7e041274d4ce7b87cf2f6494e6da30eaf0 (patch) | |
tree | de11bba03a46ebd28975c52e3f9c1c5259cbe701 /src/mongo/db/cst | |
parent | 16f480f6ff1ddae39d8e45b68a3c7bb31a780752 (diff) | |
download | mongo-4ca0dd7e041274d4ce7b87cf2f6494e6da30eaf0.tar.gz |
SERVER-48795 Initial framework for adding $project to grammar
Diffstat (limited to 'src/mongo/db/cst')
-rw-r--r-- | src/mongo/db/cst/SConscript | 1 | ||||
-rw-r--r-- | src/mongo/db/cst/c_node.h | 18 | ||||
-rw-r--r-- | src/mongo/db/cst/c_node_validation.cpp | 136 | ||||
-rw-r--r-- | src/mongo/db/cst/c_node_validation.h | 47 | ||||
-rwxr-xr-x | src/mongo/db/cst/cst_expression_test.cpp | 452 | ||||
-rw-r--r-- | src/mongo/db/cst/cst_literals_test.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/cst/cst_pipeline_translation.cpp | 134 | ||||
-rw-r--r-- | src/mongo/db/cst/cst_pipeline_translation_test.cpp | 67 | ||||
-rw-r--r-- | src/mongo/db/cst/cst_test.cpp | 108 | ||||
-rw-r--r-- | src/mongo/db/cst/key_fieldname.h | 3 | ||||
-rw-r--r-- | src/mongo/db/cst/location_gen.h | 18 | ||||
-rw-r--r-- | src/mongo/db/cst/pipeline_grammar.yy | 32 | ||||
-rw-r--r-- | src/mongo/db/cst/pipeline_parser_gen.cpp | 2079 | ||||
-rw-r--r-- | src/mongo/db/cst/pipeline_parser_gen.hpp | 45 |
14 files changed, 1739 insertions, 1403 deletions
diff --git a/src/mongo/db/cst/SConscript b/src/mongo/db/cst/SConscript index 54642a91fcb..828098525d1 100644 --- a/src/mongo/db/cst/SConscript +++ b/src/mongo/db/cst/SConscript @@ -10,6 +10,7 @@ env.Library( 'bson_lexer.cpp', 'cst_pipeline_translation.cpp', 'c_node.cpp', + 'c_node_validation.cpp', 'pipeline_parser_gen.cpp', ], LIBDEPS=[ diff --git a/src/mongo/db/cst/c_node.h b/src/mongo/db/cst/c_node.h index 5d1fcafefd3..06596d0ce70 100644 --- a/src/mongo/db/cst/c_node.h +++ b/src/mongo/db/cst/c_node.h @@ -149,6 +149,16 @@ struct CNode { return stdx::get<KeyFieldname>(objectChildren().begin()->first); } + /* + * Returns whether the payload indicates inclusion through a key. Note that this does not return + * true for ObjectChildren payloads indicating a computed projection. + */ + auto isInclusionKeyValue() const { + return stdx::holds_alternative<NonZeroKey>(payload) || + (stdx::holds_alternative<KeyValue>(payload) && + stdx::get<KeyValue>(payload) == KeyValue::trueKey); + } + private: std::string toStringHelper(int numTabs) const; @@ -180,6 +190,14 @@ public: UserMinKey, UserMaxKey> payload; + + /* + * Returns whether this fieldname is the key fieldname representing the _id syntax. + */ + static auto fieldnameIsId(const CNode::Fieldname& name) { + return stdx::holds_alternative<KeyFieldname>(name) && + stdx::get<KeyFieldname>(name) == KeyFieldname::id; + } }; } // namespace mongo diff --git a/src/mongo/db/cst/c_node_validation.cpp b/src/mongo/db/cst/c_node_validation.cpp new file mode 100644 index 00000000000..338c8e198eb --- /dev/null +++ b/src/mongo/db/cst/c_node_validation.cpp @@ -0,0 +1,136 @@ +/** + * Copyright (C) 2020-present MongoDB, Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the Server Side Public License, version 1, + * as published by MongoDB, Inc. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * Server Side Public License for more details. + * + * You should have received a copy of the Server Side Public License + * along with this program. If not, see + * <http://www.mongodb.com/licensing/server-side-public-license>. + * + * As a special exception, the copyright holders give permission to link the + * code of portions of this program with the OpenSSL library under certain + * conditions as described in each individual source file and distribute + * linked combinations including the program with the OpenSSL library. You + * must comply with the Server Side Public License in all respects for + * all of the code used other than as permitted herein. If you modify file(s) + * with this exception, you may extend this exception to your version of the + * file(s), but you are not obligated to do so. If you do not wish to do so, + * delete this exception statement from your version. If you delete this + * exception statement from all source files in the program, then also delete + * it in the license file. + */ + +#include <iterator> + +#include "mongo/base/status.h" +#include "mongo/db/cst/c_node_validation.h" + +namespace mongo::c_node_validation { +namespace { + +template <typename Iter, typename EndFun> +StatusWith<IsInclusion> processAdditionalFieldsInclusionAssumed(const Iter& iter, + const EndFun& isEnd); +template <typename Iter, typename EndFun> +StatusWith<IsInclusion> processAdditionalFieldsExclusionAssumed(const Iter& iter, + const EndFun& isEnd); + +auto isInclusionField(const CNode& project) { + if (project.isInclusionKeyValue()) + // This is an inclusion Key. + return true; + else if (stdx::holds_alternative<KeyValue>(project.payload)) + // This is an exclusion Key. + return false; + else + // This is an arbitrary expression to produce a computed field (this counts as inclusion). + return true; +} + +template <typename Iter, typename EndFun> +StatusWith<IsInclusion> processAdditionalFieldsInclusionConfirmed(const Iter& iter, + const EndFun& isEnd) { + if (!isEnd(iter)) { + if (CNode::fieldnameIsId(iter->first)) { + return processAdditionalFieldsInclusionConfirmed(std::next(iter), isEnd); + } else { + if (isInclusionField(iter->second)) + return processAdditionalFieldsInclusionConfirmed(std::next(iter), isEnd); + else + return Status{ErrorCodes::FailedToParse, + "$project containing inclusion and/or computed fields must" + "contain no exclusion fields"}; + } + } else { + return IsInclusion::yes; + } +} + +template <typename Iter, typename EndFun> +StatusWith<IsInclusion> processAdditionalFieldsExclusionConfirmed(const Iter& iter, + const EndFun& isEnd) { + if (!isEnd(iter)) { + if (CNode::fieldnameIsId(iter->first)) { + return processAdditionalFieldsExclusionConfirmed(std::next(iter), isEnd); + } else { + if (isInclusionField(iter->second)) + return Status{ErrorCodes::FailedToParse, + "$project containing exclusion fields must contain no" + "inclusion and/or computed fields"}; + else + return processAdditionalFieldsExclusionConfirmed(std::next(iter), isEnd); + } + } else { + return IsInclusion::no; + } +} + +template <typename Iter, typename EndFun> +StatusWith<IsInclusion> processAdditionalFieldsWhenAssuming(const Iter& iter, const EndFun& isEnd) { + if (CNode::fieldnameIsId(iter->first)) { + if (isInclusionField(iter->second)) + return processAdditionalFieldsInclusionAssumed(std::next(iter), isEnd); + else + return processAdditionalFieldsExclusionAssumed(std::next(iter), isEnd); + } else { + if (isInclusionField(iter->second)) + return processAdditionalFieldsInclusionConfirmed(std::next(iter), isEnd); + else + return processAdditionalFieldsExclusionConfirmed(std::next(iter), isEnd); + } +} + +template <typename Iter, typename EndFun> +StatusWith<IsInclusion> processAdditionalFieldsInclusionAssumed(const Iter& iter, + const EndFun& isEnd) { + if (!isEnd(iter)) + return processAdditionalFieldsWhenAssuming(iter, isEnd); + else + return IsInclusion::yes; +} + +template <typename Iter, typename EndFun> +StatusWith<IsInclusion> processAdditionalFieldsExclusionAssumed(const Iter& iter, + const EndFun& isEnd) { + if (!isEnd(iter)) + return processAdditionalFieldsWhenAssuming(iter, isEnd); + else + return IsInclusion::no; +} + +} // namespace + +StatusWith<IsInclusion> validateProjectionAsInclusionOrExclusion(const CNode& projects) { + return processAdditionalFieldsInclusionAssumed( + projects.objectChildren().cbegin(), + [&](auto&& iter) { return iter == projects.objectChildren().cend(); }); +} + +} // namespace mongo::c_node_validation diff --git a/src/mongo/db/cst/c_node_validation.h b/src/mongo/db/cst/c_node_validation.h new file mode 100644 index 00000000000..33861adf83e --- /dev/null +++ b/src/mongo/db/cst/c_node_validation.h @@ -0,0 +1,47 @@ +/** + * Copyright (C) 2020-present MongoDB, Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the Server Side Public License, version 1, + * as published by MongoDB, Inc. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * Server Side Public License for more details. + * + * You should have received a copy of the Server Side Public License + * along with this program. If not, see + * <http://www.mongodb.com/licensing/server-side-public-license>. + * + * As a special exception, the copyright holders give permission to link the + * code of portions of this program with the OpenSSL library under certain + * conditions as described in each individual source file and distribute + * linked combinations including the program with the OpenSSL library. You + * must comply with the Server Side Public License in all respects for + * all of the code used other than as permitted herein. If you modify file(s) + * with this exception, you may extend this exception to your version of the + * file(s), but you are not obligated to do so. If you do not wish to do so, + * delete this exception statement from your version. If you delete this + * exception statement from all source files in the program, then also delete + * it in the license file. + */ + +#pragma once + +#include "mongo/platform/basic.h" + +#include "mongo/base/status_with.h" +#include "mongo/db/cst/c_node.h" + +/** + * Functions which perform additional validation beyond what a context free grammar can handle. + * These return error messages which can be used to cause errors from inside the Bison parser. + */ +namespace mongo::c_node_validation { + +enum class IsInclusion : bool { no, yes }; + +StatusWith<IsInclusion> validateProjectionAsInclusionOrExclusion(const CNode& projects); + +} // namespace mongo::c_node_validation diff --git a/src/mongo/db/cst/cst_expression_test.cpp b/src/mongo/db/cst/cst_expression_test.cpp index 2c0e399bb73..795bb93095a 100755 --- a/src/mongo/db/cst/cst_expression_test.cpp +++ b/src/mongo/db/cst/cst_expression_test.cpp @@ -1,225 +1,227 @@ -/**
- * Copyright (C) 2020-present MongoDB, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the Server Side Public License, version 1,
- * as published by MongoDB, Inc.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * Server Side Public License for more details.
- *
- * You should have received a copy of the Server Side Public License
- * along with this program. If not, see
- * <http://www.mongodb.com/licensing/server-side-public-license>.
- *
- * As a special exception, the copyright holders give permission to link the
- * code of portions of this program with the OpenSSL library under certain
- * conditions as described in each individual source file and distribute
- * linked combinations including the program with the OpenSSL library. You
- * must comply with the Server Side Public License in all respects for
- * all of the code used other than as permitted herein. If you modify file(s)
- * with this exception, you may extend this exception to your version of the
- * file(s), but you are not obligated to do so. If you do not wish to do so,
- * delete this exception statement from your version. If you delete this
- * exception statement from all source files in the program, then also delete
- * it in the license file.
- */
-
-#include "mongo/platform/basic.h"
-
-#include <string>
-
-#include "mongo/bson/json.h"
-#include "mongo/db/cst/bson_lexer.h"
-#include "mongo/db/cst/c_node.h"
-#include "mongo/db/cst/key_fieldname.h"
-#include "mongo/db/cst/key_value.h"
-#include "mongo/db/cst/pipeline_parser_gen.hpp"
-#include "mongo/unittest/bson_test_util.h"
-#include "mongo/unittest/unittest.h"
-
-namespace mongo {
-namespace {
-
-TEST(CstExpressionTest, ParsesProjectWithAnd) {
- CNode output;
- auto input = fromjson(
- "{pipeline: [{$project: {_id: 9.10, a: {$and: [4, {$and: [7, 8]}]}, b: {$and: [2, "
- "-3]}}}]}");
- BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE);
- auto parseTree = PipelineParserGen(lexer, &output);
- ASSERT_EQ(0, parseTree.parse());
- auto stages = stdx::get<CNode::ArrayChildren>(output.payload);
- ASSERT_EQ(1, stages.size());
- ASSERT(KeyFieldname::project == stages[0].firstKeyFieldname());
- ASSERT_EQ(
- stages[0].toBson().toString(),
- "{ project: { id: \"<NonZeroKey of type double 9.100000>\", a: { andExpr: [ "
- "\"<UserInt 4>\", { andExpr: [ \"<UserInt 7>\", \"<UserInt 8>\" ] } ] }, b: { andExpr: [ "
- "\"<UserInt 2>\", \"<UserInt -3>\" ] } } }");
-}
-
-TEST(CstExpressionTest, ParsesProjectWithOr) {
- CNode output;
- auto input = fromjson(
- "{pipeline: [{$project: {_id: 9.10, a: {$or: [4, {$or: [7, 8]}]}, b: {$or: [2, -3]}}}]}");
- BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE);
- auto parseTree = PipelineParserGen(lexer, &output);
- ASSERT_EQ(0, parseTree.parse());
- auto stages = stdx::get<CNode::ArrayChildren>(output.payload);
- ASSERT_EQ(1, stages.size());
- ASSERT(KeyFieldname::project == stages[0].firstKeyFieldname());
- ASSERT_EQ(
- stages[0].toBson().toString(),
- "{ project: { id: \"<NonZeroKey of type double 9.100000>\", a: { orExpr: [ "
- "\"<UserInt 4>\", { orExpr: [ \"<UserInt 7>\", \"<UserInt 8>\" ] } ] }, b: { orExpr: [ "
- "\"<UserInt 2>\", \"<UserInt -3>\" ] } } }");
-}
-
-TEST(CstExpressionTest, ParsesProjectWithNot) {
- CNode output;
- auto input = fromjson(
- "{pipeline: [{$project: {_id: 9.10, a: {$not: [4]}, b: {$and: [1.0, {$not: "
- "[true]}]}}}]}");
- BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE);
- auto parseTree = PipelineParserGen(lexer, &output);
- ASSERT_EQ(0, parseTree.parse());
- auto stages = stdx::get<CNode::ArrayChildren>(output.payload);
- ASSERT_EQ(1, stages.size());
- ASSERT(KeyFieldname::project == stages[0].firstKeyFieldname());
- ASSERT_EQ(stages[0].toBson().toString(),
- "{ project: { id: \"<NonZeroKey of type double 9.100000>\", a: { notExpr: [ "
- "\"<UserInt 4>\" ] }, b: { andExpr: [ \"<UserDouble 1.000000>\", { notExpr: [ "
- "\"<UserBoolean 1>\" ] } ] } } }");
-}
-
-TEST(CstExpressionTest, ParsesComparisonExpressions) {
- auto parseAndTest = [](StringData expr) {
- CNode output;
- auto input = fromjson("{pipeline: [{$project: {_id: {$" + expr + ": [1, 2.5]}}}]}");
- BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE);
- auto parseTree = PipelineParserGen(lexer, &output);
- ASSERT_EQ(0, parseTree.parse());
- auto stages = stdx::get<CNode::ArrayChildren>(output.payload);
- ASSERT_EQ(1, stages.size());
- ASSERT(KeyFieldname::project == stages[0].firstKeyFieldname());
- ASSERT_EQ(stages[0].toBson().toString(),
- "{ project: { id: { " + expr +
- ": [ \"<UserInt 1>\", \"<UserDouble 2.500000>\" ] } } }");
- };
-
- for (auto&& expr : {"cmp"_sd, "eq"_sd, "gt"_sd, "gte"_sd, "lt"_sd, "lte"_sd, "ne"_sd}) {
- parseAndTest(expr);
- }
-}
-
-TEST(CstExpressionTest, FailsToParseInvalidComparisonExpressions) {
- auto assertFailsToParse = [](StringData expr) {
- {
- CNode output;
- auto input = fromjson("{pipeline: [{$project: {_id: {$" + expr + ": [1]}}}]}");
- BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE);
- auto parseTree = PipelineParserGen(lexer, &output);
- ASSERT_THROWS_CODE(parseTree.parse(), AssertionException, ErrorCodes::FailedToParse);
- }
- {
- CNode output;
- auto input = fromjson("{pipeline: [{$project: {_id: {$" + expr + ": [1, 2, 3]}}}]}");
- BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE);
- auto parseTree = PipelineParserGen(lexer, &output);
- ASSERT_THROWS_CODE(parseTree.parse(), AssertionException, ErrorCodes::FailedToParse);
- }
- {
- CNode output;
- auto input = fromjson("{pipeline: [{$project: {_id: {$" + expr + ": 1}}}]}");
- BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE);
- auto parseTree = PipelineParserGen(lexer, &output);
- ASSERT_THROWS_CODE(parseTree.parse(), AssertionException, ErrorCodes::FailedToParse);
- }
- };
-
- for (auto&& expr : {"cmp"_sd, "eq"_sd, "gt"_sd, "gte"_sd, "lt"_sd, "lte"_sd, "ne"_sd}) {
- assertFailsToParse(expr);
- }
-}
-
-TEST(CstExpressionTest, FailsToParseInvalidConvertExpressions) {
- {
- CNode output;
- auto input = fromjson("{pipeline: [{$project: {a: {$convert: {input: 'x', to: true}}}}]}");
- BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE);
- auto parseTree = PipelineParserGen(lexer, &output);
- ASSERT_THROWS_CODE(parseTree.parse(), AssertionException, ErrorCodes::FailedToParse);
- }
- {
- CNode output;
- auto input = fromjson("{pipeline: [{$project: {a: {$convert: {input: 'x'}}}}]}");
- BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE);
- auto parseTree = PipelineParserGen(lexer, &output);
- ASSERT_THROWS_CODE(parseTree.parse(), AssertionException, ErrorCodes::FailedToParse);
- }
-}
-
-TEST(CstExpressionTest, ParsesConvertExpressions) {
- CNode output;
- auto input = fromjson(
- "{pipeline: [{$project: {a: {$toBool: 1}, b: {$toDate: 1100000000000}, "
- "c: {$toDecimal: 5}, d: {$toDouble: -2}, e: {$toInt: 1.999999}, "
- "f: {$toLong: 1.999999}, g: {$toObjectId: '$_id'}, h: {$toString: false}}}]}");
- BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE);
- auto parseTree = PipelineParserGen(lexer, &output);
- ASSERT_EQ(0, parseTree.parse());
- auto stages = stdx::get<CNode::ArrayChildren>(output.payload);
- ASSERT_EQ(1, stages.size());
- ASSERT(KeyFieldname::project == stages[0].firstKeyFieldname());
- ASSERT_EQ(stages[0].toBson().toString(),
- "{ project: { a: { toBool: \"<UserInt 1>\" }, b: { toDate: \"<UserLong "
- "1100000000000>\" }, c: { toDecimal: \"<UserInt 5>\" }, d: { toDouble: \"<UserInt "
- "-2>\" }, e: { toInt: \"<UserDouble 1.999999>\" }, f: { toLong: \"<UserDouble "
- "1.999999>\" }, g: { toObjectId: \"<UserString $_id>\" }, h: { toString: "
- "\"<UserBoolean 0>\" } } }");
-}
-
-TEST(CstExpressionTest, ParsesConvertExpressionsNoOptArgs) {
- CNode output;
- auto input = fromjson(
- "{pipeline: [{$project: {a: {$convert: {input: 1, to: 'string'}}, "
- "b: {$convert : {input: 'true', to: 'bool'}}}}]}");
- BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE);
- auto parseTree = PipelineParserGen(lexer, &output);
- ASSERT_EQ(0, parseTree.parse());
- auto stages = stdx::get<CNode::ArrayChildren>(output.payload);
- ASSERT_EQ(1, stages.size());
- ASSERT(KeyFieldname::project == stages[0].firstKeyFieldname());
- ASSERT_EQ(stages[0].toBson().toString(),
- "{ project: { a: { convert: { inputArg: \"<UserInt 1>\", toArg: \"<UserString "
- "string>\", onErrorArg: \"<KeyValue absentKey>\", onNullArg: \"<KeyValue "
- "absentKey>\" } }, b: { convert: { inputArg: \"<UserString true>\", toArg: "
- "\"<UserString bool>\", onErrorArg: \"<KeyValue absentKey>\", onNullArg: "
- "\"<KeyValue absentKey>\" } } } }");
-}
-
-TEST(CstExpressionTest, ParsesConvertExpressionsWithOptArgs) {
- CNode output;
- auto input = fromjson(
- "{pipeline: [{$project: {a: {$convert: {input: 1, to: 'string', "
- "onError: 'Could not convert'}}, b : {$convert : {input: "
- "true, to : 'double', onNull : 0}}}}]}");
- BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE);
- auto parseTree = PipelineParserGen(lexer, &output);
- ASSERT_EQ(0, parseTree.parse());
- auto stages = stdx::get<CNode::ArrayChildren>(output.payload);
- ASSERT_EQ(1, stages.size());
- ASSERT(KeyFieldname::project == stages[0].firstKeyFieldname());
- ASSERT_EQ(stages[0].toBson().toString(),
- "{ project: { a: { convert: { inputArg: \"<UserInt 1>\", toArg: \"<UserString "
- "string>\", onErrorArg: \"<UserString Could not convert>\", onNullArg: \"<KeyValue "
- "absentKey>\" } }, b: { convert: { inputArg: \"<UserBoolean 1>\", toArg: "
- "\"<UserString double>\", onErrorArg: \"<KeyValue absentKey>\", onNullArg: "
- "\"<UserInt 0>\" } } } }");
-}
-
-} // namespace
-} // namespace mongo
+/** + * Copyright (C) 2020-present MongoDB, Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the Server Side Public License, version 1, + * as published by MongoDB, Inc. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * Server Side Public License for more details. + * + * You should have received a copy of the Server Side Public License + * along with this program. If not, see + * <http://www.mongodb.com/licensing/server-side-public-license>. + * + * As a special exception, the copyright holders give permission to link the + * code of portions of this program with the OpenSSL library under certain + * conditions as described in each individual source file and distribute + * linked combinations including the program with the OpenSSL library. You + * must comply with the Server Side Public License in all respects for + * all of the code used other than as permitted herein. If you modify file(s) + * with this exception, you may extend this exception to your version of the + * file(s), but you are not obligated to do so. If you do not wish to do so, + * delete this exception statement from your version. If you delete this + * exception statement from all source files in the program, then also delete + * it in the license file. + */ + +#include "mongo/platform/basic.h" + +#include <string> + +#include "mongo/bson/json.h" +#include "mongo/db/cst/bson_lexer.h" +#include "mongo/db/cst/c_node.h" +#include "mongo/db/cst/key_fieldname.h" +#include "mongo/db/cst/key_value.h" +#include "mongo/db/cst/pipeline_parser_gen.hpp" +#include "mongo/unittest/bson_test_util.h" +#include "mongo/unittest/unittest.h" + +namespace mongo { +namespace { + +TEST(CstExpressionTest, ParsesProjectWithAnd) { + CNode output; + auto input = fromjson( + "{pipeline: [{$project: {_id: 9.10, a: {$and: [4, {$and: [7, 8]}]}, b: {$and: [2, " + "-3]}}}]}"); + BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE); + auto parseTree = PipelineParserGen(lexer, &output); + ASSERT_EQ(0, parseTree.parse()); + auto stages = stdx::get<CNode::ArrayChildren>(output.payload); + ASSERT_EQ(1, stages.size()); + ASSERT(KeyFieldname::projectInclusion == stages[0].firstKeyFieldname()); + ASSERT_EQ( + stages[0].toBson().toString(), + "{ projectInclusion: { id: \"<NonZeroKey of type double 9.100000>\", a: { andExpr: [ " + "\"<UserInt 4>\", { andExpr: [ \"<UserInt 7>\", \"<UserInt 8>\" ] } ] }, b: { andExpr: [ " + "\"<UserInt 2>\", \"<UserInt -3>\" ] } } }"); +} + +TEST(CstExpressionTest, ParsesProjectWithOr) { + CNode output; + auto input = fromjson( + "{pipeline: [{$project: {_id: 9.10, a: {$or: [4, {$or: [7, 8]}]}, b: {$or: [2, -3]}}}]}"); + BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE); + auto parseTree = PipelineParserGen(lexer, &output); + ASSERT_EQ(0, parseTree.parse()); + auto stages = stdx::get<CNode::ArrayChildren>(output.payload); + ASSERT_EQ(1, stages.size()); + ASSERT(KeyFieldname::projectInclusion == stages[0].firstKeyFieldname()); + ASSERT_EQ( + stages[0].toBson().toString(), + "{ projectInclusion: { id: \"<NonZeroKey of type double 9.100000>\", a: { orExpr: [ " + "\"<UserInt 4>\", { orExpr: [ \"<UserInt 7>\", \"<UserInt 8>\" ] } ] }, b: { orExpr: [ " + "\"<UserInt 2>\", \"<UserInt -3>\" ] } } }"); +} + +TEST(CstExpressionTest, ParsesProjectWithNot) { + CNode output; + auto input = fromjson( + "{pipeline: [{$project: {_id: 9.10, a: {$not: [4]}, b: {$and: [1.0, {$not: " + "[true]}]}}}]}"); + BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE); + auto parseTree = PipelineParserGen(lexer, &output); + ASSERT_EQ(0, parseTree.parse()); + auto stages = stdx::get<CNode::ArrayChildren>(output.payload); + ASSERT_EQ(1, stages.size()); + ASSERT(KeyFieldname::projectInclusion == stages[0].firstKeyFieldname()); + ASSERT_EQ(stages[0].toBson().toString(), + "{ projectInclusion: { id: \"<NonZeroKey of type double 9.100000>\", a: { notExpr: [ " + "\"<UserInt 4>\" ] }, b: { andExpr: [ \"<UserDouble 1.000000>\", { notExpr: [ " + "\"<UserBoolean 1>\" ] } ] } } }"); +} + +TEST(CstExpressionTest, ParsesComparisonExpressions) { + auto parseAndTest = [](StringData expr) { + CNode output; + auto input = fromjson("{pipeline: [{$project: {_id: {$" + expr + ": [1, 2.5]}}}]}"); + BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE); + auto parseTree = PipelineParserGen(lexer, &output); + ASSERT_EQ(0, parseTree.parse()); + auto stages = stdx::get<CNode::ArrayChildren>(output.payload); + ASSERT_EQ(1, stages.size()); + ASSERT(KeyFieldname::projectInclusion == stages[0].firstKeyFieldname()); + ASSERT_EQ(stages[0].toBson().toString(), + "{ projectInclusion: { id: { " + expr + + ": [ \"<UserInt 1>\", \"<UserDouble 2.500000>\" ] } } }"); + }; + + for (auto&& expr : {"cmp"_sd, "eq"_sd, "gt"_sd, "gte"_sd, "lt"_sd, "lte"_sd, "ne"_sd}) { + parseAndTest(expr); + } +} + +TEST(CstExpressionTest, FailsToParseInvalidComparisonExpressions) { + auto assertFailsToParse = [](StringData expr) { + { + CNode output; + auto input = fromjson("{pipeline: [{$project: {_id: {$" + expr + ": [1]}}}]}"); + BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE); + auto parseTree = PipelineParserGen(lexer, &output); + ASSERT_THROWS_CODE(parseTree.parse(), AssertionException, ErrorCodes::FailedToParse); + } + { + CNode output; + auto input = fromjson("{pipeline: [{$project: {_id: {$" + expr + ": [1, 2, 3]}}}]}"); + BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE); + auto parseTree = PipelineParserGen(lexer, &output); + ASSERT_THROWS_CODE(parseTree.parse(), AssertionException, ErrorCodes::FailedToParse); + } + { + CNode output; + auto input = fromjson("{pipeline: [{$project: {_id: {$" + expr + ": 1}}}]}"); + BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE); + auto parseTree = PipelineParserGen(lexer, &output); + ASSERT_THROWS_CODE(parseTree.parse(), AssertionException, ErrorCodes::FailedToParse); + } + }; + + for (auto&& expr : {"cmp"_sd, "eq"_sd, "gt"_sd, "gte"_sd, "lt"_sd, "lte"_sd, "ne"_sd}) { + assertFailsToParse(expr); + } +} + +TEST(CstExpressionTest, FailsToParseInvalidConvertExpressions) { + { + CNode output; + auto input = fromjson("{pipeline: [{$project: {a: {$convert: {input: 'x', to: true}}}}]}"); + BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE); + auto parseTree = PipelineParserGen(lexer, &output); + ASSERT_THROWS_CODE(parseTree.parse(), AssertionException, ErrorCodes::FailedToParse); + } + { + CNode output; + auto input = fromjson("{pipeline: [{$project: {a: {$convert: {input: 'x'}}}}]}"); + BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE); + auto parseTree = PipelineParserGen(lexer, &output); + ASSERT_THROWS_CODE(parseTree.parse(), AssertionException, ErrorCodes::FailedToParse); + } +} + +TEST(CstExpressionTest, ParsesConvertExpressions) { + CNode output; + auto input = fromjson( + "{pipeline: [{$project: {a: {$toBool: 1}, b: {$toDate: 1100000000000}, " + "c: {$toDecimal: 5}, d: {$toDouble: -2}, e: {$toInt: 1.999999}, " + "f: {$toLong: 1.999999}, g: {$toObjectId: '$_id'}, h: {$toString: false}}}]}"); + BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE); + auto parseTree = PipelineParserGen(lexer, &output); + ASSERT_EQ(0, parseTree.parse()); + auto stages = stdx::get<CNode::ArrayChildren>(output.payload); + ASSERT_EQ(1, stages.size()); + ASSERT(KeyFieldname::projectInclusion == stages[0].firstKeyFieldname()); + ASSERT_EQ(stages[0].toBson().toString(), + "{ projectInclusion: { a: { toBool: \"<UserInt 1>\" }, b: { toDate: \"<UserLong " + "1100000000000>\" }, c: { toDecimal: \"<UserInt 5>\" }, d: { toDouble: \"<UserInt " + "-2>\" }, e: { toInt: \"<UserDouble 1.999999>\" }, f: { toLong: \"<UserDouble " + "1.999999>\" }, g: { toObjectId: \"<UserString $_id>\" }, h: { toString: " + "\"<UserBoolean 0>\" } } }"); +} + +TEST(CstExpressionTest, ParsesConvertExpressionsNoOptArgs) { + CNode output; + auto input = fromjson( + "{pipeline: [{$project: {a: {$convert: {input: 1, to: 'string'}}, " + "b: {$convert : {input: 'true', to: 'bool'}}}}]}"); + BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE); + auto parseTree = PipelineParserGen(lexer, &output); + ASSERT_EQ(0, parseTree.parse()); + auto stages = stdx::get<CNode::ArrayChildren>(output.payload); + ASSERT_EQ(1, stages.size()); + ASSERT(KeyFieldname::projectInclusion == stages[0].firstKeyFieldname()); + ASSERT_EQ( + stages[0].toBson().toString(), + "{ projectInclusion: { a: { convert: { inputArg: \"<UserInt 1>\", toArg: \"<UserString " + "string>\", onErrorArg: \"<KeyValue absentKey>\", onNullArg: \"<KeyValue " + "absentKey>\" } }, b: { convert: { inputArg: \"<UserString true>\", toArg: " + "\"<UserString bool>\", onErrorArg: \"<KeyValue absentKey>\", onNullArg: " + "\"<KeyValue absentKey>\" } } } }"); +} + +TEST(CstExpressionTest, ParsesConvertExpressionsWithOptArgs) { + CNode output; + auto input = fromjson( + "{pipeline: [{$project: {a: {$convert: {input: 1, to: 'string', " + "onError: 'Could not convert'}}, b : {$convert : {input: " + "true, to : 'double', onNull : 0}}}}]}"); + BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE); + auto parseTree = PipelineParserGen(lexer, &output); + ASSERT_EQ(0, parseTree.parse()); + auto stages = stdx::get<CNode::ArrayChildren>(output.payload); + ASSERT_EQ(1, stages.size()); + ASSERT(KeyFieldname::projectInclusion == stages[0].firstKeyFieldname()); + ASSERT_EQ( + stages[0].toBson().toString(), + "{ projectInclusion: { a: { convert: { inputArg: \"<UserInt 1>\", toArg: \"<UserString " + "string>\", onErrorArg: \"<UserString Could not convert>\", onNullArg: \"<KeyValue " + "absentKey>\" } }, b: { convert: { inputArg: \"<UserBoolean 1>\", toArg: " + "\"<UserString double>\", onErrorArg: \"<KeyValue absentKey>\", onNullArg: " + "\"<UserInt 0>\" } } } }"); +} + +} // namespace +} // namespace mongo diff --git a/src/mongo/db/cst/cst_literals_test.cpp b/src/mongo/db/cst/cst_literals_test.cpp index e4fbe0724a2..50fbf16c9d0 100644 --- a/src/mongo/db/cst/cst_literals_test.cpp +++ b/src/mongo/db/cst/cst_literals_test.cpp @@ -57,7 +57,7 @@ auto getExpCtx() { auto makePipelineContainingProjectStageWithLiteral(CNode&& literal) { return CNode{CNode::ArrayChildren{CNode{CNode::ObjectChildren{ - {KeyFieldname::project, + {KeyFieldname::projectInclusion, CNode{CNode::ObjectChildren{ {UserFieldname{"a"}, CNode{CNode::ObjectChildren{{KeyFieldname::literal, std::move(literal)}}}}}}}}}}}; diff --git a/src/mongo/db/cst/cst_pipeline_translation.cpp b/src/mongo/db/cst/cst_pipeline_translation.cpp index 9cda8109ecb..2f63fe0f05f 100644 --- a/src/mongo/db/cst/cst_pipeline_translation.cpp +++ b/src/mongo/db/cst/cst_pipeline_translation.cpp @@ -313,100 +313,72 @@ Value translateLiteralLeaf(const CNode& cst) { } /** - * Walk a projection CNode and produce a ProjectionASTNode. Also returns whether this was an - * inclusion (or expressive projection) or an exclusion projection. + * Walk a projection CNode and produce a ProjectionASTNode. */ -auto translateProjection(const CNode& cst, const boost::intrusive_ptr<ExpressionContext>& expCtx) { +std::unique_ptr<projection_ast::ASTNode> translateProjection( + const CNode& cst, const boost::intrusive_ptr<ExpressionContext>& expCtx) { using namespace projection_ast; - // Returns whether a KeyValue indicates inclusion or exclusion. - auto isInclusionKeyValue = [](auto&& keyValue) { - switch (stdx::get<KeyValue>(keyValue)) { - case KeyValue::trueKey: - return true; - case KeyValue::intZeroKey: - case KeyValue::longZeroKey: - case KeyValue::doubleZeroKey: - case KeyValue::decimalZeroKey: - case KeyValue::falseKey: - return false; - default: - MONGO_UNREACHABLE; - } - }; - - if (stdx::holds_alternative<NonZeroKey>(cst.payload) || - (stdx::holds_alternative<KeyValue>(cst.payload) && isInclusionKeyValue(cst.payload))) + if (cst.isInclusionKeyValue()) // This is an inclusion Key. - return std::pair{std::unique_ptr<ASTNode>{std::make_unique<BooleanConstantASTNode>(true)}, - true}; - else if (stdx::holds_alternative<KeyValue>(cst.payload) && !isInclusionKeyValue(cst.payload)) + return std::make_unique<BooleanConstantASTNode>(true); + else if (stdx::holds_alternative<KeyValue>(cst.payload)) // This is an exclusion Key. - return std::pair{std::unique_ptr<ASTNode>{std::make_unique<BooleanConstantASTNode>(false)}, - false}; + return std::make_unique<BooleanConstantASTNode>(false); else // This is an arbitrary expression to produce a computed field (this counts as inclusion). - return std::pair{std::unique_ptr<ASTNode>{ - std::make_unique<ExpressionASTNode>(translateExpression(cst, expCtx))}, - true}; + return std::make_unique<ExpressionASTNode>(translateExpression(cst, expCtx)); } /** - * Walk a project stage object CNode and produce a DocumentSourceSingleDocumentTransformation. + * Walk an inclusion project stage object CNode and produce a + * DocumentSourceSingleDocumentTransformation. */ -auto translateProject(const CNode& cst, const boost::intrusive_ptr<ExpressionContext>& expCtx) { +auto translateProjectInclusion(const CNode& cst, + const boost::intrusive_ptr<ExpressionContext>& expCtx) { using namespace projection_ast; auto root = ProjectionPathASTNode{}; - bool sawId = false; - bool removeId = false; - boost::optional<bool> inclusion; - for (auto&& [name, child] : cst.objectChildren()) { - // Turn the CNode into a projection AST node. - auto&& [projection, wasInclusion] = translateProjection(child, expCtx); + for (auto&& [name, child] : cst.objectChildren()) // If we see a key fieldname, make sure it's _id. - if (auto keyFieldname = stdx::get_if<KeyFieldname>(&name); - keyFieldname && *keyFieldname == KeyFieldname::id) { - // Keep track of whether we've ever seen _id at all. - sawId = true; - // Keep track of whether we will need to remove the _id field to get around an exclusion - // projection bug in the case where it was manually included. - removeId = wasInclusion; - // Add node to the projection AST. - addNodeAtPath(&root, "_id", std::move(projection)); - } else { - // This conditional changes the status of 'inclusion' to indicate whether we're in an - // inclusion or exclusion projection. - // TODO SERVER-48810: Improve error message with BSON locations. - inclusion = !inclusion ? wasInclusion - : *inclusion == wasInclusion ? wasInclusion : []() -> bool { - uasserted(4933100, - "$project must include only exclusion " - "projection or only inclusion projection"); - }(); - // Add node to the projection AST. - addNodeAtPath(&root, stdx::get<UserFieldname>(name), std::move(projection)); - } - } + if (CNode::fieldnameIsId(name)) + addNodeAtPath(&root, "_id", translateProjection(child, expCtx)); + else + addNodeAtPath( + &root, stdx::get<UserFieldname>(name), translateProjection(child, expCtx)); - // If we saw any non-_id exclusions, this is an exclusion projection. - if (inclusion && !*inclusion) { - // If we saw an inclusion _id for an exclusion projection, we must manually remove it or - // projection AST will turn it into an _id exclusion due to a bug. - // TODO Fix the bug or organize this code to circumvent projection AST. - if (removeId) + // If we didn't see _id we need to add it in manually for inclusion or projection AST + // will incorrectly assume we want it gone. + if (!root.getChild("_id")) + addNodeAtPath(&root, "_id", std::make_unique<BooleanConstantASTNode>(true)); + return DocumentSourceProject::create( + Projection{root, ProjectType::kInclusion}, expCtx, "$project"); +} + +/** + * Walk an exclusion project stage object CNode and produce a + * DocumentSourceSingleDocumentTransformation. + */ +auto translateProjectExclusion(const CNode& cst, + const boost::intrusive_ptr<ExpressionContext>& expCtx) { + using namespace projection_ast; + auto root = ProjectionPathASTNode{}; + + for (auto&& [name, child] : cst.objectChildren()) + // If we see a key fieldname, make sure it's _id. + if (CNode::fieldnameIsId(name)) + addNodeAtPath(&root, "_id", translateProjection(child, expCtx)); + else + addNodeAtPath( + &root, stdx::get<UserFieldname>(name), translateProjection(child, expCtx)); + + // If we saw an inclusion _id for an exclusion projection, we must manually remove it or + // projection AST will turn it into an _id exclusion due to a bug. + // TODO SERVER-48834: Fix the bug or organize this code to circumvent projection AST. + if (auto childPtr = root.getChild("_id")) + if (dynamic_cast<BooleanConstantASTNode*>(childPtr)->value()) static_cast<void>(root.removeChild("_id")); - return DocumentSourceProject::create( - Projection{root, ProjectType::kExclusion}, expCtx, "$project"); - // If we saw any non-_id inclusions or computed fields, this is an inclusion projectioion. - // Also if inclusion was not determinted, it is the default. - } else { - // If we didn't see _id we need to add it in manually for inclusion or projection AST - // will incorrectly assume we want it gone. - if (!sawId) - addNodeAtPath(&root, "_id", std::make_unique<BooleanConstantASTNode>(true)); - return DocumentSourceProject::create( - Projection{root, ProjectType::kInclusion}, expCtx, "$project"); - } + return DocumentSourceProject::create( + Projection{root, ProjectType::kExclusion}, expCtx, "$project"); } /** @@ -465,8 +437,10 @@ auto translateMatch(const CNode& cst, const boost::intrusive_ptr<ExpressionConte boost::intrusive_ptr<DocumentSource> translateSource( const CNode& cst, const boost::intrusive_ptr<ExpressionContext>& expCtx) { switch (cst.firstKeyFieldname()) { - case KeyFieldname::project: - return translateProject(cst.objectChildren()[0].second, expCtx); + case KeyFieldname::projectInclusion: + return translateProjectInclusion(cst.objectChildren()[0].second, expCtx); + case KeyFieldname::projectExclusion: + return translateProjectExclusion(cst.objectChildren()[0].second, expCtx); case KeyFieldname::match: return translateMatch(cst.objectChildren()[0].second, expCtx); case KeyFieldname::skip: diff --git a/src/mongo/db/cst/cst_pipeline_translation_test.cpp b/src/mongo/db/cst/cst_pipeline_translation_test.cpp index 96ac483e2fb..fac06eb69bd 100644 --- a/src/mongo/db/cst/cst_pipeline_translation_test.cpp +++ b/src/mongo/db/cst/cst_pipeline_translation_test.cpp @@ -65,9 +65,9 @@ TEST(CstPipelineTranslationTest, TranslatesEmpty) { ASSERT_EQ(0u, sources.size()); } -TEST(CstTest, TranslatesEmptyProject) { - const auto cst = CNode{CNode::ArrayChildren{ - CNode{CNode::ObjectChildren{{KeyFieldname::project, CNode{CNode::ObjectChildren{}}}}}}}; +TEST(CstPipelineTranslationTest, TranslatesEmptyProject) { + const auto cst = CNode{CNode::ArrayChildren{CNode{ + CNode::ObjectChildren{{KeyFieldname::projectInclusion, CNode{CNode::ObjectChildren{}}}}}}}; auto pipeline = cst_pipeline_translation::translatePipeline(cst, getExpCtx()); auto& sources = pipeline->getSources(); ASSERT_EQ(1u, sources.size()); @@ -76,10 +76,13 @@ TEST(CstTest, TranslatesEmptyProject) { } TEST(CstPipelineTranslationTest, TranslatesEmptyProjects) { - const auto cst = CNode{CNode::ArrayChildren{ - CNode{CNode::ObjectChildren{{KeyFieldname::project, CNode{CNode::ObjectChildren{}}}}}, - CNode{CNode::ObjectChildren{{KeyFieldname::project, CNode{CNode::ObjectChildren{}}}}}, - CNode{CNode::ObjectChildren{{KeyFieldname::project, CNode{CNode::ObjectChildren{}}}}}}}; + const auto cst = + CNode{CNode::ArrayChildren{CNode{CNode::ObjectChildren{{KeyFieldname::projectInclusion, + CNode{CNode::ObjectChildren{}}}}}, + CNode{CNode::ObjectChildren{{KeyFieldname::projectInclusion, + CNode{CNode::ObjectChildren{}}}}}, + CNode{CNode::ObjectChildren{{KeyFieldname::projectInclusion, + CNode{CNode::ObjectChildren{}}}}}}}; auto pipeline = cst_pipeline_translation::translatePipeline(cst, getExpCtx()); auto& sources = pipeline->getSources(); ASSERT_EQ(3u, sources.size()); @@ -91,7 +94,7 @@ TEST(CstPipelineTranslationTest, TranslatesEmptyProjects) { TEST(CstPipelineTranslationTest, TranslatesOneFieldInclusionProjectionStage) { const auto cst = CNode{CNode::ArrayChildren{CNode{CNode::ObjectChildren{ - {KeyFieldname::project, + {KeyFieldname::projectInclusion, CNode{CNode::ObjectChildren{{UserFieldname{"a"}, CNode{KeyValue::trueKey}}}}}}}}}; auto pipeline = cst_pipeline_translation::translatePipeline(cst, getExpCtx()); auto& sources = pipeline->getSources(); @@ -106,7 +109,7 @@ TEST(CstPipelineTranslationTest, TranslatesOneFieldInclusionProjectionStage) { TEST(CstPipelineTranslationTest, TranslatesMultifieldInclusionProjection) { const auto cst = CNode{CNode::ArrayChildren{CNode{CNode::ObjectChildren{ - {KeyFieldname::project, + {KeyFieldname::projectInclusion, CNode{CNode::ObjectChildren{{KeyFieldname::id, CNode{KeyValue::trueKey}}, {UserFieldname{"a"}, CNode{NonZeroKey{7}}}, {UserFieldname{"b"}, CNode{NonZeroKey{-99999999999ll}}}}}}}}}}; @@ -123,7 +126,7 @@ TEST(CstPipelineTranslationTest, TranslatesMultifieldInclusionProjection) { TEST(CstPipelineTranslationTest, TranslatesOneFieldExclusionProjectionStage) { const auto cst = CNode{CNode::ArrayChildren{CNode{CNode::ObjectChildren{ - {KeyFieldname::project, + {KeyFieldname::projectExclusion, CNode{CNode::ObjectChildren{{UserFieldname{"a"}, CNode{KeyValue::falseKey}}}}}}}}}; auto pipeline = cst_pipeline_translation::translatePipeline(cst, getExpCtx()); auto& sources = pipeline->getSources(); @@ -138,7 +141,7 @@ TEST(CstPipelineTranslationTest, TranslatesOneFieldExclusionProjectionStage) { TEST(CstPipelineTranslationTest, TranslatesMultifieldExclusionProjection) { const auto cst = CNode{CNode::ArrayChildren{CNode{CNode::ObjectChildren{ - {KeyFieldname::project, + {KeyFieldname::projectExclusion, CNode{CNode::ObjectChildren{{KeyFieldname::id, CNode{KeyValue::falseKey}}, {UserFieldname{"a"}, CNode{KeyValue::doubleZeroKey}}, {UserFieldname{"b"}, CNode{KeyValue::decimalZeroKey}}}}}}}}}; @@ -153,18 +156,9 @@ TEST(CstPipelineTranslationTest, TranslatesMultifieldExclusionProjection) { singleDoc.getTransformer().serializeTransformation(boost::none).toBson())); } -TEST(CstPipelineTranslationTest, FailsToTranslateInclusionExclusionMixedProjectionStage) { - const auto cst = CNode{CNode::ArrayChildren{CNode{CNode::ObjectChildren{ - {KeyFieldname::project, - CNode{CNode::ObjectChildren{{UserFieldname{"a"}, CNode{KeyValue::trueKey}}, - {UserFieldname{"b"}, CNode{KeyValue::falseKey}}}}}}}}}; - ASSERT_THROWS_CODE( - cst_pipeline_translation::translatePipeline(cst, getExpCtx()), DBException, 4933100); -} - TEST(CstPipelineTranslationTest, TranslatesComputedProjection) { const auto cst = CNode{CNode::ArrayChildren{CNode{CNode::ObjectChildren{ - {KeyFieldname::project, + {KeyFieldname::projectInclusion, CNode{CNode::ObjectChildren{ {UserFieldname{"a"}, CNode{CNode::ObjectChildren{ @@ -193,22 +187,9 @@ TEST(CstPipelineTranslationTest, TranslatesComputedProjection) { singleDoc.getTransformer().serializeTransformation(boost::none).toBson())); } -TEST(CstPipelineTranslationTest, FailsToTranslateComputedExclusionMixedProjectionStage) { - const auto cst = CNode{CNode::ArrayChildren{CNode{CNode::ObjectChildren{ - {KeyFieldname::project, - CNode{CNode::ObjectChildren{ - {UserFieldname{"a"}, - CNode{CNode::ObjectChildren{ - {KeyFieldname::atan2, - CNode{CNode::ArrayChildren{CNode{UserDouble{1.0}}, CNode{UserDecimal{0.0}}}}}}}}, - {UserFieldname{"b"}, CNode{KeyValue::falseKey}}}}}}}}}; - ASSERT_THROWS_CODE( - cst_pipeline_translation::translatePipeline(cst, getExpCtx()), DBException, 4933100); -} - TEST(CstPipelineTranslationTest, TranslatesComputedInclusionMixedProjectionStage) { const auto cst = CNode{CNode::ArrayChildren{CNode{CNode::ObjectChildren{ - {KeyFieldname::project, + {KeyFieldname::projectInclusion, CNode{CNode::ObjectChildren{ {UserFieldname{"a"}, CNode{CNode::ObjectChildren{ @@ -239,13 +220,13 @@ TEST(CstPipelineTranslationTest, TranslatesMultipleProjectionStages) { // ] const auto cst = CNode{CNode::ArrayChildren{ CNode{CNode::ObjectChildren{ - {KeyFieldname::project, + {KeyFieldname::projectInclusion, CNode{CNode::ObjectChildren{{UserFieldname{"a"}, CNode{KeyValue::trueKey}}}}}}}, CNode{CNode::ObjectChildren{ - {KeyFieldname::project, + {KeyFieldname::projectExclusion, CNode{CNode::ObjectChildren{{UserFieldname{"b"}, CNode{KeyValue::falseKey}}}}}}}, CNode{ - CNode::ObjectChildren{{KeyFieldname::project, + CNode::ObjectChildren{{KeyFieldname::projectInclusion, CNode{CNode::ObjectChildren{ {UserFieldname{"c"}, CNode{CNode::ObjectChildren{ @@ -301,14 +282,14 @@ TEST(CstPipelineTranslationTest, TranslatesMultipleProjectionStagesWithAndOrNot) // ] const auto cst = CNode{CNode::ArrayChildren{ CNode{CNode::ObjectChildren{ - {KeyFieldname::project, + {KeyFieldname::projectInclusion, CNode{CNode::ObjectChildren{ {UserFieldname{"a"}, CNode{CNode::ObjectChildren{ {KeyFieldname::notExpr, CNode{CNode::ArrayChildren{CNode{UserInt{0}}}}}}}}}}}}}, CNode{ - CNode::ObjectChildren{{KeyFieldname::project, + CNode::ObjectChildren{{KeyFieldname::projectInclusion, CNode{CNode::ObjectChildren{ {UserFieldname{"c"}, CNode{CNode::ObjectChildren{ @@ -350,7 +331,7 @@ TEST(CstPipelineTranslationTest, TranslatesMultipleProjectionStagesWithAndOrNot) TEST(CstPipelineTranslationTest, TranslatesComputedProjectionWithAndOr) { const auto cst = CNode{CNode::ArrayChildren{CNode{CNode::ObjectChildren{ - {KeyFieldname::project, + {KeyFieldname::projectInclusion, CNode{CNode::ObjectChildren{ {UserFieldname{"a"}, CNode{CNode::ObjectChildren{ @@ -388,7 +369,7 @@ TEST(CstPipelineTranslationTest, TranslatesComputedProjectionWithAndOr) { TEST(CstPipelineTranslationTest, TranslatesComputedProjectionWithExpressionOnId) { const auto cst = CNode{CNode::ArrayChildren{CNode{CNode::ObjectChildren{ - {KeyFieldname::project, + {KeyFieldname::projectInclusion, CNode{CNode::ObjectChildren{ {KeyFieldname::id, CNode{CNode::ObjectChildren{ @@ -615,7 +596,7 @@ TEST(CstPipelineTranslationTest, TranslatesProjectionWithConvert) { // } } // ] const auto cst = CNode{CNode::ArrayChildren{CNode{CNode::ObjectChildren{ - {KeyFieldname::project, + {KeyFieldname::projectInclusion, CNode{CNode::ObjectChildren{ {UserFieldname{"a"}, CNode{CNode::ObjectChildren{ diff --git a/src/mongo/db/cst/cst_test.cpp b/src/mongo/db/cst/cst_test.cpp index 5f766431c1f..ce8f9f06597 100644 --- a/src/mongo/db/cst/cst_test.cpp +++ b/src/mongo/db/cst/cst_test.cpp @@ -54,11 +54,12 @@ TEST(CstTest, BuildsAndPrints) { } { const auto cst = CNode{CNode::ObjectChildren{ - {KeyFieldname::project, + {KeyFieldname::projectInclusion, CNode{CNode::ObjectChildren{{UserFieldname{"a"}, CNode{KeyValue::trueKey}}, {KeyFieldname::id, CNode{KeyValue::falseKey}}}}}}}; ASSERT_BSONOBJ_EQ( - fromjson("{project : {a: \"<KeyValue trueKey>\", id: \"<KeyValue falseKey>\"}}"), + fromjson( + "{projectInclusion : {a: \"<KeyValue trueKey>\", id: \"<KeyValue falseKey>\"}}"), cst.toBson()); } } @@ -269,9 +270,10 @@ TEST(CstGrammarTest, ParsesProject) { ASSERT_EQ(0, parseTree.parse()); auto stages = stdx::get<CNode::ArrayChildren>(output.payload); ASSERT_EQ(1, stages.size()); - ASSERT(KeyFieldname::project == stages[0].firstKeyFieldname()); + ASSERT(KeyFieldname::projectInclusion == stages[0].firstKeyFieldname()); ASSERT_EQ(stages[0].toBson().toString(), - "{ project: { a: \"<NonZeroKey of type double 1.000000>\", b: \"<NonZeroKey of " + "{ projectInclusion: { a: \"<NonZeroKey of type double 1.000000>\", b: " + "\"<NonZeroKey of " "type int 1>\", id: \"<NonZeroKey of type long 1>\" } }"); } { @@ -283,10 +285,11 @@ TEST(CstGrammarTest, ParsesProject) { ASSERT_EQ(0, parseTree.parse()); auto stages = stdx::get<CNode::ArrayChildren>(output.payload); ASSERT_EQ(1, stages.size()); - ASSERT(KeyFieldname::project == stages[0].firstKeyFieldname()); - ASSERT_EQ(stages[0].toBson().toString(), - "{ project: { a: \"<KeyValue doubleZeroKey>\", b: \"<KeyValue intZeroKey>\", " - "c: \"<KeyValue longZeroKey>\" } }"); + ASSERT(KeyFieldname::projectExclusion == stages[0].firstKeyFieldname()); + ASSERT_EQ( + stages[0].toBson().toString(), + "{ projectExclusion: { a: \"<KeyValue doubleZeroKey>\", b: \"<KeyValue intZeroKey>\", " + "c: \"<KeyValue longZeroKey>\" } }"); } { CNode output; @@ -299,15 +302,32 @@ TEST(CstGrammarTest, ParsesProject) { ASSERT_EQ(0, parseTree.parse()); auto stages = stdx::get<CNode::ArrayChildren>(output.payload); ASSERT_EQ(1, stages.size()); - ASSERT(KeyFieldname::project == stages[0].firstKeyFieldname()); + ASSERT(KeyFieldname::projectInclusion == stages[0].firstKeyFieldname()); ASSERT_EQ(stages[0].toBson().toString(), - "{ project: { id: \"<NonZeroKey of type double 9.100000>\", a: { add: [ " + "{ projectInclusion: { id: \"<NonZeroKey of type double 9.100000>\", a: { add: [ " "\"<UserInt 4>\", \"<UserInt 5>\", { add: [ \"<UserInt 6>\", \"<UserInt 7>\", " "\"<UserInt 8>\" ] } ] }, b: { atan2: [ \"<UserDouble 1.000000>\", { add: [ " "\"<UserInt 2>\", \"<UserInt -3>\" ] } ] } } }"); } } +TEST(CstGrammarTest, FailsTOParseMixedProject) { + { + CNode output; + auto input = fromjson("{pipeline: [{$project: {a: 1, b: 0.0}}]}"); + BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE); + auto parseTree = PipelineParserGen(lexer, &output); + ASSERT_THROWS_CODE(parseTree.parse(), AssertionException, ErrorCodes::FailedToParse); + } + { + CNode output; + auto input = fromjson("{pipeline: [{$project: {a: 0, b: {$add: [5, 67]}}}]}"); + BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE); + auto parseTree = PipelineParserGen(lexer, &output); + ASSERT_THROWS_CODE(parseTree.parse(), AssertionException, ErrorCodes::FailedToParse); + } +} + TEST(CstTest, BuildsAndPrintsAnd) { { const auto cst = CNode{CNode::ObjectChildren{ @@ -638,8 +658,9 @@ TEST(CstGrammarTest, ParsesValidNumberAbs) { ASSERT_EQ(0, parseTree.parse()); auto stages = stdx::get<CNode::ArrayChildren>(output.payload); ASSERT_EQ(1, stages.size()); - ASSERT(KeyFieldname::project == stages[0].firstKeyFieldname()); - ASSERT_EQ(stages[0].toBson().toString(), "{ project: { val: { abs: \"<UserInt 1>\" } } }"); + ASSERT(KeyFieldname::projectInclusion == stages[0].firstKeyFieldname()); + ASSERT_EQ(stages[0].toBson().toString(), + "{ projectInclusion: { val: { abs: \"<UserInt 1>\" } } }"); } TEST(CstGrammarTest, ParsesValidCeil) { @@ -650,9 +671,9 @@ TEST(CstGrammarTest, ParsesValidCeil) { ASSERT_EQ(0, parseTree.parse()); auto stages = stdx::get<CNode::ArrayChildren>(output.payload); ASSERT_EQ(1, stages.size()); - ASSERT(KeyFieldname::project == stages[0].firstKeyFieldname()); + ASSERT(KeyFieldname::projectInclusion == stages[0].firstKeyFieldname()); ASSERT_EQ(stages[0].toBson().toString(), - "{ project: { val: { ceil: \"<UserDouble 1.500000>\" } } }"); + "{ projectInclusion: { val: { ceil: \"<UserDouble 1.500000>\" } } }"); } TEST(CstGrammarTest, ParsesValidDivide) { @@ -663,9 +684,9 @@ TEST(CstGrammarTest, ParsesValidDivide) { ASSERT_EQ(0, parseTree.parse()); auto stages = stdx::get<CNode::ArrayChildren>(output.payload); ASSERT_EQ(1, stages.size()); - ASSERT(KeyFieldname::project == stages[0].firstKeyFieldname()); + ASSERT(KeyFieldname::projectInclusion == stages[0].firstKeyFieldname()); ASSERT_EQ(stages[0].toBson().toString(), - "{ project: { val: { divide: [ \"<UserInt 10>\", \"<UserInt 5>\" ] } } }"); + "{ projectInclusion: { val: { divide: [ \"<UserInt 10>\", \"<UserInt 5>\" ] } } }"); } TEST(CstGrammarTest, ParsesValidExp) { @@ -676,9 +697,9 @@ TEST(CstGrammarTest, ParsesValidExp) { ASSERT_EQ(0, parseTree.parse()); auto stages = stdx::get<CNode::ArrayChildren>(output.payload); ASSERT_EQ(1, stages.size()); - ASSERT(KeyFieldname::project == stages[0].firstKeyFieldname()); + ASSERT(KeyFieldname::projectInclusion == stages[0].firstKeyFieldname()); ASSERT_EQ(stages[0].toBson().toString(), - "{ project: { val: { exponent: \"<UserDouble 1.500000>\" } } }"); + "{ projectInclusion: { val: { exponent: \"<UserDouble 1.500000>\" } } }"); } TEST(CstGrammarTest, ParsesValidFloor) { @@ -689,9 +710,9 @@ TEST(CstGrammarTest, ParsesValidFloor) { ASSERT_EQ(0, parseTree.parse()); auto stages = stdx::get<CNode::ArrayChildren>(output.payload); ASSERT_EQ(1, stages.size()); - ASSERT(KeyFieldname::project == stages[0].firstKeyFieldname()); + ASSERT(KeyFieldname::projectInclusion == stages[0].firstKeyFieldname()); ASSERT_EQ(stages[0].toBson().toString(), - "{ project: { val: { floor: \"<UserDouble 1.500000>\" } } }"); + "{ projectInclusion: { val: { floor: \"<UserDouble 1.500000>\" } } }"); } TEST(CstGrammarTest, ParsesValidLn) { @@ -702,9 +723,9 @@ TEST(CstGrammarTest, ParsesValidLn) { ASSERT_EQ(0, parseTree.parse()); auto stages = stdx::get<CNode::ArrayChildren>(output.payload); ASSERT_EQ(1, stages.size()); - ASSERT(KeyFieldname::project == stages[0].firstKeyFieldname()); + ASSERT(KeyFieldname::projectInclusion == stages[0].firstKeyFieldname()); ASSERT_EQ(stages[0].toBson().toString(), - "{ project: { val: { ln: [ \"<UserInt 10>\", \"<UserInt 37>\" ] } } }"); + "{ projectInclusion: { val: { ln: [ \"<UserInt 10>\", \"<UserInt 37>\" ] } } }"); } TEST(CstGrammarTest, ParsesValidLog) { @@ -715,9 +736,9 @@ TEST(CstGrammarTest, ParsesValidLog) { ASSERT_EQ(0, parseTree.parse()); auto stages = stdx::get<CNode::ArrayChildren>(output.payload); ASSERT_EQ(1, stages.size()); - ASSERT(KeyFieldname::project == stages[0].firstKeyFieldname()); + ASSERT(KeyFieldname::projectInclusion == stages[0].firstKeyFieldname()); ASSERT_EQ(stages[0].toBson().toString(), - "{ project: { val: { log: [ \"<UserInt 10>\", \"<UserInt 5>\" ] } } }"); + "{ projectInclusion: { val: { log: [ \"<UserInt 10>\", \"<UserInt 5>\" ] } } }"); } TEST(CstGrammarTest, ParsesValidLog10) { @@ -728,9 +749,9 @@ TEST(CstGrammarTest, ParsesValidLog10) { ASSERT_EQ(0, parseTree.parse()); auto stages = stdx::get<CNode::ArrayChildren>(output.payload); ASSERT_EQ(1, stages.size()); - ASSERT(KeyFieldname::project == stages[0].firstKeyFieldname()); + ASSERT(KeyFieldname::projectInclusion == stages[0].firstKeyFieldname()); ASSERT_EQ(stages[0].toBson().toString(), - "{ project: { val: { logten: \"<UserDouble 1.500000>\" } } }"); + "{ projectInclusion: { val: { logten: \"<UserDouble 1.500000>\" } } }"); } TEST(CstGrammarTest, ParsesValidMod) { @@ -741,9 +762,9 @@ TEST(CstGrammarTest, ParsesValidMod) { ASSERT_EQ(0, parseTree.parse()); auto stages = stdx::get<CNode::ArrayChildren>(output.payload); ASSERT_EQ(1, stages.size()); - ASSERT(KeyFieldname::project == stages[0].firstKeyFieldname()); + ASSERT(KeyFieldname::projectInclusion == stages[0].firstKeyFieldname()); ASSERT_EQ(stages[0].toBson().toString(), - "{ project: { val: { mod: [ \"<UserInt 10>\", \"<UserInt 5>\" ] } } }"); + "{ projectInclusion: { val: { mod: [ \"<UserInt 10>\", \"<UserInt 5>\" ] } } }"); } TEST(CstGrammarTest, ParsesValidMultiply) { @@ -754,9 +775,9 @@ TEST(CstGrammarTest, ParsesValidMultiply) { ASSERT_EQ(0, parseTree.parse()); auto stages = stdx::get<CNode::ArrayChildren>(output.payload); ASSERT_EQ(1, stages.size()); - ASSERT(KeyFieldname::project == stages[0].firstKeyFieldname()); + ASSERT(KeyFieldname::projectInclusion == stages[0].firstKeyFieldname()); ASSERT_EQ(stages[0].toBson().toString(), - "{ project: { val: { multiply: [ \"<UserInt 10>\", \"<UserInt 5>\" ] } } }"); + "{ projectInclusion: { val: { multiply: [ \"<UserInt 10>\", \"<UserInt 5>\" ] } } }"); } TEST(CstGrammarTest, ParsesValidPow) { @@ -767,9 +788,9 @@ TEST(CstGrammarTest, ParsesValidPow) { ASSERT_EQ(0, parseTree.parse()); auto stages = stdx::get<CNode::ArrayChildren>(output.payload); ASSERT_EQ(1, stages.size()); - ASSERT(KeyFieldname::project == stages[0].firstKeyFieldname()); + ASSERT(KeyFieldname::projectInclusion == stages[0].firstKeyFieldname()); ASSERT_EQ(stages[0].toBson().toString(), - "{ project: { val: { pow: [ \"<UserInt 10>\", \"<UserInt 5>\" ] } } }"); + "{ projectInclusion: { val: { pow: [ \"<UserInt 10>\", \"<UserInt 5>\" ] } } }"); } TEST(CstGrammarTest, ParsesValidRound) { @@ -780,9 +801,10 @@ TEST(CstGrammarTest, ParsesValidRound) { ASSERT_EQ(0, parseTree.parse()); auto stages = stdx::get<CNode::ArrayChildren>(output.payload); ASSERT_EQ(1, stages.size()); - ASSERT(KeyFieldname::project == stages[0].firstKeyFieldname()); - ASSERT_EQ(stages[0].toBson().toString(), - "{ project: { val: { round: [ \"<UserDouble 1.234000>\", \"<UserInt 2>\" ] } } }"); + ASSERT(KeyFieldname::projectInclusion == stages[0].firstKeyFieldname()); + ASSERT_EQ( + stages[0].toBson().toString(), + "{ projectInclusion: { val: { round: [ \"<UserDouble 1.234000>\", \"<UserInt 2>\" ] } } }"); } TEST(CstGrammarTest, ParsesValidSqrt) { @@ -793,8 +815,9 @@ TEST(CstGrammarTest, ParsesValidSqrt) { ASSERT_EQ(0, parseTree.parse()); auto stages = stdx::get<CNode::ArrayChildren>(output.payload); ASSERT_EQ(1, stages.size()); - ASSERT(KeyFieldname::project == stages[0].firstKeyFieldname()); - ASSERT_EQ(stages[0].toBson().toString(), "{ project: { val: { sqrt: \"<UserInt 25>\" } } }"); + ASSERT(KeyFieldname::projectInclusion == stages[0].firstKeyFieldname()); + ASSERT_EQ(stages[0].toBson().toString(), + "{ projectInclusion: { val: { sqrt: \"<UserInt 25>\" } } }"); } TEST(CstGrammarTest, ParsesValidSubtract) { @@ -805,9 +828,9 @@ TEST(CstGrammarTest, ParsesValidSubtract) { ASSERT_EQ(0, parseTree.parse()); auto stages = stdx::get<CNode::ArrayChildren>(output.payload); ASSERT_EQ(1, stages.size()); - ASSERT(KeyFieldname::project == stages[0].firstKeyFieldname()); + ASSERT(KeyFieldname::projectInclusion == stages[0].firstKeyFieldname()); ASSERT_EQ(stages[0].toBson().toString(), - "{ project: { val: { subtract: [ \"<UserInt 10>\", \"<UserInt 5>\" ] } } }"); + "{ projectInclusion: { val: { subtract: [ \"<UserInt 10>\", \"<UserInt 5>\" ] } } }"); } TEST(CstGrammarTest, ParsesValidTrunc) { @@ -818,9 +841,10 @@ TEST(CstGrammarTest, ParsesValidTrunc) { ASSERT_EQ(0, parseTree.parse()); auto stages = stdx::get<CNode::ArrayChildren>(output.payload); ASSERT_EQ(1, stages.size()); - ASSERT(KeyFieldname::project == stages[0].firstKeyFieldname()); - ASSERT_EQ(stages[0].toBson().toString(), - "{ project: { val: { trunc: [ \"<UserDouble 1.234000>\", \"<UserInt 2>\" ] } } }"); + ASSERT(KeyFieldname::projectInclusion == stages[0].firstKeyFieldname()); + ASSERT_EQ( + stages[0].toBson().toString(), + "{ projectInclusion: { val: { trunc: [ \"<UserDouble 1.234000>\", \"<UserInt 2>\" ] } } }"); } TEST(CstGrammarTest, ParsesEmptyMatchInFind) { diff --git a/src/mongo/db/cst/key_fieldname.h b/src/mongo/db/cst/key_fieldname.h index 1e2b5f3f25e..8b1ba6a4268 100644 --- a/src/mongo/db/cst/key_fieldname.h +++ b/src/mongo/db/cst/key_fieldname.h @@ -62,7 +62,8 @@ ENUMIFY(lt) \ ENUMIFY(lte) \ ENUMIFY(ne) \ - ENUMIFY(project) \ + ENUMIFY(projectExclusion) \ + ENUMIFY(projectInclusion) \ ENUMIFY(match) \ ENUMIFY(inhibitOptimization) \ ENUMIFY(unionWith) \ diff --git a/src/mongo/db/cst/location_gen.h b/src/mongo/db/cst/location_gen.h index e7873ad89d6..c6549fdadbf 100644 --- a/src/mongo/db/cst/location_gen.h +++ b/src/mongo/db/cst/location_gen.h @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.6. +// A Bison parser, made by GNU Bison 3.6.3. // Locations for Bison parsers in C++ @@ -31,12 +31,12 @@ // version 2.2 of Bison. /** - ** \file src/mongo/db/cst/location_gen.h + ** \file location_gen.h ** Define the mongo::location class. */ -#ifndef YY_YY_SRC_MONGO_DB_CST_LOCATION_GEN_H_INCLUDED -#define YY_YY_SRC_MONGO_DB_CST_LOCATION_GEN_H_INCLUDED +#ifndef YY_YY_LOCATION_GEN_H_INCLUDED +#define YY_YY_LOCATION_GEN_H_INCLUDED #include <iostream> #include <string> @@ -53,9 +53,9 @@ #endif #endif -#line 58 "src/mongo/db/cst/pipeline_grammar.yy" +#line 58 "pipeline_grammar.yy" namespace mongo { -#line 59 "src/mongo/db/cst/location_gen.h" +#line 59 "location_gen.h" /// A point in a source file. class position { @@ -260,8 +260,8 @@ std::basic_ostream<YYChar>& operator<<(std::basic_ostream<YYChar>& ostr, const l return ostr; } -#line 58 "src/mongo/db/cst/pipeline_grammar.yy" +#line 58 "pipeline_grammar.yy" } // namespace mongo -#line 333 "src/mongo/db/cst/location_gen.h" +#line 333 "location_gen.h" -#endif // !YY_YY_SRC_MONGO_DB_CST_LOCATION_GEN_H_INCLUDED +#endif // !YY_YY_LOCATION_GEN_H_INCLUDED diff --git a/src/mongo/db/cst/pipeline_grammar.yy b/src/mongo/db/cst/pipeline_grammar.yy index acfef1c5a33..aef51ff34d3 100644 --- a/src/mongo/db/cst/pipeline_grammar.yy +++ b/src/mongo/db/cst/pipeline_grammar.yy @@ -65,8 +65,6 @@ // Header only. %code requires { #include "mongo/db/cst/c_node.h" - #include "mongo/db/cst/key_fieldname.h" - #include "mongo/stdx/variant.h" // Forward declare any parameters needed for lexing/parsing. namespace mongo { @@ -82,11 +80,14 @@ // Cpp only. %code { #include "mongo/db/cst/bson_lexer.h" + #include "mongo/db/cst/c_node_validation.h" + #include "mongo/db/cst/key_fieldname.h" #include "mongo/platform/decimal128.h" + #include "mongo/stdx/variant.h" namespace mongo { // Mandatory error function. - void PipelineParserGen::error (const PipelineParserGen::location_type& loc, + void PipelineParserGen::error (const PipelineParserGen::location_type& loc, const std::string& msg) { uasserted(ErrorCodes::FailedToParse, str::stream() << msg << " at location " << @@ -315,7 +316,17 @@ limit: project: STAGE_PROJECT START_OBJECT projectFields END_OBJECT { - $$ = CNode{CNode::ObjectChildren{std::pair{KeyFieldname::project, $projectFields}}}; + auto&& fields = $projectFields; + if (auto inclusion = c_node_validation::validateProjectionAsInclusionOrExclusion(fields); + inclusion.isOK()) + $$ = CNode{CNode::ObjectChildren{std::pair{inclusion.getValue() == + c_node_validation::IsInclusion::yes ? + KeyFieldname::projectInclusion : + KeyFieldname::projectExclusion, + std::move(fields)}}}; + else + // TODO SERVER-48810: Convert error string to Bison error with BSON location. + uassertStatusOK(inclusion); } ; @@ -340,6 +351,16 @@ projectField: projection: string + | binary + | undefined + | objectId + | date + | null + | regex + | dbPointer + | javascript + | symbol + | javascriptWScope | INT_NON_ZERO { $$ = CNode{NonZeroKey{$1}}; } @@ -370,6 +391,9 @@ projection: | BOOL_FALSE { $$ = CNode{KeyValue::falseKey}; } + | timestamp + | minKey + | maxKey | compoundExpression ; diff --git a/src/mongo/db/cst/pipeline_parser_gen.cpp b/src/mongo/db/cst/pipeline_parser_gen.cpp index c04b637fa3e..0f910699689 100644 --- a/src/mongo/db/cst/pipeline_parser_gen.cpp +++ b/src/mongo/db/cst/pipeline_parser_gen.cpp @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.6. +// A Bison parser, made by GNU Bison 3.6.3. // Skeleton implementation for Bison LALR(1) parsers in C++ @@ -39,10 +39,13 @@ // Unqualified %code blocks. -#line 83 "src/mongo/db/cst/pipeline_grammar.yy" +#line 81 "pipeline_grammar.yy" #include "mongo/db/cst/bson_lexer.h" +#include "mongo/db/cst/c_node_validation.h" +#include "mongo/db/cst/key_fieldname.h" #include "mongo/platform/decimal128.h" +#include "mongo/stdx/variant.h" namespace mongo { // Mandatory error function. @@ -54,7 +57,7 @@ void PipelineParserGen::error(const PipelineParserGen::location_type& loc, const } } // namespace mongo -#line 63 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 66 "pipeline_parser_gen.cpp" #ifndef YY_ @@ -145,16 +148,9 @@ void PipelineParserGen::error(const PipelineParserGen::location_type& loc, const #define YYERROR goto yyerrorlab #define YYRECOVERING() (!!yyerrstatus_) -#line 58 "src/mongo/db/cst/pipeline_grammar.yy" +#line 58 "pipeline_grammar.yy" namespace mongo { -#line 156 "src/mongo/db/cst/pipeline_parser_gen.cpp" - -#if YYDEBUG || 0 -const char* PipelineParserGen::symbol_name(symbol_kind_type yysymbol) { - return yytname_[yysymbol]; -} -#endif // #if YYDEBUG || 0 - +#line 159 "pipeline_parser_gen.cpp" /// Build a parser object. PipelineParserGen::PipelineParserGen(BSONLexer& lexer_yyarg, CNode* cst_yyarg) @@ -1037,7 +1033,7 @@ void PipelineParserGen::yy_print_(std::ostream& yyo, const basic_symbol<Base>& y yyo << "empty symbol"; else { symbol_kind_type yykind = yysym.kind(); - yyo << (yykind < YYNTOKENS ? "token" : "nterm") << ' ' << symbol_name(yykind) << " (" + yyo << (yykind < YYNTOKENS ? "token" : "nterm") << ' ' << yysym.name() << " (" << yysym.location << ": "; YYUSE(yykind); yyo << ')'; @@ -1446,95 +1442,95 @@ int PipelineParserGen::parse() { { switch (yyn) { case 3: -#line 249 "src/mongo/db/cst/pipeline_grammar.yy" +#line 250 "pipeline_grammar.yy" { *cst = CNode{YY_MOVE(yystack_[0].value.as<CNode>())}; } -#line 1522 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1516 "pipeline_parser_gen.cpp" break; case 4: -#line 256 "src/mongo/db/cst/pipeline_grammar.yy" +#line 257 "pipeline_grammar.yy" { *cst = YY_MOVE(yystack_[1].value.as<CNode>()); } -#line 1530 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1524 "pipeline_parser_gen.cpp" break; case 5: -#line 262 "src/mongo/db/cst/pipeline_grammar.yy" +#line 263 "pipeline_grammar.yy" { } -#line 1536 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1530 "pipeline_parser_gen.cpp" break; case 6: -#line 263 "src/mongo/db/cst/pipeline_grammar.yy" +#line 264 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ArrayChildren{YY_MOVE(yystack_[2].value.as<CNode>())}}; } -#line 1544 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1538 "pipeline_parser_gen.cpp" break; case 7: -#line 271 "src/mongo/db/cst/pipeline_grammar.yy" +#line 272 "pipeline_grammar.yy" { lexer.sortObjTokens(); } -#line 1550 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1544 "pipeline_parser_gen.cpp" break; case 9: -#line 274 "src/mongo/db/cst/pipeline_grammar.yy" +#line 275 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1556 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1550 "pipeline_parser_gen.cpp" break; case 10: -#line 274 "src/mongo/db/cst/pipeline_grammar.yy" +#line 275 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1562 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1556 "pipeline_parser_gen.cpp" break; case 11: -#line 274 "src/mongo/db/cst/pipeline_grammar.yy" +#line 275 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1568 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1562 "pipeline_parser_gen.cpp" break; case 12: -#line 274 "src/mongo/db/cst/pipeline_grammar.yy" +#line 275 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1574 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1568 "pipeline_parser_gen.cpp" break; case 13: -#line 274 "src/mongo/db/cst/pipeline_grammar.yy" +#line 275 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1580 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1574 "pipeline_parser_gen.cpp" break; case 14: -#line 274 "src/mongo/db/cst/pipeline_grammar.yy" +#line 275 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1586 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1580 "pipeline_parser_gen.cpp" break; case 15: -#line 277 "src/mongo/db/cst/pipeline_grammar.yy" +#line 278 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{std::pair{ KeyFieldname::sample, @@ -1542,20 +1538,20 @@ int PipelineParserGen::parse() { {KeyFieldname::sizeArg, YY_MOVE(yystack_[1].value.as<CNode>())}, }}}}}; } -#line 1598 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1592 "pipeline_parser_gen.cpp" break; case 16: -#line 287 "src/mongo/db/cst/pipeline_grammar.yy" +#line 288 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ std::pair{KeyFieldname::inhibitOptimization, CNode::noopLeaf()}}}; } -#line 1606 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1600 "pipeline_parser_gen.cpp" break; case 17: -#line 293 "src/mongo/db/cst/pipeline_grammar.yy" +#line 294 "pipeline_grammar.yy" { auto pipeline = YY_MOVE(yystack_[1].value.as<CNode>()); yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{std::pair{ @@ -1564,1443 +1560,1558 @@ int PipelineParserGen::parse() { {KeyFieldname::collArg, YY_MOVE(yystack_[3].value.as<CNode>())}, {KeyFieldname::pipelineArg, std::move(pipeline)}}}}}}; } -#line 1619 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1613 "pipeline_parser_gen.cpp" break; case 18: -#line 303 "src/mongo/db/cst/pipeline_grammar.yy" +#line 304 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1625 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1619 "pipeline_parser_gen.cpp" break; case 19: -#line 303 "src/mongo/db/cst/pipeline_grammar.yy" +#line 304 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1631 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1625 "pipeline_parser_gen.cpp" break; case 20: -#line 303 "src/mongo/db/cst/pipeline_grammar.yy" +#line 304 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1637 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1631 "pipeline_parser_gen.cpp" break; case 21: -#line 303 "src/mongo/db/cst/pipeline_grammar.yy" +#line 304 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1643 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1637 "pipeline_parser_gen.cpp" break; case 22: -#line 307 "src/mongo/db/cst/pipeline_grammar.yy" +#line 308 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ std::pair{KeyFieldname::skip, YY_MOVE(yystack_[0].value.as<CNode>())}}}; } -#line 1651 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1645 "pipeline_parser_gen.cpp" break; case 23: -#line 312 "src/mongo/db/cst/pipeline_grammar.yy" +#line 313 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{std::pair{ KeyFieldname::limit, YY_MOVE(yystack_[0].value.as<CNode>())}}}; } -#line 1659 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1653 "pipeline_parser_gen.cpp" break; case 24: -#line 317 "src/mongo/db/cst/pipeline_grammar.yy" +#line 318 "pipeline_grammar.yy" { - yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{std::pair{ - KeyFieldname::project, YY_MOVE(yystack_[1].value.as<CNode>())}}}; + auto&& fields = YY_MOVE(yystack_[1].value.as<CNode>()); + if (auto inclusion = + c_node_validation::validateProjectionAsInclusionOrExclusion(fields); + inclusion.isOK()) + yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{std::pair{ + inclusion.getValue() == c_node_validation::IsInclusion::yes + ? KeyFieldname::projectInclusion + : KeyFieldname::projectExclusion, + std::move(fields)}}}; + else + // TODO SERVER-48810: Convert error string to Bison error with BSON + // location. + uassertStatusOK(inclusion); } -#line 1667 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1671 "pipeline_parser_gen.cpp" break; case 25: -#line 323 "src/mongo/db/cst/pipeline_grammar.yy" +#line 334 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode::noopLeaf(); } -#line 1675 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1679 "pipeline_parser_gen.cpp" break; case 26: -#line 326 "src/mongo/db/cst/pipeline_grammar.yy" +#line 337 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[1].value.as<CNode>()); yylhs.value.as<CNode>().objectChildren().emplace_back( YY_MOVE(yystack_[0].value.as<std::pair<CNode::Fieldname, CNode>>())); } -#line 1684 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1688 "pipeline_parser_gen.cpp" break; case 27: -#line 333 "src/mongo/db/cst/pipeline_grammar.yy" +#line 344 "pipeline_grammar.yy" { yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = { KeyFieldname::id, YY_MOVE(yystack_[0].value.as<CNode>())}; } -#line 1692 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1696 "pipeline_parser_gen.cpp" break; case 28: -#line 336 "src/mongo/db/cst/pipeline_grammar.yy" +#line 347 "pipeline_grammar.yy" { yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = { YY_MOVE(yystack_[1].value.as<CNode::Fieldname>()), YY_MOVE(yystack_[0].value.as<CNode>())}; } -#line 1700 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1704 "pipeline_parser_gen.cpp" break; case 29: -#line 342 "src/mongo/db/cst/pipeline_grammar.yy" +#line 353 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1706 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1710 "pipeline_parser_gen.cpp" break; case 30: -#line 343 "src/mongo/db/cst/pipeline_grammar.yy" +#line 354 "pipeline_grammar.yy" + { + yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); + } +#line 1716 "pipeline_parser_gen.cpp" + break; + + case 31: +#line 355 "pipeline_grammar.yy" + { + yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); + } +#line 1722 "pipeline_parser_gen.cpp" + break; + + case 32: +#line 356 "pipeline_grammar.yy" + { + yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); + } +#line 1728 "pipeline_parser_gen.cpp" + break; + + case 33: +#line 357 "pipeline_grammar.yy" + { + yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); + } +#line 1734 "pipeline_parser_gen.cpp" + break; + + case 34: +#line 358 "pipeline_grammar.yy" + { + yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); + } +#line 1740 "pipeline_parser_gen.cpp" + break; + + case 35: +#line 359 "pipeline_grammar.yy" + { + yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); + } +#line 1746 "pipeline_parser_gen.cpp" + break; + + case 36: +#line 360 "pipeline_grammar.yy" + { + yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); + } +#line 1752 "pipeline_parser_gen.cpp" + break; + + case 37: +#line 361 "pipeline_grammar.yy" + { + yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); + } +#line 1758 "pipeline_parser_gen.cpp" + break; + + case 38: +#line 362 "pipeline_grammar.yy" + { + yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); + } +#line 1764 "pipeline_parser_gen.cpp" + break; + + case 39: +#line 363 "pipeline_grammar.yy" + { + yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); + } +#line 1770 "pipeline_parser_gen.cpp" + break; + + case 40: +#line 364 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{NonZeroKey{YY_MOVE(yystack_[0].value.as<int>())}}; } -#line 1714 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1778 "pipeline_parser_gen.cpp" break; - case 31: -#line 346 "src/mongo/db/cst/pipeline_grammar.yy" + case 41: +#line 367 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{KeyValue::intZeroKey}; } -#line 1722 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1786 "pipeline_parser_gen.cpp" break; - case 32: -#line 349 "src/mongo/db/cst/pipeline_grammar.yy" + case 42: +#line 370 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{NonZeroKey{YY_MOVE(yystack_[0].value.as<long long>())}}; } -#line 1730 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1794 "pipeline_parser_gen.cpp" break; - case 33: -#line 352 "src/mongo/db/cst/pipeline_grammar.yy" + case 43: +#line 373 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{KeyValue::longZeroKey}; } -#line 1738 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1802 "pipeline_parser_gen.cpp" break; - case 34: -#line 355 "src/mongo/db/cst/pipeline_grammar.yy" + case 44: +#line 376 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{NonZeroKey{YY_MOVE(yystack_[0].value.as<double>())}}; } -#line 1746 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1810 "pipeline_parser_gen.cpp" break; - case 35: -#line 358 "src/mongo/db/cst/pipeline_grammar.yy" + case 45: +#line 379 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{KeyValue::doubleZeroKey}; } -#line 1754 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1818 "pipeline_parser_gen.cpp" break; - case 36: -#line 361 "src/mongo/db/cst/pipeline_grammar.yy" + case 46: +#line 382 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{NonZeroKey{YY_MOVE(yystack_[0].value.as<Decimal128>())}}; } -#line 1762 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1826 "pipeline_parser_gen.cpp" break; - case 37: -#line 364 "src/mongo/db/cst/pipeline_grammar.yy" + case 47: +#line 385 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{KeyValue::decimalZeroKey}; } -#line 1770 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1834 "pipeline_parser_gen.cpp" break; - case 38: -#line 367 "src/mongo/db/cst/pipeline_grammar.yy" + case 48: +#line 388 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{KeyValue::trueKey}; } -#line 1778 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1842 "pipeline_parser_gen.cpp" break; - case 39: -#line 370 "src/mongo/db/cst/pipeline_grammar.yy" + case 49: +#line 391 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{KeyValue::falseKey}; } -#line 1786 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1850 "pipeline_parser_gen.cpp" break; - case 40: -#line 373 "src/mongo/db/cst/pipeline_grammar.yy" + case 50: +#line 394 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1792 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1856 "pipeline_parser_gen.cpp" break; - case 41: -#line 377 "src/mongo/db/cst/pipeline_grammar.yy" + case 51: +#line 395 "pipeline_grammar.yy" + { + yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); + } +#line 1862 "pipeline_parser_gen.cpp" + break; + + case 52: +#line 396 "pipeline_grammar.yy" + { + yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); + } +#line 1868 "pipeline_parser_gen.cpp" + break; + + case 53: +#line 397 "pipeline_grammar.yy" + { + yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); + } +#line 1874 "pipeline_parser_gen.cpp" + break; + + case 54: +#line 401 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 1798 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1880 "pipeline_parser_gen.cpp" break; - case 42: -#line 377 "src/mongo/db/cst/pipeline_grammar.yy" + case 55: +#line 401 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 1804 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1886 "pipeline_parser_gen.cpp" break; - case 43: -#line 377 "src/mongo/db/cst/pipeline_grammar.yy" + case 56: +#line 401 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 1810 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1892 "pipeline_parser_gen.cpp" break; - case 44: -#line 377 "src/mongo/db/cst/pipeline_grammar.yy" + case 57: +#line 401 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 1816 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1898 "pipeline_parser_gen.cpp" break; - case 45: -#line 381 "src/mongo/db/cst/pipeline_grammar.yy" + case 58: +#line 405 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{std::pair{ KeyFieldname::match, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 1824 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1906 "pipeline_parser_gen.cpp" break; - case 46: -#line 387 "src/mongo/db/cst/pipeline_grammar.yy" + case 59: +#line 411 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode::noopLeaf(); } -#line 1832 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1914 "pipeline_parser_gen.cpp" break; - case 47: -#line 390 "src/mongo/db/cst/pipeline_grammar.yy" + case 60: +#line 414 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[1].value.as<CNode>()); yylhs.value.as<CNode>().objectChildren().emplace_back( YY_MOVE(yystack_[0].value.as<std::pair<CNode::Fieldname, CNode>>())); } -#line 1841 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1923 "pipeline_parser_gen.cpp" break; - case 48: -#line 397 "src/mongo/db/cst/pipeline_grammar.yy" + case 61: +#line 421 "pipeline_grammar.yy" { yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = { KeyFieldname::id, YY_MOVE(yystack_[0].value.as<CNode>())}; } -#line 1849 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1931 "pipeline_parser_gen.cpp" break; - case 49: -#line 400 "src/mongo/db/cst/pipeline_grammar.yy" + case 62: +#line 424 "pipeline_grammar.yy" { yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = { YY_MOVE(yystack_[1].value.as<CNode::Fieldname>()), YY_MOVE(yystack_[0].value.as<CNode>())}; } -#line 1857 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1939 "pipeline_parser_gen.cpp" break; - case 50: -#line 406 "src/mongo/db/cst/pipeline_grammar.yy" + case 63: +#line 430 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1863 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1945 "pipeline_parser_gen.cpp" break; - case 51: -#line 410 "src/mongo/db/cst/pipeline_grammar.yy" + case 64: +#line 434 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 1869 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1951 "pipeline_parser_gen.cpp" break; - case 52: -#line 410 "src/mongo/db/cst/pipeline_grammar.yy" + case 65: +#line 434 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 1875 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1957 "pipeline_parser_gen.cpp" break; - case 53: -#line 410 "src/mongo/db/cst/pipeline_grammar.yy" + case 66: +#line 434 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 1881 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1963 "pipeline_parser_gen.cpp" break; - case 54: -#line 410 "src/mongo/db/cst/pipeline_grammar.yy" + case 67: +#line 434 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 1887 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1969 "pipeline_parser_gen.cpp" break; - case 55: -#line 414 "src/mongo/db/cst/pipeline_grammar.yy" + case 68: +#line 438 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{YY_MOVE(yystack_[0].value.as<std::string>())}; } -#line 1895 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1977 "pipeline_parser_gen.cpp" break; - case 56: -#line 422 "src/mongo/db/cst/pipeline_grammar.yy" + case 69: +#line 446 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$_internalInhibitOptimization"}; } -#line 1903 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1985 "pipeline_parser_gen.cpp" break; - case 57: -#line 425 "src/mongo/db/cst/pipeline_grammar.yy" + case 70: +#line 449 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$unionWith"}; } -#line 1911 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 1993 "pipeline_parser_gen.cpp" break; - case 58: -#line 428 "src/mongo/db/cst/pipeline_grammar.yy" + case 71: +#line 452 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$skip"}; } -#line 1919 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2001 "pipeline_parser_gen.cpp" break; - case 59: -#line 431 "src/mongo/db/cst/pipeline_grammar.yy" + case 72: +#line 455 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$limit"}; } -#line 1927 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2009 "pipeline_parser_gen.cpp" break; - case 60: -#line 434 "src/mongo/db/cst/pipeline_grammar.yy" + case 73: +#line 458 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$project"}; } -#line 1935 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2017 "pipeline_parser_gen.cpp" break; - case 61: -#line 437 "src/mongo/db/cst/pipeline_grammar.yy" + case 74: +#line 461 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$sample"}; } -#line 1943 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2025 "pipeline_parser_gen.cpp" break; - case 62: -#line 446 "src/mongo/db/cst/pipeline_grammar.yy" + case 75: +#line 470 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"coll"}; } -#line 1951 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2033 "pipeline_parser_gen.cpp" break; - case 63: -#line 449 "src/mongo/db/cst/pipeline_grammar.yy" + case 76: +#line 473 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"pipeline"}; } -#line 1959 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2041 "pipeline_parser_gen.cpp" break; - case 64: -#line 452 "src/mongo/db/cst/pipeline_grammar.yy" + case 77: +#line 476 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"size"}; } -#line 1967 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2049 "pipeline_parser_gen.cpp" break; - case 65: -#line 455 "src/mongo/db/cst/pipeline_grammar.yy" + case 78: +#line 479 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"input"}; } -#line 1975 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2057 "pipeline_parser_gen.cpp" break; - case 66: -#line 458 "src/mongo/db/cst/pipeline_grammar.yy" + case 79: +#line 482 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"to"}; } -#line 1983 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2065 "pipeline_parser_gen.cpp" break; - case 67: -#line 461 "src/mongo/db/cst/pipeline_grammar.yy" + case 80: +#line 485 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"onError"}; } -#line 1991 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2073 "pipeline_parser_gen.cpp" break; - case 68: -#line 464 "src/mongo/db/cst/pipeline_grammar.yy" + case 81: +#line 488 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"onNull"}; } -#line 1999 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2081 "pipeline_parser_gen.cpp" break; - case 69: -#line 472 "src/mongo/db/cst/pipeline_grammar.yy" + case 82: +#line 496 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$add"}; } -#line 2007 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2089 "pipeline_parser_gen.cpp" break; - case 70: -#line 475 "src/mongo/db/cst/pipeline_grammar.yy" + case 83: +#line 499 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$atan2"}; } -#line 2015 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2097 "pipeline_parser_gen.cpp" break; - case 71: -#line 478 "src/mongo/db/cst/pipeline_grammar.yy" + case 84: +#line 502 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$and"}; } -#line 2023 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2105 "pipeline_parser_gen.cpp" break; - case 72: -#line 481 "src/mongo/db/cst/pipeline_grammar.yy" + case 85: +#line 505 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$const"}; } -#line 2031 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2113 "pipeline_parser_gen.cpp" break; - case 73: -#line 484 "src/mongo/db/cst/pipeline_grammar.yy" + case 86: +#line 508 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$literal"}; } -#line 2039 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2121 "pipeline_parser_gen.cpp" break; - case 74: -#line 487 "src/mongo/db/cst/pipeline_grammar.yy" + case 87: +#line 511 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$or"}; } -#line 2047 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2129 "pipeline_parser_gen.cpp" break; - case 75: -#line 490 "src/mongo/db/cst/pipeline_grammar.yy" + case 88: +#line 514 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$not"}; } -#line 2055 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2137 "pipeline_parser_gen.cpp" break; - case 76: -#line 493 "src/mongo/db/cst/pipeline_grammar.yy" + case 89: +#line 517 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$cmp"}; } -#line 2063 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2145 "pipeline_parser_gen.cpp" break; - case 77: -#line 496 "src/mongo/db/cst/pipeline_grammar.yy" + case 90: +#line 520 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$eq"}; } -#line 2071 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2153 "pipeline_parser_gen.cpp" break; - case 78: -#line 499 "src/mongo/db/cst/pipeline_grammar.yy" + case 91: +#line 523 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$gt"}; } -#line 2079 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2161 "pipeline_parser_gen.cpp" break; - case 79: -#line 502 "src/mongo/db/cst/pipeline_grammar.yy" + case 92: +#line 526 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$gte"}; } -#line 2087 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2169 "pipeline_parser_gen.cpp" break; - case 80: -#line 505 "src/mongo/db/cst/pipeline_grammar.yy" + case 93: +#line 529 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$lt"}; } -#line 2095 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2177 "pipeline_parser_gen.cpp" break; - case 81: -#line 508 "src/mongo/db/cst/pipeline_grammar.yy" + case 94: +#line 532 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$lte"}; } -#line 2103 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2185 "pipeline_parser_gen.cpp" break; - case 82: -#line 511 "src/mongo/db/cst/pipeline_grammar.yy" + case 95: +#line 535 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$ne"}; } -#line 2111 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2193 "pipeline_parser_gen.cpp" break; - case 83: -#line 514 "src/mongo/db/cst/pipeline_grammar.yy" + case 96: +#line 538 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$convert"}; } -#line 2119 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2201 "pipeline_parser_gen.cpp" break; - case 84: -#line 517 "src/mongo/db/cst/pipeline_grammar.yy" + case 97: +#line 541 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$toBool"}; } -#line 2127 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2209 "pipeline_parser_gen.cpp" break; - case 85: -#line 520 "src/mongo/db/cst/pipeline_grammar.yy" + case 98: +#line 544 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$toDate"}; } -#line 2135 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2217 "pipeline_parser_gen.cpp" break; - case 86: -#line 523 "src/mongo/db/cst/pipeline_grammar.yy" + case 99: +#line 547 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$toDecimal"}; } -#line 2143 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2225 "pipeline_parser_gen.cpp" break; - case 87: -#line 526 "src/mongo/db/cst/pipeline_grammar.yy" + case 100: +#line 550 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$toDouble"}; } -#line 2151 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2233 "pipeline_parser_gen.cpp" break; - case 88: -#line 529 "src/mongo/db/cst/pipeline_grammar.yy" + case 101: +#line 553 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$toInt"}; } -#line 2159 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2241 "pipeline_parser_gen.cpp" break; - case 89: -#line 532 "src/mongo/db/cst/pipeline_grammar.yy" + case 102: +#line 556 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$toLong"}; } -#line 2167 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2249 "pipeline_parser_gen.cpp" break; - case 90: -#line 535 "src/mongo/db/cst/pipeline_grammar.yy" + case 103: +#line 559 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$toObjectId"}; } -#line 2175 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2257 "pipeline_parser_gen.cpp" break; - case 91: -#line 538 "src/mongo/db/cst/pipeline_grammar.yy" + case 104: +#line 562 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$toString"}; } -#line 2183 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2265 "pipeline_parser_gen.cpp" break; - case 92: -#line 541 "src/mongo/db/cst/pipeline_grammar.yy" + case 105: +#line 565 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$type"}; } -#line 2191 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2273 "pipeline_parser_gen.cpp" break; - case 93: -#line 544 "src/mongo/db/cst/pipeline_grammar.yy" + case 106: +#line 568 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$abs"}; } -#line 2199 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2281 "pipeline_parser_gen.cpp" break; - case 94: -#line 547 "src/mongo/db/cst/pipeline_grammar.yy" + case 107: +#line 571 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$ceil"}; } -#line 2207 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2289 "pipeline_parser_gen.cpp" break; - case 95: -#line 550 "src/mongo/db/cst/pipeline_grammar.yy" + case 108: +#line 574 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$divide"}; } -#line 2215 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2297 "pipeline_parser_gen.cpp" break; - case 96: -#line 553 "src/mongo/db/cst/pipeline_grammar.yy" + case 109: +#line 577 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$exp"}; } -#line 2223 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2305 "pipeline_parser_gen.cpp" break; - case 97: -#line 556 "src/mongo/db/cst/pipeline_grammar.yy" + case 110: +#line 580 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$floor"}; } -#line 2231 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2313 "pipeline_parser_gen.cpp" break; - case 98: -#line 559 "src/mongo/db/cst/pipeline_grammar.yy" + case 111: +#line 583 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$ln"}; } -#line 2239 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2321 "pipeline_parser_gen.cpp" break; - case 99: -#line 562 "src/mongo/db/cst/pipeline_grammar.yy" + case 112: +#line 586 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$log"}; } -#line 2247 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2329 "pipeline_parser_gen.cpp" break; - case 100: -#line 565 "src/mongo/db/cst/pipeline_grammar.yy" + case 113: +#line 589 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$log10"}; } -#line 2255 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2337 "pipeline_parser_gen.cpp" break; - case 101: -#line 568 "src/mongo/db/cst/pipeline_grammar.yy" + case 114: +#line 592 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$mod"}; } -#line 2263 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2345 "pipeline_parser_gen.cpp" break; - case 102: -#line 571 "src/mongo/db/cst/pipeline_grammar.yy" + case 115: +#line 595 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$multiply"}; } -#line 2271 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2353 "pipeline_parser_gen.cpp" break; - case 103: -#line 574 "src/mongo/db/cst/pipeline_grammar.yy" + case 116: +#line 598 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$pow"}; } -#line 2279 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2361 "pipeline_parser_gen.cpp" break; - case 104: -#line 577 "src/mongo/db/cst/pipeline_grammar.yy" + case 117: +#line 601 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$round"}; } -#line 2287 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2369 "pipeline_parser_gen.cpp" break; - case 105: -#line 580 "src/mongo/db/cst/pipeline_grammar.yy" + case 118: +#line 604 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$sqrt"}; } -#line 2295 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2377 "pipeline_parser_gen.cpp" break; - case 106: -#line 583 "src/mongo/db/cst/pipeline_grammar.yy" + case 119: +#line 607 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$subtract"}; } -#line 2303 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2385 "pipeline_parser_gen.cpp" break; - case 107: -#line 586 "src/mongo/db/cst/pipeline_grammar.yy" + case 120: +#line 610 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$trunc"}; } -#line 2311 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2393 "pipeline_parser_gen.cpp" break; - case 108: -#line 593 "src/mongo/db/cst/pipeline_grammar.yy" + case 121: +#line 617 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{UserString{YY_MOVE(yystack_[0].value.as<std::string>())}}; } -#line 2319 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2401 "pipeline_parser_gen.cpp" break; - case 109: -#line 599 "src/mongo/db/cst/pipeline_grammar.yy" + case 122: +#line 623 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{UserBinary{YY_MOVE(yystack_[0].value.as<BSONBinData>())}}; } -#line 2327 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2409 "pipeline_parser_gen.cpp" break; - case 110: -#line 605 "src/mongo/db/cst/pipeline_grammar.yy" + case 123: +#line 629 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{UserUndefined{}}; } -#line 2335 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2417 "pipeline_parser_gen.cpp" break; - case 111: -#line 611 "src/mongo/db/cst/pipeline_grammar.yy" + case 124: +#line 635 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{UserObjectId{}}; } -#line 2343 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2425 "pipeline_parser_gen.cpp" break; - case 112: -#line 617 "src/mongo/db/cst/pipeline_grammar.yy" + case 125: +#line 641 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{UserDate{YY_MOVE(yystack_[0].value.as<Date_t>())}}; } -#line 2351 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2433 "pipeline_parser_gen.cpp" break; - case 113: -#line 623 "src/mongo/db/cst/pipeline_grammar.yy" + case 126: +#line 647 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{UserNull{}}; } -#line 2359 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2441 "pipeline_parser_gen.cpp" break; - case 114: -#line 629 "src/mongo/db/cst/pipeline_grammar.yy" + case 127: +#line 653 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{UserRegex{YY_MOVE(yystack_[0].value.as<BSONRegEx>())}}; } -#line 2367 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2449 "pipeline_parser_gen.cpp" break; - case 115: -#line 635 "src/mongo/db/cst/pipeline_grammar.yy" + case 128: +#line 659 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{UserDBPointer{YY_MOVE(yystack_[0].value.as<BSONDBRef>())}}; } -#line 2375 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2457 "pipeline_parser_gen.cpp" break; - case 116: -#line 641 "src/mongo/db/cst/pipeline_grammar.yy" + case 129: +#line 665 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{UserJavascript{YY_MOVE(yystack_[0].value.as<BSONCode>())}}; } -#line 2383 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2465 "pipeline_parser_gen.cpp" break; - case 117: -#line 647 "src/mongo/db/cst/pipeline_grammar.yy" + case 130: +#line 671 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{UserSymbol{YY_MOVE(yystack_[0].value.as<BSONSymbol>())}}; } -#line 2391 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2473 "pipeline_parser_gen.cpp" break; - case 118: -#line 653 "src/mongo/db/cst/pipeline_grammar.yy" + case 131: +#line 677 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{UserJavascriptWithScope{ YY_MOVE(yystack_[0].value.as<BSONCodeWScope>())}}; } -#line 2399 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2481 "pipeline_parser_gen.cpp" break; - case 119: -#line 659 "src/mongo/db/cst/pipeline_grammar.yy" + case 132: +#line 683 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{UserTimestamp{YY_MOVE(yystack_[0].value.as<Timestamp>())}}; } -#line 2407 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2489 "pipeline_parser_gen.cpp" break; - case 120: -#line 665 "src/mongo/db/cst/pipeline_grammar.yy" + case 133: +#line 689 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{UserMinKey{YY_MOVE(yystack_[0].value.as<UserMinKey>())}}; } -#line 2415 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2497 "pipeline_parser_gen.cpp" break; - case 121: -#line 671 "src/mongo/db/cst/pipeline_grammar.yy" + case 134: +#line 695 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{UserMaxKey{YY_MOVE(yystack_[0].value.as<UserMaxKey>())}}; } -#line 2423 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2505 "pipeline_parser_gen.cpp" break; - case 122: -#line 677 "src/mongo/db/cst/pipeline_grammar.yy" + case 135: +#line 701 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{UserInt{YY_MOVE(yystack_[0].value.as<int>())}}; } -#line 2431 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2513 "pipeline_parser_gen.cpp" break; - case 123: -#line 680 "src/mongo/db/cst/pipeline_grammar.yy" + case 136: +#line 704 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{UserInt{0}}; } -#line 2439 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2521 "pipeline_parser_gen.cpp" break; - case 124: -#line 686 "src/mongo/db/cst/pipeline_grammar.yy" + case 137: +#line 710 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{UserLong{YY_MOVE(yystack_[0].value.as<long long>())}}; } -#line 2447 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2529 "pipeline_parser_gen.cpp" break; - case 125: -#line 689 "src/mongo/db/cst/pipeline_grammar.yy" + case 138: +#line 713 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{UserLong{0ll}}; } -#line 2455 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2537 "pipeline_parser_gen.cpp" break; - case 126: -#line 695 "src/mongo/db/cst/pipeline_grammar.yy" + case 139: +#line 719 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{UserDouble{YY_MOVE(yystack_[0].value.as<double>())}}; } -#line 2463 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2545 "pipeline_parser_gen.cpp" break; - case 127: -#line 698 "src/mongo/db/cst/pipeline_grammar.yy" + case 140: +#line 722 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{UserDouble{0.0}}; } -#line 2471 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2553 "pipeline_parser_gen.cpp" break; - case 128: -#line 704 "src/mongo/db/cst/pipeline_grammar.yy" + case 141: +#line 728 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{UserDecimal{YY_MOVE(yystack_[0].value.as<Decimal128>())}}; } -#line 2479 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2561 "pipeline_parser_gen.cpp" break; - case 129: -#line 707 "src/mongo/db/cst/pipeline_grammar.yy" + case 142: +#line 731 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{UserDecimal{0.0}}; } -#line 2487 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2569 "pipeline_parser_gen.cpp" break; - case 130: -#line 713 "src/mongo/db/cst/pipeline_grammar.yy" + case 143: +#line 737 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{UserBoolean{true}}; } -#line 2495 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2577 "pipeline_parser_gen.cpp" break; - case 131: -#line 716 "src/mongo/db/cst/pipeline_grammar.yy" + case 144: +#line 740 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{UserBoolean{false}}; } -#line 2503 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2585 "pipeline_parser_gen.cpp" break; - case 132: -#line 722 "src/mongo/db/cst/pipeline_grammar.yy" + case 145: +#line 746 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2509 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2591 "pipeline_parser_gen.cpp" break; - case 133: -#line 723 "src/mongo/db/cst/pipeline_grammar.yy" + case 146: +#line 747 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2515 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2597 "pipeline_parser_gen.cpp" break; - case 134: -#line 724 "src/mongo/db/cst/pipeline_grammar.yy" + case 147: +#line 748 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2521 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2603 "pipeline_parser_gen.cpp" break; - case 135: -#line 725 "src/mongo/db/cst/pipeline_grammar.yy" + case 148: +#line 749 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2527 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2609 "pipeline_parser_gen.cpp" break; - case 136: -#line 726 "src/mongo/db/cst/pipeline_grammar.yy" + case 149: +#line 750 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2533 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2615 "pipeline_parser_gen.cpp" break; - case 137: -#line 727 "src/mongo/db/cst/pipeline_grammar.yy" + case 150: +#line 751 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2539 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2621 "pipeline_parser_gen.cpp" break; - case 138: -#line 728 "src/mongo/db/cst/pipeline_grammar.yy" + case 151: +#line 752 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2545 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2627 "pipeline_parser_gen.cpp" break; - case 139: -#line 729 "src/mongo/db/cst/pipeline_grammar.yy" + case 152: +#line 753 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2551 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2633 "pipeline_parser_gen.cpp" break; - case 140: -#line 730 "src/mongo/db/cst/pipeline_grammar.yy" + case 153: +#line 754 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2557 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2639 "pipeline_parser_gen.cpp" break; - case 141: -#line 731 "src/mongo/db/cst/pipeline_grammar.yy" + case 154: +#line 755 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2563 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2645 "pipeline_parser_gen.cpp" break; - case 142: -#line 732 "src/mongo/db/cst/pipeline_grammar.yy" + case 155: +#line 756 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2569 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2651 "pipeline_parser_gen.cpp" break; - case 143: -#line 733 "src/mongo/db/cst/pipeline_grammar.yy" + case 156: +#line 757 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2575 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2657 "pipeline_parser_gen.cpp" break; - case 144: -#line 734 "src/mongo/db/cst/pipeline_grammar.yy" + case 157: +#line 758 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2581 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2663 "pipeline_parser_gen.cpp" break; - case 145: -#line 735 "src/mongo/db/cst/pipeline_grammar.yy" + case 158: +#line 759 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2587 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2669 "pipeline_parser_gen.cpp" break; - case 146: -#line 736 "src/mongo/db/cst/pipeline_grammar.yy" + case 159: +#line 760 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2593 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2675 "pipeline_parser_gen.cpp" break; - case 147: -#line 737 "src/mongo/db/cst/pipeline_grammar.yy" + case 160: +#line 761 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2599 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2681 "pipeline_parser_gen.cpp" break; - case 148: -#line 738 "src/mongo/db/cst/pipeline_grammar.yy" + case 161: +#line 762 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2605 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2687 "pipeline_parser_gen.cpp" break; - case 149: -#line 739 "src/mongo/db/cst/pipeline_grammar.yy" + case 162: +#line 763 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2611 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2693 "pipeline_parser_gen.cpp" break; - case 150: -#line 740 "src/mongo/db/cst/pipeline_grammar.yy" + case 163: +#line 764 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2617 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2699 "pipeline_parser_gen.cpp" break; - case 151: -#line 747 "src/mongo/db/cst/pipeline_grammar.yy" + case 164: +#line 771 "pipeline_grammar.yy" { } -#line 2623 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2705 "pipeline_parser_gen.cpp" break; - case 152: -#line 748 "src/mongo/db/cst/pipeline_grammar.yy" + case 165: +#line 772 "pipeline_grammar.yy" { yylhs.value.as<std::vector<CNode>>() = YY_MOVE(yystack_[0].value.as<std::vector<CNode>>()); yylhs.value.as<std::vector<CNode>>().emplace_back( YY_MOVE(yystack_[1].value.as<CNode>())); } -#line 2632 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2714 "pipeline_parser_gen.cpp" break; - case 153: -#line 755 "src/mongo/db/cst/pipeline_grammar.yy" + case 166: +#line 779 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2638 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2720 "pipeline_parser_gen.cpp" break; - case 154: -#line 755 "src/mongo/db/cst/pipeline_grammar.yy" + case 167: +#line 779 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2644 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2726 "pipeline_parser_gen.cpp" break; - case 155: -#line 759 "src/mongo/db/cst/pipeline_grammar.yy" + case 168: +#line 783 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ArrayChildren{YY_MOVE(yystack_[2].value.as<CNode>()), YY_MOVE(yystack_[1].value.as<CNode>())}}; } -#line 2652 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2734 "pipeline_parser_gen.cpp" break; - case 156: -#line 764 "src/mongo/db/cst/pipeline_grammar.yy" + case 169: +#line 788 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2658 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2740 "pipeline_parser_gen.cpp" break; - case 157: -#line 764 "src/mongo/db/cst/pipeline_grammar.yy" + case 170: +#line 788 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2664 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2746 "pipeline_parser_gen.cpp" break; - case 158: -#line 764 "src/mongo/db/cst/pipeline_grammar.yy" + case 171: +#line 788 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2670 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2752 "pipeline_parser_gen.cpp" break; - case 159: -#line 764 "src/mongo/db/cst/pipeline_grammar.yy" + case 172: +#line 788 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2676 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2758 "pipeline_parser_gen.cpp" break; - case 160: -#line 764 "src/mongo/db/cst/pipeline_grammar.yy" + case 173: +#line 788 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2682 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2764 "pipeline_parser_gen.cpp" break; - case 161: -#line 764 "src/mongo/db/cst/pipeline_grammar.yy" + case 174: +#line 788 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2688 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2770 "pipeline_parser_gen.cpp" break; - case 162: -#line 765 "src/mongo/db/cst/pipeline_grammar.yy" + case 175: +#line 789 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2694 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2776 "pipeline_parser_gen.cpp" break; - case 163: -#line 771 "src/mongo/db/cst/pipeline_grammar.yy" + case 176: +#line 795 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{YY_MOVE(yystack_[1].value.as<std::vector<CNode>>())}; } -#line 2702 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2784 "pipeline_parser_gen.cpp" break; - case 164: -#line 779 "src/mongo/db/cst/pipeline_grammar.yy" + case 177: +#line 803 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[1].value.as<CNode>()); } -#line 2710 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2792 "pipeline_parser_gen.cpp" break; - case 165: -#line 785 "src/mongo/db/cst/pipeline_grammar.yy" + case 178: +#line 809 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode::noopLeaf(); } -#line 2718 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2800 "pipeline_parser_gen.cpp" break; - case 166: -#line 788 "src/mongo/db/cst/pipeline_grammar.yy" + case 179: +#line 812 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[1].value.as<CNode>()); yylhs.value.as<CNode>().objectChildren().emplace_back( YY_MOVE(yystack_[0].value.as<std::pair<CNode::Fieldname, CNode>>())); } -#line 2727 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2809 "pipeline_parser_gen.cpp" break; - case 167: -#line 795 "src/mongo/db/cst/pipeline_grammar.yy" + case 180: +#line 819 "pipeline_grammar.yy" { yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = { YY_MOVE(yystack_[1].value.as<CNode::Fieldname>()), YY_MOVE(yystack_[0].value.as<CNode>())}; } -#line 2735 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2817 "pipeline_parser_gen.cpp" break; - case 168: -#line 802 "src/mongo/db/cst/pipeline_grammar.yy" + case 181: +#line 826 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 2741 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2823 "pipeline_parser_gen.cpp" break; - case 169: -#line 802 "src/mongo/db/cst/pipeline_grammar.yy" + case 182: +#line 826 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 2747 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2829 "pipeline_parser_gen.cpp" break; - case 170: -#line 802 "src/mongo/db/cst/pipeline_grammar.yy" + case 183: +#line 826 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 2753 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2835 "pipeline_parser_gen.cpp" break; - case 171: -#line 802 "src/mongo/db/cst/pipeline_grammar.yy" + case 184: +#line 826 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 2759 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2841 "pipeline_parser_gen.cpp" break; - case 172: -#line 806 "src/mongo/db/cst/pipeline_grammar.yy" + case 185: +#line 830 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"_id"}; } -#line 2767 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2849 "pipeline_parser_gen.cpp" break; - case 173: -#line 812 "src/mongo/db/cst/pipeline_grammar.yy" + case 186: +#line 836 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2773 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2855 "pipeline_parser_gen.cpp" break; - case 174: -#line 812 "src/mongo/db/cst/pipeline_grammar.yy" + case 187: +#line 836 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2779 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2861 "pipeline_parser_gen.cpp" break; - case 175: -#line 812 "src/mongo/db/cst/pipeline_grammar.yy" + case 188: +#line 836 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2785 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2867 "pipeline_parser_gen.cpp" break; - case 176: -#line 812 "src/mongo/db/cst/pipeline_grammar.yy" + case 189: +#line 836 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2791 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2873 "pipeline_parser_gen.cpp" break; - case 177: -#line 812 "src/mongo/db/cst/pipeline_grammar.yy" + case 190: +#line 836 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2797 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2879 "pipeline_parser_gen.cpp" break; - case 178: -#line 812 "src/mongo/db/cst/pipeline_grammar.yy" + case 191: +#line 836 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2803 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2885 "pipeline_parser_gen.cpp" break; - case 179: -#line 812 "src/mongo/db/cst/pipeline_grammar.yy" + case 192: +#line 836 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2809 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2891 "pipeline_parser_gen.cpp" break; - case 180: -#line 812 "src/mongo/db/cst/pipeline_grammar.yy" + case 193: +#line 836 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2815 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2897 "pipeline_parser_gen.cpp" break; - case 181: -#line 812 "src/mongo/db/cst/pipeline_grammar.yy" + case 194: +#line 836 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2821 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2903 "pipeline_parser_gen.cpp" break; - case 182: -#line 812 "src/mongo/db/cst/pipeline_grammar.yy" + case 195: +#line 836 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2827 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2909 "pipeline_parser_gen.cpp" break; - case 183: -#line 812 "src/mongo/db/cst/pipeline_grammar.yy" + case 196: +#line 836 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2833 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2915 "pipeline_parser_gen.cpp" break; - case 184: -#line 812 "src/mongo/db/cst/pipeline_grammar.yy" + case 197: +#line 836 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2839 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2921 "pipeline_parser_gen.cpp" break; - case 185: -#line 812 "src/mongo/db/cst/pipeline_grammar.yy" + case 198: +#line 836 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2845 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2927 "pipeline_parser_gen.cpp" break; - case 186: -#line 813 "src/mongo/db/cst/pipeline_grammar.yy" + case 199: +#line 837 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2851 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2933 "pipeline_parser_gen.cpp" break; - case 187: -#line 813 "src/mongo/db/cst/pipeline_grammar.yy" + case 200: +#line 837 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2857 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2939 "pipeline_parser_gen.cpp" break; - case 188: -#line 813 "src/mongo/db/cst/pipeline_grammar.yy" + case 201: +#line 837 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2863 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2945 "pipeline_parser_gen.cpp" break; - case 189: -#line 813 "src/mongo/db/cst/pipeline_grammar.yy" + case 202: +#line 837 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2869 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2951 "pipeline_parser_gen.cpp" break; - case 190: -#line 817 "src/mongo/db/cst/pipeline_grammar.yy" + case 203: +#line 841 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::add, @@ -3011,107 +3122,107 @@ int PipelineParserGen::parse() { yylhs.value.as<CNode>().objectChildren()[0].second.arrayChildren(); array.insert(array.end(), others.begin(), others.end()); } -#line 2881 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2963 "pipeline_parser_gen.cpp" break; - case 191: -#line 827 "src/mongo/db/cst/pipeline_grammar.yy" + case 204: +#line 851 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::atan2, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 2890 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2972 "pipeline_parser_gen.cpp" break; - case 192: -#line 833 "src/mongo/db/cst/pipeline_grammar.yy" + case 205: +#line 857 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::abs, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 2898 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2980 "pipeline_parser_gen.cpp" break; - case 193: -#line 838 "src/mongo/db/cst/pipeline_grammar.yy" + case 206: +#line 862 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::ceil, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 2906 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2988 "pipeline_parser_gen.cpp" break; - case 194: -#line 843 "src/mongo/db/cst/pipeline_grammar.yy" + case 207: +#line 867 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::divide, CNode{CNode::ArrayChildren{YY_MOVE(yystack_[3].value.as<CNode>()), YY_MOVE(yystack_[2].value.as<CNode>())}}}}}; } -#line 2915 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 2997 "pipeline_parser_gen.cpp" break; - case 195: -#line 849 "src/mongo/db/cst/pipeline_grammar.yy" + case 208: +#line 873 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::exponent, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 2923 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3005 "pipeline_parser_gen.cpp" break; - case 196: -#line 854 "src/mongo/db/cst/pipeline_grammar.yy" + case 209: +#line 878 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::floor, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 2931 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3013 "pipeline_parser_gen.cpp" break; - case 197: -#line 859 "src/mongo/db/cst/pipeline_grammar.yy" + case 210: +#line 883 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::ln, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 2939 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3021 "pipeline_parser_gen.cpp" break; - case 198: -#line 864 "src/mongo/db/cst/pipeline_grammar.yy" + case 211: +#line 888 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::log, CNode{CNode::ArrayChildren{YY_MOVE(yystack_[3].value.as<CNode>()), YY_MOVE(yystack_[2].value.as<CNode>())}}}}}; } -#line 2948 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3030 "pipeline_parser_gen.cpp" break; - case 199: -#line 870 "src/mongo/db/cst/pipeline_grammar.yy" + case 212: +#line 894 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::logten, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 2956 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3038 "pipeline_parser_gen.cpp" break; - case 200: -#line 875 "src/mongo/db/cst/pipeline_grammar.yy" + case 213: +#line 899 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::mod, CNode{CNode::ArrayChildren{YY_MOVE(yystack_[3].value.as<CNode>()), YY_MOVE(yystack_[2].value.as<CNode>())}}}}}; } -#line 2965 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3047 "pipeline_parser_gen.cpp" break; - case 201: -#line 881 "src/mongo/db/cst/pipeline_grammar.yy" + case 214: +#line 905 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::multiply, @@ -3122,88 +3233,88 @@ int PipelineParserGen::parse() { yylhs.value.as<CNode>().objectChildren()[0].second.arrayChildren(); array.insert(array.end(), others.begin(), others.end()); } -#line 2977 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3059 "pipeline_parser_gen.cpp" break; - case 202: -#line 890 "src/mongo/db/cst/pipeline_grammar.yy" + case 215: +#line 914 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::pow, CNode{CNode::ArrayChildren{YY_MOVE(yystack_[3].value.as<CNode>()), YY_MOVE(yystack_[2].value.as<CNode>())}}}}}; } -#line 2986 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3068 "pipeline_parser_gen.cpp" break; - case 203: -#line 896 "src/mongo/db/cst/pipeline_grammar.yy" + case 216: +#line 920 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::round, CNode{CNode::ArrayChildren{YY_MOVE(yystack_[3].value.as<CNode>()), YY_MOVE(yystack_[2].value.as<CNode>())}}}}}; } -#line 2995 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3077 "pipeline_parser_gen.cpp" break; - case 204: -#line 902 "src/mongo/db/cst/pipeline_grammar.yy" + case 217: +#line 926 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::sqrt, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3003 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3085 "pipeline_parser_gen.cpp" break; - case 205: -#line 907 "src/mongo/db/cst/pipeline_grammar.yy" + case 218: +#line 931 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::subtract, CNode{CNode::ArrayChildren{YY_MOVE(yystack_[3].value.as<CNode>()), YY_MOVE(yystack_[2].value.as<CNode>())}}}}}; } -#line 3012 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3094 "pipeline_parser_gen.cpp" break; - case 206: -#line 913 "src/mongo/db/cst/pipeline_grammar.yy" + case 219: +#line 937 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::trunc, CNode{CNode::ArrayChildren{YY_MOVE(yystack_[3].value.as<CNode>()), YY_MOVE(yystack_[2].value.as<CNode>())}}}}}; } -#line 3021 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3103 "pipeline_parser_gen.cpp" break; - case 207: -#line 919 "src/mongo/db/cst/pipeline_grammar.yy" + case 220: +#line 943 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3027 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3109 "pipeline_parser_gen.cpp" break; - case 208: -#line 919 "src/mongo/db/cst/pipeline_grammar.yy" + case 221: +#line 943 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3033 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3115 "pipeline_parser_gen.cpp" break; - case 209: -#line 919 "src/mongo/db/cst/pipeline_grammar.yy" + case 222: +#line 943 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3039 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3121 "pipeline_parser_gen.cpp" break; - case 210: -#line 923 "src/mongo/db/cst/pipeline_grammar.yy" + case 223: +#line 947 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::andExpr, @@ -3214,11 +3325,11 @@ int PipelineParserGen::parse() { yylhs.value.as<CNode>().objectChildren()[0].second.arrayChildren(); array.insert(array.end(), others.begin(), others.end()); } -#line 3051 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3133 "pipeline_parser_gen.cpp" break; - case 211: -#line 933 "src/mongo/db/cst/pipeline_grammar.yy" + case 224: +#line 957 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::orExpr, @@ -3229,472 +3340,472 @@ int PipelineParserGen::parse() { yylhs.value.as<CNode>().objectChildren()[0].second.arrayChildren(); array.insert(array.end(), others.begin(), others.end()); } -#line 3063 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3145 "pipeline_parser_gen.cpp" break; - case 212: -#line 943 "src/mongo/db/cst/pipeline_grammar.yy" + case 225: +#line 967 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::notExpr, CNode{CNode::ArrayChildren{YY_MOVE(yystack_[2].value.as<CNode>())}}}}}; } -#line 3072 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3154 "pipeline_parser_gen.cpp" break; - case 213: -#line 950 "src/mongo/db/cst/pipeline_grammar.yy" + case 226: +#line 974 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3078 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3160 "pipeline_parser_gen.cpp" break; - case 214: -#line 950 "src/mongo/db/cst/pipeline_grammar.yy" + case 227: +#line 974 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3084 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3166 "pipeline_parser_gen.cpp" break; - case 215: -#line 954 "src/mongo/db/cst/pipeline_grammar.yy" + case 228: +#line 978 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::constExpr, CNode{CNode::ArrayChildren{YY_MOVE(yystack_[2].value.as<CNode>())}}}}}; } -#line 3093 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3175 "pipeline_parser_gen.cpp" break; - case 216: -#line 961 "src/mongo/db/cst/pipeline_grammar.yy" + case 229: +#line 985 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::literal, CNode{CNode::ArrayChildren{YY_MOVE(yystack_[2].value.as<CNode>())}}}}}; } -#line 3102 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3184 "pipeline_parser_gen.cpp" break; - case 217: -#line 968 "src/mongo/db/cst/pipeline_grammar.yy" + case 230: +#line 992 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3108 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3190 "pipeline_parser_gen.cpp" break; - case 218: -#line 968 "src/mongo/db/cst/pipeline_grammar.yy" + case 231: +#line 992 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3114 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3196 "pipeline_parser_gen.cpp" break; - case 219: -#line 972 "src/mongo/db/cst/pipeline_grammar.yy" + case 232: +#line 996 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3120 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3202 "pipeline_parser_gen.cpp" break; - case 220: -#line 972 "src/mongo/db/cst/pipeline_grammar.yy" + case 233: +#line 996 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3126 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3208 "pipeline_parser_gen.cpp" break; - case 221: -#line 976 "src/mongo/db/cst/pipeline_grammar.yy" + case 234: +#line 1000 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{YY_MOVE(yystack_[1].value.as<std::vector<CNode>>())}; } -#line 3134 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3216 "pipeline_parser_gen.cpp" break; - case 222: -#line 982 "src/mongo/db/cst/pipeline_grammar.yy" + case 235: +#line 1006 "pipeline_grammar.yy" { } -#line 3140 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3222 "pipeline_parser_gen.cpp" break; - case 223: -#line 983 "src/mongo/db/cst/pipeline_grammar.yy" + case 236: +#line 1007 "pipeline_grammar.yy" { yylhs.value.as<std::vector<CNode>>() = YY_MOVE(yystack_[0].value.as<std::vector<CNode>>()); yylhs.value.as<std::vector<CNode>>().emplace_back( YY_MOVE(yystack_[1].value.as<CNode>())); } -#line 3149 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3231 "pipeline_parser_gen.cpp" break; - case 224: -#line 990 "src/mongo/db/cst/pipeline_grammar.yy" + case 237: +#line 1014 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[1].value.as<CNode>()); } -#line 3157 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3239 "pipeline_parser_gen.cpp" break; - case 225: -#line 996 "src/mongo/db/cst/pipeline_grammar.yy" + case 238: +#line 1020 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode::noopLeaf(); } -#line 3165 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3247 "pipeline_parser_gen.cpp" break; - case 226: -#line 999 "src/mongo/db/cst/pipeline_grammar.yy" + case 239: +#line 1023 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[1].value.as<CNode>()); yylhs.value.as<CNode>().objectChildren().emplace_back( YY_MOVE(yystack_[0].value.as<std::pair<CNode::Fieldname, CNode>>())); } -#line 3174 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3256 "pipeline_parser_gen.cpp" break; - case 227: -#line 1006 "src/mongo/db/cst/pipeline_grammar.yy" + case 240: +#line 1030 "pipeline_grammar.yy" { yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = { YY_MOVE(yystack_[1].value.as<CNode::Fieldname>()), YY_MOVE(yystack_[0].value.as<CNode>())}; } -#line 3182 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3264 "pipeline_parser_gen.cpp" break; - case 228: -#line 1013 "src/mongo/db/cst/pipeline_grammar.yy" + case 241: +#line 1037 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 3188 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3270 "pipeline_parser_gen.cpp" break; - case 229: -#line 1014 "src/mongo/db/cst/pipeline_grammar.yy" + case 242: +#line 1038 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 3194 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3276 "pipeline_parser_gen.cpp" break; - case 230: -#line 1015 "src/mongo/db/cst/pipeline_grammar.yy" + case 243: +#line 1039 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 3200 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3282 "pipeline_parser_gen.cpp" break; - case 231: -#line 1016 "src/mongo/db/cst/pipeline_grammar.yy" + case 244: +#line 1040 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 3206 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3288 "pipeline_parser_gen.cpp" break; - case 232: -#line 1017 "src/mongo/db/cst/pipeline_grammar.yy" + case 245: +#line 1041 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 3212 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3294 "pipeline_parser_gen.cpp" break; - case 233: -#line 1020 "src/mongo/db/cst/pipeline_grammar.yy" + case 246: +#line 1044 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3218 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3300 "pipeline_parser_gen.cpp" break; - case 234: -#line 1020 "src/mongo/db/cst/pipeline_grammar.yy" + case 247: +#line 1044 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3224 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3306 "pipeline_parser_gen.cpp" break; - case 235: -#line 1020 "src/mongo/db/cst/pipeline_grammar.yy" + case 248: +#line 1044 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3230 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3312 "pipeline_parser_gen.cpp" break; - case 236: -#line 1020 "src/mongo/db/cst/pipeline_grammar.yy" + case 249: +#line 1044 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3236 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3318 "pipeline_parser_gen.cpp" break; - case 237: -#line 1020 "src/mongo/db/cst/pipeline_grammar.yy" + case 250: +#line 1044 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3242 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3324 "pipeline_parser_gen.cpp" break; - case 238: -#line 1020 "src/mongo/db/cst/pipeline_grammar.yy" + case 251: +#line 1044 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3248 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3330 "pipeline_parser_gen.cpp" break; - case 239: -#line 1020 "src/mongo/db/cst/pipeline_grammar.yy" + case 252: +#line 1044 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3254 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3336 "pipeline_parser_gen.cpp" break; - case 240: -#line 1022 "src/mongo/db/cst/pipeline_grammar.yy" + case 253: +#line 1046 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::cmp, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3263 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3345 "pipeline_parser_gen.cpp" break; - case 241: -#line 1027 "src/mongo/db/cst/pipeline_grammar.yy" + case 254: +#line 1051 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::eq, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3272 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3354 "pipeline_parser_gen.cpp" break; - case 242: -#line 1032 "src/mongo/db/cst/pipeline_grammar.yy" + case 255: +#line 1056 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::gt, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3281 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3363 "pipeline_parser_gen.cpp" break; - case 243: -#line 1037 "src/mongo/db/cst/pipeline_grammar.yy" + case 256: +#line 1061 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::gte, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3290 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3372 "pipeline_parser_gen.cpp" break; - case 244: -#line 1042 "src/mongo/db/cst/pipeline_grammar.yy" + case 257: +#line 1066 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::lt, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3299 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3381 "pipeline_parser_gen.cpp" break; - case 245: -#line 1047 "src/mongo/db/cst/pipeline_grammar.yy" + case 258: +#line 1071 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::lte, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3308 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3390 "pipeline_parser_gen.cpp" break; - case 246: -#line 1052 "src/mongo/db/cst/pipeline_grammar.yy" + case 259: +#line 1076 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::ne, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3317 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3399 "pipeline_parser_gen.cpp" break; - case 247: -#line 1058 "src/mongo/db/cst/pipeline_grammar.yy" + case 260: +#line 1082 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3323 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3405 "pipeline_parser_gen.cpp" break; - case 248: -#line 1059 "src/mongo/db/cst/pipeline_grammar.yy" + case 261: +#line 1083 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3329 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3411 "pipeline_parser_gen.cpp" break; - case 249: -#line 1060 "src/mongo/db/cst/pipeline_grammar.yy" + case 262: +#line 1084 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3335 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3417 "pipeline_parser_gen.cpp" break; - case 250: -#line 1061 "src/mongo/db/cst/pipeline_grammar.yy" + case 263: +#line 1085 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3341 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3423 "pipeline_parser_gen.cpp" break; - case 251: -#line 1062 "src/mongo/db/cst/pipeline_grammar.yy" + case 264: +#line 1086 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3347 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3429 "pipeline_parser_gen.cpp" break; - case 252: -#line 1063 "src/mongo/db/cst/pipeline_grammar.yy" + case 265: +#line 1087 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3353 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3435 "pipeline_parser_gen.cpp" break; - case 253: -#line 1064 "src/mongo/db/cst/pipeline_grammar.yy" + case 266: +#line 1088 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3359 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3441 "pipeline_parser_gen.cpp" break; - case 254: -#line 1065 "src/mongo/db/cst/pipeline_grammar.yy" + case 267: +#line 1089 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3365 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3447 "pipeline_parser_gen.cpp" break; - case 255: -#line 1066 "src/mongo/db/cst/pipeline_grammar.yy" + case 268: +#line 1090 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3371 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3453 "pipeline_parser_gen.cpp" break; - case 256: -#line 1067 "src/mongo/db/cst/pipeline_grammar.yy" + case 269: +#line 1091 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3377 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3459 "pipeline_parser_gen.cpp" break; - case 257: -#line 1073 "src/mongo/db/cst/pipeline_grammar.yy" + case 270: +#line 1097 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3383 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3465 "pipeline_parser_gen.cpp" break; - case 258: -#line 1073 "src/mongo/db/cst/pipeline_grammar.yy" + case 271: +#line 1097 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3389 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3471 "pipeline_parser_gen.cpp" break; - case 259: -#line 1073 "src/mongo/db/cst/pipeline_grammar.yy" + case 272: +#line 1097 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3395 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3477 "pipeline_parser_gen.cpp" break; - case 260: -#line 1073 "src/mongo/db/cst/pipeline_grammar.yy" + case 273: +#line 1097 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3401 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3483 "pipeline_parser_gen.cpp" break; - case 261: -#line 1073 "src/mongo/db/cst/pipeline_grammar.yy" + case 274: +#line 1097 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3407 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3489 "pipeline_parser_gen.cpp" break; - case 262: -#line 1077 "src/mongo/db/cst/pipeline_grammar.yy" + case 275: +#line 1101 "pipeline_grammar.yy" { yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = std::pair{KeyFieldname::onErrorArg, CNode{KeyValue::absentKey}}; } -#line 3415 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3497 "pipeline_parser_gen.cpp" break; - case 263: -#line 1080 "src/mongo/db/cst/pipeline_grammar.yy" + case 276: +#line 1104 "pipeline_grammar.yy" { yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = std::pair{ KeyFieldname::onErrorArg, YY_MOVE(yystack_[0].value.as<CNode>())}; } -#line 3423 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3505 "pipeline_parser_gen.cpp" break; - case 264: -#line 1087 "src/mongo/db/cst/pipeline_grammar.yy" + case 277: +#line 1111 "pipeline_grammar.yy" { yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = std::pair{KeyFieldname::onNullArg, CNode{KeyValue::absentKey}}; } -#line 3431 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3513 "pipeline_parser_gen.cpp" break; - case 265: -#line 1090 "src/mongo/db/cst/pipeline_grammar.yy" + case 278: +#line 1114 "pipeline_grammar.yy" { yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = std::pair{ KeyFieldname::onNullArg, YY_MOVE(yystack_[0].value.as<CNode>())}; } -#line 3439 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3521 "pipeline_parser_gen.cpp" break; - case 266: -#line 1096 "src/mongo/db/cst/pipeline_grammar.yy" + case 279: +#line 1120 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::convert, @@ -3706,92 +3817,92 @@ int PipelineParserGen::parse() { YY_MOVE(yystack_[2] .value.as<std::pair<CNode::Fieldname, CNode>>())}}}}}; } -#line 3450 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3532 "pipeline_parser_gen.cpp" break; - case 267: -#line 1105 "src/mongo/db/cst/pipeline_grammar.yy" + case 280: +#line 1129 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::toBool, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3458 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3540 "pipeline_parser_gen.cpp" break; - case 268: -#line 1110 "src/mongo/db/cst/pipeline_grammar.yy" + case 281: +#line 1134 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::toDate, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3466 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3548 "pipeline_parser_gen.cpp" break; - case 269: -#line 1115 "src/mongo/db/cst/pipeline_grammar.yy" + case 282: +#line 1139 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::toDecimal, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3474 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3556 "pipeline_parser_gen.cpp" break; - case 270: -#line 1120 "src/mongo/db/cst/pipeline_grammar.yy" + case 283: +#line 1144 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::toDouble, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3482 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3564 "pipeline_parser_gen.cpp" break; - case 271: -#line 1125 "src/mongo/db/cst/pipeline_grammar.yy" + case 284: +#line 1149 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::toInt, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3490 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3572 "pipeline_parser_gen.cpp" break; - case 272: -#line 1130 "src/mongo/db/cst/pipeline_grammar.yy" + case 285: +#line 1154 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::toLong, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3498 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3580 "pipeline_parser_gen.cpp" break; - case 273: -#line 1135 "src/mongo/db/cst/pipeline_grammar.yy" + case 286: +#line 1159 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::toObjectId, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3506 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3588 "pipeline_parser_gen.cpp" break; - case 274: -#line 1140 "src/mongo/db/cst/pipeline_grammar.yy" + case 287: +#line 1164 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::toString, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3514 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3596 "pipeline_parser_gen.cpp" break; - case 275: -#line 1145 "src/mongo/db/cst/pipeline_grammar.yy" + case 288: +#line 1169 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::type, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3522 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3604 "pipeline_parser_gen.cpp" break; -#line 3526 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 3608 "pipeline_parser_gen.cpp" default: break; @@ -3920,8 +4031,8 @@ int PipelineParserGen::parse() { | yyreturn -- parsing is finished, return the result. | `-----------------------------------------------------*/ yyreturn: - if (!yyla.empty()) // NOLINT(bugprone-use-after-move) - yy_destroy_("Cleanup: discarding lookahead", yyla); // NOLINT(bugprone-use-after-move) + if (!yyla.empty()) + yy_destroy_("Cleanup: discarding lookahead", yyla); /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ @@ -3955,153 +4066,158 @@ void PipelineParserGen::error(const syntax_error& yyexc) { error(yyexc.location, yyexc.what()); } +#if YYDEBUG || 0 +const char* PipelineParserGen::symbol_name(symbol_kind_type yysymbol) { + return yytname_[yysymbol]; +} +#endif // #if YYDEBUG || 0 -const short PipelineParserGen::yypact_ninf_ = -274; + +const short PipelineParserGen::yypact_ninf_ = -278; const signed char PipelineParserGen::yytable_ninf_ = -1; const short PipelineParserGen::yypact_[] = { - -64, 13, 44, 51, 50, -274, -274, -274, -274, 166, 48, 292, 52, 81, 53, 55, - 81, -274, 57, -274, -274, -274, -274, -274, -274, -274, -274, 165, -274, -274, -274, -274, - -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, - -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, - -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, - -274, -274, 165, -274, -274, -274, -274, 59, -274, -274, -274, -274, -274, -274, -274, -274, - -274, -274, -274, -274, -274, -274, 37, -274, 45, 61, 50, -274, 165, -274, -274, -274, - -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, - -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, - -274, -274, -274, -274, -274, -274, -274, -274, 392, 81, 1, -274, -274, 455, 165, 64, - -274, 124, 124, -274, -274, -274, -274, -274, 67, 54, -274, -274, -274, -274, -274, -274, - -274, 165, -274, -274, -274, 562, 211, -274, -274, -274, -274, -274, -274, -274, -274, -274, - -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, - -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, - -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, - -274, -274, -274, -274, 3, -274, 69, 71, 72, 73, 75, 76, 77, 71, 71, 71, - 71, 71, 71, 71, -274, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, - 78, 211, 211, 211, 80, 211, 82, 89, 90, 91, 211, 93, 98, 518, -274, 211, - -274, 100, 104, 211, 211, 106, 211, 165, 165, 211, 211, 108, 109, 111, 114, 117, - 119, 120, 24, 121, 122, 126, 135, 140, 154, 156, 160, 161, 162, 163, 211, 167, - 168, 175, 211, 182, 211, 211, 211, 211, 183, 211, 211, -274, 211, -274, -274, -274, - -274, -274, -274, -274, -274, 211, 211, -274, 211, 190, 193, 211, 194, -274, -274, -274, - -274, -274, -274, -274, 211, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, - 211, -274, -274, -274, 211, -274, 211, 211, 211, 211, -274, 211, 211, -274, 211, 195, - 211, 185, 186, 211, 199, 65, 201, 202, 204, 211, 205, 206, 209, 212, 219, -274, - 220, -274, -274, 221, -274, 184, 213, 224, 225, 244, 226, 248, 249, 250, 251, 252, - 253, -274, -274, -274, -274, -274, 105, -274, -274, -274, 254, -274, -274, -274, -274, -274, - -274, -274, 211, 123, -274, -274, 211, 256, -274, 257, -274}; + -64, 30, 44, 55, 58, -278, -278, -278, -278, 66, 57, 405, 65, 124, 75, 89, + 124, -278, 92, -278, -278, -278, -278, -278, -278, -278, -278, 158, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, 158, -278, -278, -278, -278, 94, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, 81, -278, 86, 111, 58, -278, 158, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, 468, 124, 48, -278, -278, 531, 158, 115, + -278, 178, 178, -278, -278, -278, -278, -278, 120, 109, -278, -278, -278, -278, -278, -278, + -278, 158, -278, -278, -278, 332, 265, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, 10, -278, 131, 132, 134, 139, 140, 148, 151, 132, 132, 132, 132, 132, 132, + 132, -278, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 265, 157, 265, 265, + 265, 159, 265, 160, 167, 168, 169, 265, 170, 171, 288, -278, 265, -278, 172, 173, + 265, 265, 175, 265, 158, 158, 265, 265, 176, 181, 188, 189, 190, 192, 196, 141, + 197, 203, 204, 208, 210, 211, 212, 213, 214, 215, 216, 265, 217, 218, 219, 265, + 220, 265, 265, 265, 265, 239, 265, 265, -278, 265, -278, -278, -278, -278, -278, -278, + -278, -278, 265, 265, -278, 265, 257, 258, 265, 259, -278, -278, -278, -278, -278, -278, + -278, 265, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, 265, -278, -278, + -278, 265, -278, 265, 265, 265, 265, -278, 265, 265, -278, 265, 260, 265, 263, 267, + 265, 275, 119, 274, 276, 277, 265, 278, 279, 280, 281, 284, -278, 285, -278, -278, + 287, -278, 117, 290, 292, 293, 294, 295, 297, 307, 308, 309, 310, 311, -278, -278, + -278, -278, -278, 205, -278, -278, -278, 312, -278, -278, -278, -278, -278, -278, -278, 265, + 233, -278, -278, 265, 313, -278, 314, -278}; const short PipelineParserGen::yydefact_[] = { - 0, 0, 0, 0, 5, 2, 46, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, - 9, 10, 11, 12, 13, 14, 4, 45, 0, 56, 59, 60, 61, 58, 57, 62, 63, 64, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 65, 66, 67, 68, 55, 52, 0, 53, 54, 51, 47, 0, 123, 125, 127, 129, 122, 124, 126, - 128, 18, 19, 20, 21, 23, 25, 0, 22, 0, 0, 5, 225, 222, 130, 131, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 139, 140, 141, 142, 143, 148, 144, 145, - 146, 149, 150, 50, 132, 133, 134, 135, 147, 136, 137, 138, 217, 218, 219, 220, 48, 49, 16, - 0, 0, 0, 8, 6, 0, 222, 0, 24, 0, 0, 42, 43, 44, 41, 26, 0, 0, 224, - 172, 229, 230, 231, 228, 232, 0, 226, 223, 221, 165, 151, 31, 33, 35, 37, 38, 39, 30, - 32, 34, 36, 29, 27, 40, 156, 157, 158, 173, 174, 159, 207, 208, 209, 160, 213, 214, 161, - 233, 234, 235, 236, 237, 238, 239, 162, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 28, 15, 0, 227, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 5, 2, 59, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, + 9, 10, 11, 12, 13, 14, 4, 58, 0, 69, 72, 73, 74, 71, 70, 75, 76, 77, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 78, 79, 80, 81, 68, 65, 0, 66, 67, 64, 60, 0, 136, 138, 140, 142, 135, 137, 139, + 141, 18, 19, 20, 21, 23, 25, 0, 22, 0, 0, 5, 238, 235, 143, 144, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 152, 153, 154, 155, 156, 161, 157, 158, + 159, 162, 163, 63, 145, 146, 147, 148, 160, 149, 150, 151, 230, 231, 232, 233, 61, 62, 16, + 0, 0, 0, 8, 6, 0, 235, 0, 24, 0, 0, 55, 56, 57, 54, 26, 0, 0, 237, + 185, 242, 243, 244, 241, 245, 0, 239, 236, 234, 178, 164, 41, 43, 45, 47, 48, 49, 40, + 42, 44, 46, 36, 37, 38, 39, 50, 51, 52, 29, 30, 31, 32, 33, 34, 35, 27, 53, + 169, 170, 171, 186, 187, 172, 220, 221, 222, 173, 226, 227, 174, 246, 247, 248, 249, 250, 251, + 252, 175, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 28, 15, 0, 240, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 166, 164, 167, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 153, 151, 154, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 164, 0, 169, 170, 168, 171, 166, 152, 163, 17, 0, - 0, 191, 0, 0, 0, 0, 0, 240, 241, 242, 243, 244, 245, 246, 0, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 192, 193, 0, 195, 196, 197, 0, 199, 0, 0, 0, 0, 204, 0, - 0, 167, 151, 0, 151, 0, 0, 151, 0, 0, 0, 0, 0, 151, 0, 0, 0, 0, 0, - 155, 0, 215, 216, 0, 212, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 258, - 259, 260, 261, 257, 262, 194, 198, 200, 0, 202, 203, 205, 206, 190, 210, 211, 0, 264, 201, - 263, 0, 0, 265, 0, 266}; + 0, 0, 177, 0, 182, 183, 181, 184, 179, 165, 176, 17, 0, 0, 204, 0, 0, 0, 0, + 0, 253, 254, 255, 256, 257, 258, 259, 0, 280, 281, 282, 283, 284, 285, 286, 287, 288, 205, + 206, 0, 208, 209, 210, 0, 212, 0, 0, 0, 0, 217, 0, 0, 180, 164, 0, 164, 0, + 0, 164, 0, 0, 0, 0, 0, 164, 0, 0, 0, 0, 0, 168, 0, 228, 229, 0, 225, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 271, 272, 273, 274, 270, 275, 207, + 211, 213, 0, 215, 216, 218, 219, 203, 223, 224, 0, 277, 214, 276, 0, 0, 278, 0, 279}; const short PipelineParserGen::yypgoto_[] = { - -274, -274, -274, -140, -274, -132, -133, -129, -22, -274, -274, -274, -274, -274, -274, -274, - -274, -274, -12, -274, -11, -13, -7, -274, -274, -98, -146, -274, -274, -274, -274, -274, - -274, -274, -20, -274, -274, -274, -274, 164, -274, -274, -274, -274, -274, -274, -274, -274, - 107, -5, -225, -135, -224, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, - -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, - -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, - -274, -274, -274, -274, -274, -274, -274, -273, 110, -274, -274, 189, -274, -274, 7, -274}; + -278, -278, -278, -140, -278, -139, -101, -138, -17, -278, -278, -278, -278, -278, -130, -128, + -108, -103, -12, -97, -11, -13, -7, -91, -87, -98, -146, -85, -75, -72, -278, -67, + -53, -51, -20, -278, -278, -278, -278, 221, -278, -278, -278, -278, -278, -278, -278, -278, + 161, -5, -238, -49, -242, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, -278, + -278, -278, -278, -278, -278, -278, -278, -277, 162, -278, -278, 237, -278, -278, 49, -278}; const short PipelineParserGen::yydefgoto_[] = { - -1, 162, 332, 81, 82, 83, 84, 85, 176, 177, 167, 337, 178, 86, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 286, 146, 147, 148, - 157, 10, 18, 19, 20, 21, 22, 23, 24, 152, 194, 100, 287, 288, 293, 196, 197, 285, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 422, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, - 236, 237, 238, 239, 240, 241, 435, 439, 289, 159, 7, 11, 149, 3, 5, 104, 105}; + -1, 162, 345, 81, 82, 83, 84, 85, 176, 177, 167, 350, 178, 86, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 299, 146, 147, 148, + 157, 10, 18, 19, 20, 21, 22, 23, 24, 152, 207, 100, 300, 301, 306, 209, 210, 298, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 435, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 448, 452, 302, 159, 7, 11, 149, 3, 5, 104, 105}; const short PipelineParserGen::yytable_[] = { - 98, 96, 97, 98, 96, 97, 99, 145, 169, 99, 158, 103, 163, 90, 338, 193, 193, 172, 4, - 165, 164, 1, 2, 166, 174, 173, 195, 195, 175, 299, 300, 301, 302, 303, 304, 305, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 6, 319, 320, 321, 8, 323, 9, 25, 87, 101, - 328, 102, 153, 158, 106, 145, 151, 155, 154, 341, 342, 111, 344, 180, 243, 347, 348, 291, 244, - 292, 294, 295, 245, 296, 297, 298, 318, 94, 322, 356, 324, 145, 88, 89, 90, 91, 368, 325, - 326, 327, 372, 329, 374, 375, 376, 377, 330, 379, 380, 339, 381, 340, 398, 343, 400, 349, 350, - 403, 351, 382, 383, 352, 384, 409, 353, 387, 354, 355, 357, 358, 181, 405, 182, 359, 389, 183, - 184, 185, 186, 187, 188, 145, 360, 98, 96, 97, 390, 361, 333, 99, 391, 168, 392, 393, 394, - 395, 334, 396, 397, 335, 145, 362, 92, 363, 93, 94, 95, 364, 365, 366, 367, 107, 434, 108, - 369, 370, 88, 89, 90, 91, 109, 110, 371, 12, 13, 14, 15, 16, 17, 373, 378, 438, 401, - 402, 111, 88, 89, 90, 91, 385, 345, 346, 386, 388, 399, 189, 404, 190, 191, 192, 406, 407, - 437, 408, 410, 411, 440, 181, 412, 182, 423, 413, 88, 89, 90, 91, 109, 110, 414, 415, 416, - 424, 425, 427, 290, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 92, 122, 93, 94, - 95, 123, 124, 426, 111, 428, 429, 430, 431, 432, 433, 436, 421, 441, 442, 92, 336, 93, 94, - 95, 306, 179, 242, 156, 150, 0, 0, 0, 145, 145, 0, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 92, 122, 93, 94, 95, 123, 124, 26, 0, 0, 27, 0, 0, 0, 0, - 0, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 419, 417, 418, 0, 160, 0, 420, + 98, 96, 97, 98, 96, 97, 99, 145, 169, 99, 158, 103, 163, 164, 166, 200, 200, 172, 173, + 175, 90, 1, 2, 351, 312, 313, 314, 315, 316, 317, 318, 193, 193, 194, 194, 4, 320, 321, + 322, 323, 324, 325, 326, 327, 328, 329, 330, 6, 332, 333, 334, 165, 336, 195, 195, 8, 174, + 341, 196, 196, 158, 9, 145, 25, 197, 197, 354, 355, 87, 357, 198, 198, 360, 361, 199, 199, + 201, 201, 101, 258, 12, 13, 14, 15, 16, 17, 202, 202, 145, 203, 203, 94, 102, 381, 204, + 204, 106, 385, 151, 387, 388, 389, 390, 153, 392, 393, 154, 394, 205, 205, 206, 206, 208, 208, + 155, 111, 395, 396, 411, 397, 413, 180, 400, 416, 256, 88, 89, 90, 91, 422, 257, 402, 88, + 89, 90, 91, 304, 305, 145, 307, 98, 96, 97, 403, 308, 309, 99, 404, 168, 405, 406, 407, + 408, 310, 409, 410, 311, 145, 346, 347, 348, 107, 331, 108, 335, 337, 88, 89, 90, 91, 109, + 110, 338, 339, 340, 342, 343, 353, 352, 356, 362, 181, 418, 182, 111, 363, 183, 184, 185, 186, + 187, 188, 364, 365, 366, 92, 367, 93, 94, 95, 368, 370, 92, 369, 93, 94, 95, 371, 372, + 450, 358, 359, 373, 453, 374, 375, 376, 377, 378, 379, 380, 382, 383, 384, 386, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 92, 122, 93, 94, 95, 123, 124, 391, 303, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 189, 122, 190, 191, 192, 123, 124, 398, 399, 401, + 412, 414, 181, 447, 182, 415, 434, 88, 89, 90, 91, 109, 110, 417, 419, 349, 420, 421, 423, + 424, 425, 426, 145, 145, 427, 428, 344, 429, 436, 171, 437, 438, 451, 440, 439, 441, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 442, 443, 444, 445, 446, 449, 454, 455, 150, 179, 0, 319, + 255, 0, 0, 0, 156, 0, 0, 0, 0, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 92, 122, 93, 94, 95, 123, 124, 76, 77, 78, 79, 80, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 432, 430, 431, 0, 26, 0, 433, 27, 0, 0, 0, 0, 0, + 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 160, 0, 0, 161, 0, 0, 0, 0, 0, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 170, 0, 0, 171, 0, 0, 0, 0, 0, 0, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 331, 0, 0, 171, 0, 0, 0, 0, 0, 0, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 77, 78, 79, 80, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284}; + 72, 73, 74, 75, 76, 77, 78, 79, 80}; const short PipelineParserGen::yycheck_[] = { - 13, 13, 13, 16, 16, 16, 13, 27, 154, 16, 108, 16, 152, 10, 287, 161, 162, 157, 5, - 152, 152, 85, 86, 152, 157, 157, 161, 162, 157, 253, 254, 255, 256, 257, 258, 259, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 3, 273, 274, 275, 0, 277, 3, 6, 3, 3, - 282, 3, 22, 158, 4, 82, 4, 3, 20, 291, 292, 67, 294, 6, 4, 297, 298, 5, 21, - 5, 5, 5, 177, 5, 5, 5, 5, 81, 5, 62, 5, 108, 8, 9, 10, 11, 318, 5, - 5, 5, 322, 5, 324, 325, 326, 327, 5, 329, 330, 6, 332, 4, 382, 4, 384, 4, 4, - 387, 4, 341, 342, 4, 344, 393, 4, 347, 4, 4, 4, 4, 3, 63, 5, 4, 356, 8, - 9, 10, 11, 12, 13, 158, 4, 153, 153, 153, 368, 4, 285, 153, 372, 153, 374, 375, 376, - 377, 285, 379, 380, 285, 177, 4, 78, 4, 80, 81, 82, 4, 4, 4, 4, 3, 64, 5, - 4, 4, 8, 9, 10, 11, 12, 13, 4, 14, 15, 16, 17, 18, 19, 4, 4, 65, 4, - 4, 67, 8, 9, 10, 11, 6, 295, 296, 6, 6, 6, 78, 4, 80, 81, 82, 6, 6, - 434, 6, 6, 6, 438, 3, 6, 5, 4, 6, 8, 9, 10, 11, 12, 13, 6, 6, 6, - 4, 4, 4, 244, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 6, 67, 4, 4, 4, 4, 4, 4, 4, 405, 4, 4, 78, 285, 80, 81, - 82, 260, 158, 162, 106, 82, -1, -1, -1, 295, 296, -1, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 4, -1, -1, 7, -1, -1, -1, -1, - -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 405, 405, 405, -1, 4, -1, 405, + 13, 13, 13, 16, 16, 16, 13, 27, 154, 16, 108, 16, 152, 152, 152, 161, 162, 157, 157, + 157, 10, 85, 86, 300, 266, 267, 268, 269, 270, 271, 272, 161, 162, 161, 162, 5, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 3, 286, 287, 288, 152, 290, 161, 162, 0, 157, + 295, 161, 162, 158, 3, 82, 6, 161, 162, 304, 305, 3, 307, 161, 162, 310, 311, 161, 162, + 161, 162, 3, 177, 14, 15, 16, 17, 18, 19, 161, 162, 108, 161, 162, 81, 3, 331, 161, + 162, 4, 335, 4, 337, 338, 339, 340, 22, 342, 343, 20, 345, 161, 162, 161, 162, 161, 162, + 3, 67, 354, 355, 395, 357, 397, 6, 360, 400, 4, 8, 9, 10, 11, 406, 21, 369, 8, + 9, 10, 11, 5, 5, 158, 5, 153, 153, 153, 381, 5, 5, 153, 385, 153, 387, 388, 389, + 390, 5, 392, 393, 5, 177, 298, 298, 298, 3, 5, 5, 5, 5, 8, 9, 10, 11, 12, + 13, 5, 5, 5, 5, 5, 4, 6, 4, 4, 3, 63, 5, 67, 4, 8, 9, 10, 11, + 12, 13, 4, 4, 4, 78, 4, 80, 81, 82, 4, 4, 78, 62, 80, 81, 82, 4, 4, + 447, 308, 309, 4, 451, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 4, 257, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 6, 6, 6, + 6, 4, 3, 64, 5, 4, 418, 8, 9, 10, 11, 12, 13, 4, 6, 298, 6, 6, 6, + 6, 6, 6, 308, 309, 6, 6, 4, 6, 4, 7, 4, 4, 65, 4, 6, 4, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 4, 4, 4, 4, 4, 4, 4, 4, 82, 158, -1, 273, + 162, -1, -1, -1, 106, -1, -1, -1, -1, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 62, 63, 64, 65, 66, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 418, 418, 418, -1, 4, -1, 418, 7, -1, -1, -1, -1, -1, + -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 4, -1, -1, 7, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 4, -1, -1, 7, -1, -1, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 4, -1, -1, 7, -1, -1, -1, -1, -1, -1, - 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, 63, 64, 65, 66, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61}; + 58, 59, 60, 61, 62, 63, 64, 65, 66}; const unsigned char PipelineParserGen::yystos_[] = { 0, 85, 86, 195, 5, 196, 3, 192, 0, 3, 126, 193, 14, 15, 16, 17, 18, 19, 127, @@ -4114,47 +4230,49 @@ const unsigned char PipelineParserGen::yystos_[] = { 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 194, 194, 4, 134, 22, 20, 3, 126, 125, 112, 191, 4, 7, 88, 90, 92, 93, 94, 97, 136, 113, 4, 7, 90, 92, 93, 94, 95, 96, 99, 191, 6, 3, 5, 8, 9, 10, 11, 12, 13, 78, - 80, 81, 82, 113, 135, 138, 140, 141, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 135, 4, 21, 112, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 142, 121, 137, 138, 190, 108, 5, 5, 139, 5, 5, 5, 5, 5, 139, 139, 139, 139, 139, - 139, 139, 197, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 5, 137, 137, 137, 5, - 137, 5, 5, 5, 5, 137, 5, 5, 4, 89, 90, 92, 94, 95, 98, 190, 6, 4, 137, - 137, 4, 137, 112, 112, 137, 137, 4, 4, 4, 4, 4, 4, 4, 62, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 137, 4, 4, 4, 137, 4, 137, 137, 137, 137, 4, 137, - 137, 137, 137, 137, 137, 6, 6, 137, 6, 137, 137, 137, 137, 137, 137, 137, 137, 137, 190, - 6, 190, 4, 4, 190, 4, 63, 6, 6, 6, 190, 6, 6, 6, 6, 6, 6, 6, 105, - 107, 108, 109, 113, 162, 4, 4, 4, 6, 4, 4, 4, 4, 4, 4, 4, 64, 188, 4, - 137, 65, 189, 137, 4, 4}; + 80, 81, 82, 101, 102, 103, 104, 106, 110, 111, 113, 114, 115, 116, 118, 119, 120, 135, 138, + 140, 141, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 135, 4, 21, 112, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 142, 121, 137, 138, 190, 108, + 5, 5, 139, 5, 5, 5, 5, 5, 139, 139, 139, 139, 139, 139, 139, 197, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 5, 137, 137, 137, 5, 137, 5, 5, 5, 5, 137, + 5, 5, 4, 89, 90, 92, 94, 95, 98, 190, 6, 4, 137, 137, 4, 137, 112, 112, 137, + 137, 4, 4, 4, 4, 4, 4, 4, 62, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 137, 4, 4, 4, 137, 4, 137, 137, 137, 137, 4, 137, 137, 137, 137, 137, 137, 6, + 6, 137, 6, 137, 137, 137, 137, 137, 137, 137, 137, 137, 190, 6, 190, 4, 4, 190, 4, + 63, 6, 6, 6, 190, 6, 6, 6, 6, 6, 6, 6, 105, 107, 108, 109, 113, 162, 4, + 4, 4, 6, 4, 4, 4, 4, 4, 4, 4, 64, 188, 4, 137, 65, 189, 137, 4, 4}; const unsigned char PipelineParserGen::yyr1_[] = { 0, 87, 195, 195, 196, 126, 126, 198, 197, 127, 127, 127, 127, 127, 127, 133, 128, 129, 136, 136, 136, 136, 130, 131, 132, 134, 134, 97, 97, 135, 135, 135, 135, 135, 135, 135, 135, 135, - 135, 135, 135, 88, 88, 88, 88, 192, 193, 193, 100, 100, 194, 91, 91, 91, 91, 94, 90, - 90, 90, 90, 90, 90, 92, 92, 92, 92, 92, 92, 92, 93, 93, 93, 93, 93, 93, 93, + 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 88, 88, 88, + 88, 192, 193, 193, 100, 100, 194, 91, 91, 91, 91, 94, 90, 90, 90, 90, 90, 90, 92, + 92, 92, 92, 92, 92, 92, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, - 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 113, 114, 115, 116, 118, 119, - 120, 101, 102, 103, 104, 106, 110, 111, 105, 105, 107, 107, 108, 108, 109, 109, 117, 117, 121, - 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 190, - 190, 137, 137, 139, 138, 138, 138, 138, 138, 138, 138, 140, 141, 142, 142, 98, 89, 89, 89, - 89, 95, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, - 144, 145, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 146, 146, - 146, 147, 148, 149, 150, 150, 151, 152, 112, 112, 122, 122, 123, 191, 191, 124, 125, 125, 99, - 96, 96, 96, 96, 96, 153, 153, 153, 153, 153, 153, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 162, 162, 162, 162, 162, 188, 188, 189, 189, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172}; + 93, 93, 93, 93, 93, 93, 93, 113, 114, 115, 116, 118, 119, 120, 101, 102, 103, 104, 106, + 110, 111, 105, 105, 107, 107, 108, 108, 109, 109, 117, 117, 121, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 190, 190, 137, 137, 139, 138, 138, + 138, 138, 138, 138, 138, 140, 141, 142, 142, 98, 89, 89, 89, 89, 95, 143, 143, 143, 143, + 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 144, 145, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 146, 146, 146, 147, 148, 149, 150, 150, + 151, 152, 112, 112, 122, 122, 123, 191, 191, 124, 125, 125, 99, 96, 96, 96, 96, 96, 153, + 153, 153, 153, 153, 153, 153, 154, 155, 156, 157, 158, 159, 160, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 162, 162, 162, 162, 162, 188, 188, 189, 189, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172}; const signed char PipelineParserGen::yyr2_[] = { - 0, 2, 2, 2, 3, 0, 4, 0, 2, 1, 1, 1, 1, 1, 1, 5, 3, 7, 1, 1, 1, 1, 2, 2, 4, 0, 2, 2, 2, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 0, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 1, 1, - 4, 1, 1, 1, 1, 1, 1, 1, 3, 3, 0, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 8, 4, 4, 4, 7, 4, 4, 4, 7, 4, 7, 8, 7, 7, 4, 7, 7, 1, 1, 1, 8, 8, 6, 1, 1, 6, 6, - 1, 1, 1, 1, 3, 0, 2, 3, 0, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 1, + 0, 2, 2, 2, 3, 0, 4, 0, 2, 1, 1, 1, 1, 1, 1, 5, 3, 7, 1, 1, 1, 1, 2, 2, 4, 0, 2, 2, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 3, 0, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 1, 1, 4, 1, 1, 1, 1, 1, + 1, 1, 3, 3, 0, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 8, 4, 4, 4, 7, 4, 4, 4, 7, 4, 7, 8, 7, 7, 4, 7, 7, 1, 1, 1, 8, 8, 6, 1, 1, 6, 6, 1, 1, + 1, 1, 3, 0, 2, 3, 0, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 0, 2, 11, 4, 4, 4, 4, 4, 4, 4, 4, 4}; @@ -4366,24 +4484,25 @@ const char* const PipelineParserGen::yytname_[] = {"\"EOF\"", #if YYDEBUG const short PipelineParserGen::yyrline_[] = { - 0, 248, 248, 249, 256, 262, 263, 271, 271, 274, 274, 274, 274, 274, 274, 277, - 287, 293, 303, 303, 303, 303, 307, 312, 317, 323, 326, 333, 336, 342, 343, 346, - 349, 352, 355, 358, 361, 364, 367, 370, 373, 377, 377, 377, 377, 381, 387, 390, - 397, 400, 406, 410, 410, 410, 410, 414, 422, 425, 428, 431, 434, 437, 446, 449, - 452, 455, 458, 461, 464, 472, 475, 478, 481, 484, 487, 490, 493, 496, 499, 502, - 505, 508, 511, 514, 517, 520, 523, 526, 529, 532, 535, 538, 541, 544, 547, 550, - 553, 556, 559, 562, 565, 568, 571, 574, 577, 580, 583, 586, 593, 599, 605, 611, - 617, 623, 629, 635, 641, 647, 653, 659, 665, 671, 677, 680, 686, 689, 695, 698, - 704, 707, 713, 716, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, - 734, 735, 736, 737, 738, 739, 740, 747, 748, 755, 755, 759, 764, 764, 764, 764, - 764, 764, 765, 771, 779, 785, 788, 795, 802, 802, 802, 802, 806, 812, 812, 812, - 812, 812, 812, 812, 812, 812, 812, 812, 812, 812, 813, 813, 813, 813, 817, 827, - 833, 838, 843, 849, 854, 859, 864, 870, 875, 881, 890, 896, 902, 907, 913, 919, - 919, 919, 923, 933, 943, 950, 950, 954, 961, 968, 968, 972, 972, 976, 982, 983, - 990, 996, 999, 1006, 1013, 1014, 1015, 1016, 1017, 1020, 1020, 1020, 1020, 1020, 1020, 1020, - 1022, 1027, 1032, 1037, 1042, 1047, 1052, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, - 1067, 1073, 1073, 1073, 1073, 1073, 1077, 1080, 1087, 1090, 1096, 1105, 1110, 1115, 1120, 1125, - 1130, 1135, 1140, 1145}; + 0, 249, 249, 250, 257, 263, 264, 272, 272, 275, 275, 275, 275, 275, 275, 278, + 288, 294, 304, 304, 304, 304, 308, 313, 318, 334, 337, 344, 347, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 362, 363, 364, 367, 370, 373, 376, 379, 382, 385, + 388, 391, 394, 395, 396, 397, 401, 401, 401, 401, 405, 411, 414, 421, 424, 430, + 434, 434, 434, 434, 438, 446, 449, 452, 455, 458, 461, 470, 473, 476, 479, 482, + 485, 488, 496, 499, 502, 505, 508, 511, 514, 517, 520, 523, 526, 529, 532, 535, + 538, 541, 544, 547, 550, 553, 556, 559, 562, 565, 568, 571, 574, 577, 580, 583, + 586, 589, 592, 595, 598, 601, 604, 607, 610, 617, 623, 629, 635, 641, 647, 653, + 659, 665, 671, 677, 683, 689, 695, 701, 704, 710, 713, 719, 722, 728, 731, 737, + 740, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, + 761, 762, 763, 764, 771, 772, 779, 779, 783, 788, 788, 788, 788, 788, 788, 789, + 795, 803, 809, 812, 819, 826, 826, 826, 826, 830, 836, 836, 836, 836, 836, 836, + 836, 836, 836, 836, 836, 836, 836, 837, 837, 837, 837, 841, 851, 857, 862, 867, + 873, 878, 883, 888, 894, 899, 905, 914, 920, 926, 931, 937, 943, 943, 943, 947, + 957, 967, 974, 974, 978, 985, 992, 992, 996, 996, 1000, 1006, 1007, 1014, 1020, 1023, + 1030, 1037, 1038, 1039, 1040, 1041, 1044, 1044, 1044, 1044, 1044, 1044, 1044, 1046, 1051, 1056, + 1061, 1066, 1071, 1076, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1097, 1097, + 1097, 1097, 1097, 1101, 1104, 1111, 1114, 1120, 1129, 1134, 1139, 1144, 1149, 1154, 1159, 1164, + 1169}; void PipelineParserGen::yy_stack_print_() const { *yycdebug_ << "Stack now"; @@ -4404,8 +4523,8 @@ void PipelineParserGen::yy_reduce_print_(int yyrule) const { #endif // YYDEBUG -#line 58 "src/mongo/db/cst/pipeline_grammar.yy" +#line 58 "pipeline_grammar.yy" } // namespace mongo -#line 4205 "src/mongo/db/cst/pipeline_parser_gen.cpp" +#line 4298 "pipeline_parser_gen.cpp" -#line 1149 "src/mongo/db/cst/pipeline_grammar.yy" +#line 1173 "pipeline_grammar.yy" diff --git a/src/mongo/db/cst/pipeline_parser_gen.hpp b/src/mongo/db/cst/pipeline_parser_gen.hpp index 57385ef3c13..8fe129fc809 100644 --- a/src/mongo/db/cst/pipeline_parser_gen.hpp +++ b/src/mongo/db/cst/pipeline_parser_gen.hpp @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.6. +// A Bison parser, made by GNU Bison 3.6.3. // Skeleton interface for Bison LALR(1) parsers in C++ @@ -32,7 +32,7 @@ /** - ** \file src/mongo/db/cst/pipeline_parser_gen.hpp + ** \file pipeline_parser_gen.hpp ** Define the mongo::parser class. */ @@ -42,14 +42,12 @@ // especially those whose name start with YY_ or yy_. They are // private implementation details that can be changed or removed. -#ifndef YY_YY_SRC_MONGO_DB_CST_PIPELINE_PARSER_GEN_HPP_INCLUDED -#define YY_YY_SRC_MONGO_DB_CST_PIPELINE_PARSER_GEN_HPP_INCLUDED +#ifndef YY_YY_PIPELINE_PARSER_GEN_HPP_INCLUDED +#define YY_YY_PIPELINE_PARSER_GEN_HPP_INCLUDED // "%code requires" blocks. -#line 66 "src/mongo/db/cst/pipeline_grammar.yy" +#line 66 "pipeline_grammar.yy" #include "mongo/db/cst/c_node.h" -#include "mongo/db/cst/key_fieldname.h" -#include "mongo/stdx/variant.h" // Forward declare any parameters needed for lexing/parsing. namespace mongo { @@ -61,7 +59,7 @@ class BSONLexer; #pragma warning(disable : 4065) #endif -#line 65 "src/mongo/db/cst/pipeline_parser_gen.hpp" +#line 63 "pipeline_parser_gen.hpp" #include <cassert> #include <cstdlib> // std::abort @@ -190,9 +188,9 @@ class BSONLexer; #define YYDEBUG 0 #endif -#line 58 "src/mongo/db/cst/pipeline_grammar.yy" +#line 58 "pipeline_grammar.yy" namespace mongo { -#line 200 "src/mongo/db/cst/pipeline_parser_gen.hpp" +#line 198 "pipeline_parser_gen.hpp" /// A Bison parser. @@ -1491,6 +1489,14 @@ public: Base::clear(); } +#if YYDEBUG || 0 + /// The user-facing name of this symbol. + const char* name() const YY_NOEXCEPT { + return PipelineParserGen::symbol_name(this->kind()); + } +#endif // #if YYDEBUG || 0 + + /// Backward compatibility (Bison 3.6). symbol_kind_type type_get() const YY_NOEXCEPT; @@ -1860,6 +1866,13 @@ public: /// Report a syntax error. void error(const syntax_error& err); +#if YYDEBUG || 0 + /// The user-facing name of the symbol whose (internal) number is + /// YYSYMBOL. No bounds checking. + static const char* symbol_name(symbol_kind_type yysymbol); +#endif // #if YYDEBUG || 0 + + // Implementation of make_symbol for each symbol type. #if 201103L <= YY_CPLUSPLUS static symbol_type make_END_OF_FILE(location_type l) { @@ -2680,10 +2693,6 @@ private: static symbol_kind_type yytranslate_(int t); #if YYDEBUG || 0 - /// The user-facing name of the symbol whose (internal) number is - /// YYSYMBOL. No bounds checking. - static const char* symbol_name(symbol_kind_type yysymbol); - /// For a symbol, its name in clear. static const char* const yytname_[]; #endif // #if YYDEBUG || 0 @@ -2924,7 +2933,7 @@ private: /// Constants. enum { - yylast_ = 623, ///< Last index in yytable_. + yylast_ = 597, ///< Last index in yytable_. yynnts_ = 112, ///< Number of nonterminal symbols. yyfinal_ = 8 ///< Termination state number. }; @@ -3387,9 +3396,9 @@ inline PipelineParserGen::symbol_kind_type PipelineParserGen::by_kind::type_get( return this->kind(); } -#line 58 "src/mongo/db/cst/pipeline_grammar.yy" +#line 58 "pipeline_grammar.yy" } // namespace mongo -#line 4173 "src/mongo/db/cst/pipeline_parser_gen.hpp" +#line 4184 "pipeline_parser_gen.hpp" -#endif // !YY_YY_SRC_MONGO_DB_CST_PIPELINE_PARSER_GEN_HPP_INCLUDED +#endif // !YY_YY_PIPELINE_PARSER_GEN_HPP_INCLUDED |