summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Tuckman <ted.tuckman@mongodb.com>2020-08-31 13:14:03 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-09-03 18:08:41 +0000
commit8e3271aaf22106853bf36429cfcee39ed6055f35 (patch)
treea2c1648af5ba4e905ca9b8d50f8a1055fd9576a5
parentc4aa65bbd510369498ef7202596775c7824c87ce (diff)
downloadmongo-8e3271aaf22106853bf36429cfcee39ed6055f35.tar.gz
SERVER-50529 Add sort spec to grammar
-rw-r--r--src/mongo/db/cst/SConscript1
-rw-r--r--src/mongo/db/cst/bson_lexer.cpp39
-rw-r--r--src/mongo/db/cst/bson_lexer_test.cpp58
-rwxr-xr-xsrc/mongo/db/cst/cst_error_test.cpp34
-rw-r--r--src/mongo/db/cst/cst_pipeline_translation_test.cpp82
-rw-r--r--src/mongo/db/cst/cst_sort_translation.cpp107
-rw-r--r--src/mongo/db/cst/cst_sort_translation.h44
-rw-r--r--src/mongo/db/cst/cst_test.cpp28
-rw-r--r--src/mongo/db/cst/key_fieldname.h5
-rw-r--r--src/mongo/db/cst/key_value.h26
-rw-r--r--src/mongo/db/cst/pipeline_grammar.yy168
-rw-r--r--src/mongo/db/cst/pipeline_parser_gen.cpp5152
-rw-r--r--src/mongo/db/cst/pipeline_parser_gen.hpp2565
-rw-r--r--src/mongo/db/pipeline/expression.h4
-rw-r--r--src/mongo/db/query/sort_pattern.h3
15 files changed, 4909 insertions, 3407 deletions
diff --git a/src/mongo/db/cst/SConscript b/src/mongo/db/cst/SConscript
index 2aae8cfe8f3..1f17c8ddc06 100644
--- a/src/mongo/db/cst/SConscript
+++ b/src/mongo/db/cst/SConscript
@@ -15,6 +15,7 @@ env.Library(
'c_node_validation.cpp',
'c_node_disambiguation.cpp',
'pipeline_parser_gen.cpp',
+ 'cst_sort_translation.cpp',
],
LIBDEPS=[
"$BUILD_DIR/mongo/base",
diff --git a/src/mongo/db/cst/bson_lexer.cpp b/src/mongo/db/cst/bson_lexer.cpp
index df71bda546e..5fccfac805f 100644
--- a/src/mongo/db/cst/bson_lexer.cpp
+++ b/src/mongo/db/cst/bson_lexer.cpp
@@ -104,6 +104,7 @@ const StringMap<PipelineParserGen::token_type> reservedKeyLookup = {
{"$indexOfBytes", PipelineParserGen::token::INDEX_OF_BYTES},
{"$indexOfCP", PipelineParserGen::token::INDEX_OF_CP},
{"$ltrim", PipelineParserGen::token::LTRIM},
+ {"$meta", PipelineParserGen::token::META},
{"$regexFind", PipelineParserGen::token::REGEX_FIND},
{"$regexFindAll", PipelineParserGen::token::REGEX_FIND_ALL},
{"$regexMatch", PipelineParserGen::token::REGEX_MATCH},
@@ -130,6 +131,13 @@ const StringMap<PipelineParserGen::token_type> reservedKeyLookup = {
{"find", PipelineParserGen::token::ARG_FIND},
{"replacement", PipelineParserGen::token::ARG_REPLACEMENT},
};
+// Mapping of reserved keywords to BSON tokens. Any key which is not included in this map is
+// assumed to be a user value.
+const StringMap<PipelineParserGen::token_type> reservedKeyValueLookup = {
+ {"randVal", PipelineParserGen::token::RAND_VAL},
+ {"textScore", PipelineParserGen::token::TEXT_SCORE},
+};
+
bool isCompound(PipelineParserGen::symbol_type token) {
return token.type_get() == static_cast<int>(PipelineParserGen::token::START_OBJECT) ||
token.type_get() == static_cast<int>(PipelineParserGen::token::START_ARRAY);
@@ -246,11 +254,18 @@ void BSONLexer::tokenize(BSONElement elem, bool includeFieldName) {
case NumberDouble:
if (elem.numberDouble() == 0.0)
pushToken(elem, PipelineParserGen::token::DOUBLE_ZERO);
+ else if (elem.numberDouble() == 1.0)
+ pushToken(elem, PipelineParserGen::token::DOUBLE_ONE);
+ else if (elem.numberDouble() == -1.0)
+ pushToken(elem, PipelineParserGen::token::DOUBLE_NEGATIVE_ONE);
else
- pushToken(elem, PipelineParserGen::token::DOUBLE_NON_ZERO, elem.numberDouble());
+ pushToken(elem, PipelineParserGen::token::DOUBLE_OTHER, elem.numberDouble());
break;
case BSONType::String:
- if (elem.valueStringData()[0] == '$') {
+ if (auto it = reservedKeyValueLookup.find(elem.valueStringData());
+ it != reservedKeyValueLookup.end()) {
+ pushToken(elem.String(), it->second);
+ } else if (elem.valueStringData()[0] == '$') {
if (elem.valueStringData()[1] == '$') {
pushToken(elem.valueStringData(),
PipelineParserGen::token::DOLLAR_DOLLAR_STRING,
@@ -314,8 +329,12 @@ void BSONLexer::tokenize(BSONElement elem, bool includeFieldName) {
case NumberInt:
if (elem.numberInt() == 0)
pushToken(elem, PipelineParserGen::token::INT_ZERO);
+ else if (elem.numberInt() == 1)
+ pushToken(elem, PipelineParserGen::token::INT_ONE);
+ else if (elem.numberInt() == -1)
+ pushToken(elem, PipelineParserGen::token::INT_NEGATIVE_ONE);
else
- pushToken(elem, PipelineParserGen::token::INT_NON_ZERO, elem.numberInt());
+ pushToken(elem, PipelineParserGen::token::INT_OTHER, elem.numberInt());
break;
case BSONType::bsonTimestamp:
pushToken(elem, PipelineParserGen::token::TIMESTAMP, elem.timestamp());
@@ -323,14 +342,22 @@ void BSONLexer::tokenize(BSONElement elem, bool includeFieldName) {
case NumberLong:
if (elem.numberLong() == 0ll)
pushToken(elem, PipelineParserGen::token::LONG_ZERO);
+ else if (elem.numberLong() == 1ll)
+ pushToken(elem, PipelineParserGen::token::LONG_ONE);
+ else if (elem.numberLong() == -1ll)
+ pushToken(elem, PipelineParserGen::token::LONG_NEGATIVE_ONE);
else
- pushToken(elem, PipelineParserGen::token::LONG_NON_ZERO, elem.numberLong());
+ pushToken(elem, PipelineParserGen::token::LONG_OTHER, elem.numberLong());
break;
case NumberDecimal:
if (elem.numberDecimal() == Decimal128::kNormalizedZero)
pushToken(elem, PipelineParserGen::token::DECIMAL_ZERO);
- else
- pushToken(elem, PipelineParserGen::token::DECIMAL_NON_ZERO, elem.numberDecimal());
+ else if (elem.numberDecimal() == Decimal128(1)) {
+ pushToken(elem, PipelineParserGen::token::DECIMAL_ONE);
+ } else if (elem.numberDecimal() == Decimal128(-1)) {
+ pushToken(elem, PipelineParserGen::token::DECIMAL_NEGATIVE_ONE);
+ } else
+ pushToken(elem, PipelineParserGen::token::DECIMAL_OTHER, elem.numberDecimal());
break;
case BSONType::MinKey:
pushToken(elem, PipelineParserGen::token::MIN_KEY, UserMinKey{});
diff --git a/src/mongo/db/cst/bson_lexer_test.cpp b/src/mongo/db/cst/bson_lexer_test.cpp
index 039b5dcc911..459c16a64e4 100644
--- a/src/mongo/db/cst/bson_lexer_test.cpp
+++ b/src/mongo/db/cst/bson_lexer_test.cpp
@@ -49,14 +49,14 @@ void assertTokensMatch(BSONLexer& lexer,
}
TEST(BSONLexerTest, TokenizesOpaqueUserObjects) {
- auto input = fromjson("{pipeline: [{a: 1, b: '1', c: \"$path\", d: \"$$NOW\"}]}");
+ auto input = fromjson("{pipeline: [{a: 2, b: '1', c: \"$path\", d: \"$$NOW\"}]}");
BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE);
assertTokensMatch(lexer,
{PipelineParserGen::token::START_PIPELINE,
PipelineParserGen::token::START_ARRAY,
PipelineParserGen::token::START_OBJECT,
PipelineParserGen::token::FIELDNAME,
- PipelineParserGen::token::INT_NON_ZERO,
+ PipelineParserGen::token::INT_OTHER,
PipelineParserGen::token::FIELDNAME,
PipelineParserGen::token::STRING,
PipelineParserGen::token::FIELDNAME,
@@ -99,7 +99,7 @@ TEST(BSONLexerTest, TokenizesReservedKeywordsAtAnyDepth) {
}
TEST(BSONLexerTest, MidRuleActionToSortNestedObject) {
- auto input = fromjson("{pipeline: [{pipeline: 1.0, coll: 'test'}]}");
+ auto input = fromjson("{pipeline: [{pipeline: 2.0, coll: 'test'}]}");
BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE);
// Iterate until the first object.
ASSERT_EQ(lexer.getNext().type_get(), PipelineParserGen::token::START_PIPELINE);
@@ -112,7 +112,7 @@ TEST(BSONLexerTest, MidRuleActionToSortNestedObject) {
PipelineParserGen::token::ARG_COLL,
PipelineParserGen::token::STRING,
PipelineParserGen::token::ARG_PIPELINE,
- PipelineParserGen::token::DOUBLE_NON_ZERO,
+ PipelineParserGen::token::DOUBLE_OTHER,
PipelineParserGen::token::END_OBJECT,
PipelineParserGen::token::END_ARRAY};
assertTokensMatch(lexer, expected);
@@ -121,7 +121,7 @@ TEST(BSONLexerTest, MidRuleActionToSortNestedObject) {
TEST(BSONLexerTest, MidRuleActionToSortDoesNotSortNestedObjects) {
auto input = fromjson(
- "{pipeline: [{$unionWith: {pipeline: [{$unionWith: 'inner', a: 1.0}], coll: 'outer'}}]}");
+ "{pipeline: [{$unionWith: {pipeline: [{$unionWith: 'inner', a: 3.0}], coll: 'outer'}}]}");
BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE);
// Iterate until we reach the $unionWith object.
ASSERT_EQ(lexer.getNext().type_get(), PipelineParserGen::token::START_PIPELINE);
@@ -140,7 +140,7 @@ TEST(BSONLexerTest, MidRuleActionToSortDoesNotSortNestedObjects) {
PipelineParserGen::token::STAGE_UNION_WITH,
PipelineParserGen::token::STRING, // $unionWith: 'inner'
PipelineParserGen::token::FIELDNAME,
- PipelineParserGen::token::DOUBLE_NON_ZERO, // a: 1.0
+ PipelineParserGen::token::DOUBLE_OTHER, // a: 3.0
PipelineParserGen::token::END_OBJECT,
PipelineParserGen::token::END_ARRAY,
PipelineParserGen::token::END_OBJECT,
@@ -152,7 +152,7 @@ TEST(BSONLexerTest, MidRuleActionToSortDoesNotSortNestedObjects) {
TEST(BSONLexerTest, MultipleNestedObjectsAreReorderedCorrectly) {
auto input = fromjson(
- "{pipeline: [{$unionWith: {pipeline: [{$unionWith: 'inner', a: 1.0}], coll: [{$unionWith: "
+ "{pipeline: [{$unionWith: {pipeline: [{$unionWith: 'inner', a: 3.0}], coll: [{$unionWith: "
"'innerB', a: 2.0}]}}]}");
BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE);
// Iterate until we reach the $unionWith object.
@@ -168,9 +168,9 @@ TEST(BSONLexerTest, MultipleNestedObjectsAreReorderedCorrectly) {
PipelineParserGen::token::START_OBJECT,
// The nested pipeline does *not* get sorted, meaning '$unionWith' stays before 'a'.
PipelineParserGen::token::STAGE_UNION_WITH,
- PipelineParserGen::token::STRING, // innerb
- PipelineParserGen::token::FIELDNAME, // a
- PipelineParserGen::token::DOUBLE_NON_ZERO, // a: 2.0
+ PipelineParserGen::token::STRING, // innerb
+ PipelineParserGen::token::FIELDNAME, // a
+ PipelineParserGen::token::DOUBLE_OTHER, // a: 2.0
PipelineParserGen::token::END_OBJECT,
PipelineParserGen::token::END_ARRAY,
// Coll nested object ends here.
@@ -179,9 +179,9 @@ TEST(BSONLexerTest, MultipleNestedObjectsAreReorderedCorrectly) {
PipelineParserGen::token::START_OBJECT,
// The nested pipeline does *not* get sorted, meaning '$unionWith' stays before 'a'.
PipelineParserGen::token::STAGE_UNION_WITH,
- PipelineParserGen::token::STRING, // $unionWith: 'inner'
- PipelineParserGen::token::FIELDNAME, // a
- PipelineParserGen::token::DOUBLE_NON_ZERO, // a: 1.0
+ PipelineParserGen::token::STRING, // $unionWith: 'inner'
+ PipelineParserGen::token::FIELDNAME, // a
+ PipelineParserGen::token::DOUBLE_OTHER, // a: 3.0
PipelineParserGen::token::END_OBJECT,
PipelineParserGen::token::END_ARRAY,
PipelineParserGen::token::END_OBJECT,
@@ -192,7 +192,7 @@ TEST(BSONLexerTest, MultipleNestedObjectsAreReorderedCorrectly) {
}
TEST(BSONLexerTest, MultiLevelBSONDoesntSortChildren) {
auto input = fromjson(
- "{pipeline: [{$unionWith: {pipeline: [{$unionWith: {'nested': 1.0, 'apple': 1.0}, a: 1.0}],"
+ "{pipeline: [{$unionWith: {pipeline: [{$unionWith: {'nested': 3.0, 'apple': 3.0}, a: 3.0}],"
" coll: 'outer'}}]}");
BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE);
// Iterate until we reach the $unionWith object.
@@ -212,14 +212,14 @@ TEST(BSONLexerTest, MultiLevelBSONDoesntSortChildren) {
PipelineParserGen::token::STAGE_UNION_WITH,
// Second nested object
PipelineParserGen::token::START_OBJECT,
- PipelineParserGen::token::FIELDNAME, // nested: 1.0
- PipelineParserGen::token::DOUBLE_NON_ZERO,
- PipelineParserGen::token::FIELDNAME, // apple: 1.0
- PipelineParserGen::token::DOUBLE_NON_ZERO,
+ PipelineParserGen::token::FIELDNAME, // nested: 3.0
+ PipelineParserGen::token::DOUBLE_OTHER,
+ PipelineParserGen::token::FIELDNAME, // apple: 3.0
+ PipelineParserGen::token::DOUBLE_OTHER,
PipelineParserGen::token::END_OBJECT,
// End second nested object
PipelineParserGen::token::FIELDNAME,
- PipelineParserGen::token::DOUBLE_NON_ZERO, // a: 1.0
+ PipelineParserGen::token::DOUBLE_OTHER, // a: 3.0
PipelineParserGen::token::END_OBJECT,
// End first nested object
PipelineParserGen::token::END_ARRAY,
@@ -266,5 +266,25 @@ TEST(BSONLexerTest, TokenizesObjWithPathCorrectly) {
});
}
+TEST(BSONLexerTest, SortSpecTokensGeneratedCorrectly) {
+ auto input = fromjson("{val: 1, test: -1.0, rand: {$meta: 'textScore'}}");
+ BSONLexer lexer(input, PipelineParserGen::token::START_SORT);
+ assertTokensMatch(lexer,
+ {
+ PipelineParserGen::token::START_SORT,
+ PipelineParserGen::token::START_OBJECT,
+ PipelineParserGen::token::FIELDNAME,
+ PipelineParserGen::token::INT_ONE,
+ PipelineParserGen::token::FIELDNAME,
+ PipelineParserGen::token::DOUBLE_NEGATIVE_ONE,
+ PipelineParserGen::token::FIELDNAME,
+ PipelineParserGen::token::START_OBJECT,
+ PipelineParserGen::token::META,
+ PipelineParserGen::token::TEXT_SCORE,
+ PipelineParserGen::token::END_OBJECT,
+ PipelineParserGen::token::END_OBJECT,
+ });
+}
+
} // namespace
} // namespace mongo
diff --git a/src/mongo/db/cst/cst_error_test.cpp b/src/mongo/db/cst/cst_error_test.cpp
index 15ebe4028f8..10a0cbdda2b 100755
--- a/src/mongo/db/cst/cst_error_test.cpp
+++ b/src/mongo/db/cst/cst_error_test.cpp
@@ -78,13 +78,13 @@ TEST(CstErrorTest, UnknownStageName) {
TEST(CstErrorTest, InvalidStageArgument) {
{
- auto input = fromjson("{pipeline: [{$sample: 1}]}");
+ auto input = fromjson("{pipeline: [{$sample: 2}]}");
BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE);
ASSERT_THROWS_CODE_AND_WHAT(
PipelineParserGen(lexer, nullptr).parse(),
AssertionException,
ErrorCodes::FailedToParse,
- "syntax error, unexpected non-zero integer, expecting object at element '1' within "
+ "syntax error, unexpected arbitrary integer, expecting object at element '2' within "
"'$sample' within array at index 0 of input pipeline");
}
{
@@ -200,5 +200,35 @@ TEST(CstErrorTest, DeeplyNestedSyntaxError) {
"within array at index 0 of input pipeline");
}
+TEST(CstErrorTest, SortWithRandomIntFails) {
+ auto input = fromjson("{val: 5}");
+ BSONLexer lexer(input, PipelineParserGen::token::START_SORT);
+ ASSERT_THROWS_CODE_AND_WHAT(
+ PipelineParserGen(lexer, nullptr).parse(),
+ AssertionException,
+ ErrorCodes::FailedToParse,
+ "syntax error, unexpected arbitrary integer at element '5' of input filter");
+}
+
+TEST(CstErrorTest, SortWithInvalidMetaFails) {
+ auto input = fromjson("{val: {$meta: \"str\"}}");
+ BSONLexer lexer(input, PipelineParserGen::token::START_SORT);
+ ASSERT_THROWS_CODE_AND_WHAT(PipelineParserGen(lexer, nullptr).parse(),
+ AssertionException,
+ ErrorCodes::FailedToParse,
+ "syntax error, unexpected string, expecting randVal or textScore "
+ "at element 'str' within '$meta' of input filter");
+}
+
+TEST(CstErrorTest, SortWithMetaSiblingKeyFails) {
+ auto input = fromjson("{val: {$meta: \"textScore\", someKey: 4}}");
+ BSONLexer lexer(input, PipelineParserGen::token::START_SORT);
+ ASSERT_THROWS_CODE_AND_WHAT(PipelineParserGen(lexer, nullptr).parse(),
+ AssertionException,
+ ErrorCodes::FailedToParse,
+ "syntax error, unexpected fieldname, expecting end of object at "
+ "element 'someKey' of input filter");
+}
+
} // namespace
} // namespace mongo
diff --git a/src/mongo/db/cst/cst_pipeline_translation_test.cpp b/src/mongo/db/cst/cst_pipeline_translation_test.cpp
index 429ec779b85..6859d8db7f3 100644
--- a/src/mongo/db/cst/cst_pipeline_translation_test.cpp
+++ b/src/mongo/db/cst/cst_pipeline_translation_test.cpp
@@ -36,6 +36,7 @@
#include "mongo/bson/unordered_fields_bsonobj_comparator.h"
#include "mongo/db/cst/c_node.h"
#include "mongo/db/cst/cst_pipeline_translation.h"
+#include "mongo/db/cst/cst_sort_translation.h"
#include "mongo/db/cst/key_fieldname.h"
#include "mongo/db/cst/key_value.h"
#include "mongo/db/exec/document_value/document.h"
@@ -47,6 +48,7 @@
#include "mongo/db/pipeline/document_source_single_document_transformation.h"
#include "mongo/db/pipeline/document_source_skip.h"
#include "mongo/db/pipeline/expression_context_for_test.h"
+#include "mongo/db/query/sort_pattern.h"
#include "mongo/unittest/unittest.h"
namespace mongo {
@@ -58,6 +60,31 @@ auto getExpCtx() {
return boost::intrusive_ptr<ExpressionContextForTest>{new ExpressionContextForTest(nss)};
}
+void assertSortPatternsEQ(SortPattern correct, SortPattern fromTest) {
+ for (size_t i = 0; i < correct.size(); ++i) {
+ ASSERT_EQ(correct[i].isAscending, fromTest[i].isAscending);
+ if (correct[i].fieldPath) {
+ if (fromTest[i].fieldPath) {
+ ASSERT_EQ(correct[i].fieldPath->fullPath(), fromTest[i].fieldPath->fullPath());
+ } else {
+ FAIL("Pattern missing fieldpath");
+ }
+ } else if (fromTest[i].fieldPath) {
+ FAIL("Pattern incorrectly had fieldpath");
+ }
+ if (correct[i].expression) {
+ if (fromTest[i].expression)
+ ASSERT_EQ(correct[i].expression->serialize(false).toString(),
+ fromTest[i].expression->serialize(false).toString());
+ else {
+ FAIL("Pattern missing expression");
+ }
+ } else if (fromTest[i].expression) {
+ FAIL("Pattern incorrectly had expression");
+ }
+ }
+}
+
TEST(CstPipelineTranslationTest, TranslatesEmpty) {
const auto cst = CNode{CNode::ArrayChildren{}};
auto pipeline = cst_pipeline_translation::translatePipeline(cst, getExpCtx());
@@ -1231,5 +1258,60 @@ TEST(CstPipelineTranslationTest, InvalidDollarPrefixStringFails) {
}
}
+TEST(CstSortTranslationTest, BasicSortGeneratesCorrectSortPattern) {
+ const auto cst =
+ CNode{CNode::ObjectChildren{{UserFieldname{"val"}, CNode{KeyValue::intOneKey}}}};
+ auto expCtx = getExpCtx();
+ auto pattern = cst_sort_translation::translateSortSpec(cst, expCtx);
+ auto correctPattern = SortPattern(fromjson("{val: 1}"), expCtx);
+ assertSortPatternsEQ(correctPattern, pattern);
+}
+
+TEST(CstSortTranslationTest, MultiplePartSortGeneratesCorrectSortPattern) {
+ {
+ const auto cst =
+ CNode{CNode::ObjectChildren{{UserFieldname{"val"}, CNode{KeyValue::intOneKey}},
+ {UserFieldname{"test"}, CNode{KeyValue::intNegOneKey}}}};
+ auto expCtx = getExpCtx();
+ auto pattern = cst_sort_translation::translateSortSpec(cst, expCtx);
+ auto correctPattern = SortPattern(fromjson("{val: 1, test: -1}"), expCtx);
+ assertSortPatternsEQ(correctPattern, pattern);
+ }
+ {
+ const auto cst =
+ CNode{CNode::ObjectChildren{{UserFieldname{"val"}, CNode{KeyValue::doubleOneKey}},
+ {UserFieldname{"test"}, CNode{KeyValue::intNegOneKey}},
+ {UserFieldname{"third"}, CNode{KeyValue::longNegOneKey}}}};
+ auto expCtx = getExpCtx();
+ auto pattern = cst_sort_translation::translateSortSpec(cst, expCtx);
+ auto correctPattern = SortPattern(fromjson("{val: 1, test: -1, third: -1}"), expCtx);
+ assertSortPatternsEQ(correctPattern, pattern);
+ }
+}
+
+TEST(CstSortTranslationTest, SortWithMetaGeneratesCorrectSortPattern) {
+ {
+ const auto cst = CNode{CNode::ObjectChildren{
+ {UserFieldname{"val"},
+ CNode{
+ CNode::ObjectChildren{{KeyFieldname::meta, CNode{KeyValue::randVal}}},
+ }}}};
+ auto expCtx = getExpCtx();
+ auto pattern = cst_sort_translation::translateSortSpec(cst, expCtx);
+ auto correctPattern = SortPattern(fromjson("{val: {$meta: \"randVal\"}}"), expCtx);
+ assertSortPatternsEQ(correctPattern, pattern);
+ }
+ {
+ const auto cst = CNode{CNode::ObjectChildren{
+ {UserFieldname{"val"},
+ CNode{
+ CNode::ObjectChildren{{KeyFieldname::meta, CNode{KeyValue::textScore}}},
+ }}}};
+ auto expCtx = getExpCtx();
+ auto pattern = cst_sort_translation::translateSortSpec(cst, expCtx);
+ auto correctPattern = SortPattern(fromjson("{val: {$meta: \"textScore\"}}"), expCtx);
+ assertSortPatternsEQ(correctPattern, pattern);
+ }
+}
} // namespace
} // namespace mongo
diff --git a/src/mongo/db/cst/cst_sort_translation.cpp b/src/mongo/db/cst/cst_sort_translation.cpp
new file mode 100644
index 00000000000..e88b21477dc
--- /dev/null
+++ b/src/mongo/db/cst/cst_sort_translation.cpp
@@ -0,0 +1,107 @@
+/**
+ * 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 <set>
+#include <string>
+#include <vector>
+
+#include "mongo/db/cst/cst_sort_translation.h"
+#include "mongo/db/cst/key_value.h"
+#include "mongo/db/exec/document_value/document_metadata_fields.h"
+#include "mongo/db/pipeline/expression.h"
+#include "mongo/db/pipeline/field_path.h"
+#include "mongo/util/visit_helper.h"
+
+namespace mongo::cst_sort_translation {
+
+SortPattern translateSortSpec(const CNode& cst,
+ const boost::intrusive_ptr<ExpressionContext>& expCtx) {
+ // Assume object children, only thing possible for sort.
+ const auto& children = cst.objectChildren();
+ std::vector<SortPattern::SortPatternPart> sortKeys;
+ std::set<std::string> paths;
+ for (const auto& keyValPair : children) {
+ const auto& path = stdx::get<UserString>(keyValPair.first);
+ paths.insert(path);
+ stdx::visit(
+ visit_helper::Overloaded{
+ [&](const CNode::ObjectChildren& object) {
+ // $meta is always the only key in the object, and always has a KeyValue as its
+ // value.
+ // If sorting by textScore, put highest scores first. If $meta was specified
+ // with randVal order doesn't matter, so always put descending.
+ auto keyVal = stdx::get<KeyValue>(object[0].second.payload);
+ switch (keyVal) {
+ case KeyValue::randVal:
+ sortKeys.push_back(SortPattern::SortPatternPart{
+ false,
+ boost::none,
+ make_intrusive<ExpressionMeta>(expCtx.get(),
+ DocumentMetadataFields::kRandVal)});
+ break;
+ case KeyValue::textScore:
+ sortKeys.push_back(SortPattern::SortPatternPart{
+ false,
+ boost::none,
+ make_intrusive<ExpressionMeta>(
+ expCtx.get(), DocumentMetadataFields::kTextScore)});
+ break;
+ default:
+ MONGO_UNREACHABLE;
+ }
+ },
+ [&](const KeyValue& keyValue) {
+ switch (keyValue) {
+ case KeyValue::intOneKey:
+ case KeyValue::longOneKey:
+ case KeyValue::doubleOneKey:
+ case KeyValue::decimalOneKey:
+ sortKeys.push_back(SortPattern::SortPatternPart{
+ true, FieldPath{path}, nullptr /* meta */});
+
+ break;
+ case KeyValue::intNegOneKey:
+ case KeyValue::longNegOneKey:
+ case KeyValue::doubleNegOneKey:
+ case KeyValue::decimalNegOneKey:
+ sortKeys.push_back(SortPattern::SortPatternPart{
+ false, FieldPath{path}, nullptr /* meta */});
+ break;
+ default:
+ MONGO_UNREACHABLE;
+ }
+ },
+ [](auto&&) { MONGO_UNREACHABLE; },
+ },
+ keyValPair.second.payload);
+ }
+ return SortPattern(std::move(sortKeys), std::move(paths));
+}
+
+} // namespace mongo::cst_sort_translation
diff --git a/src/mongo/db/cst/cst_sort_translation.h b/src/mongo/db/cst/cst_sort_translation.h
new file mode 100644
index 00000000000..2a5f6210b50
--- /dev/null
+++ b/src/mongo/db/cst/cst_sort_translation.h
@@ -0,0 +1,44 @@
+/**
+ * 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 <memory>
+
+#include "mongo/db/cst/c_node.h"
+#include "mongo/db/query/sort_pattern.h"
+
+namespace mongo::cst_sort_translation {
+
+SortPattern translateSortSpec(const CNode& cst,
+ const boost::intrusive_ptr<ExpressionContext>& expCtx);
+
+} // namespace mongo::cst_sort_translation
diff --git a/src/mongo/db/cst/cst_test.cpp b/src/mongo/db/cst/cst_test.cpp
index 1fa155a72e9..18425a72fc5 100644
--- a/src/mongo/db/cst/cst_test.cpp
+++ b/src/mongo/db/cst/cst_test.cpp
@@ -244,10 +244,11 @@ TEST(CstGrammarTest, ParsesProject) {
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: \"<NonZeroKey of type double 1.000000>\", b: { "
- "<CompoundInclusionKey>: { c: \"<NonZeroKey of type int 1>\", d: \"<NonZeroKey "
- "of type decimal 1.0>\" } }, id: \"<NonZeroKey of type long 1>\" } }");
+ ASSERT_EQ(
+ stages[0].toBson().toString(),
+ "{ projectInclusion: { a: \"<NonZeroKey of type double 1.000000>\", b: { "
+ "<CompoundInclusionKey>: { c: \"<NonZeroKey of type int 1>\", d: \"<NonZeroKey "
+ "of type decimal 1.00000000000000>\" } }, id: \"<NonZeroKey of type long 1>\" } }");
}
{
CNode output;
@@ -907,5 +908,24 @@ TEST(CstGrammarTest, FailsToParseDollarPrefixedPredicates) {
}
}
+TEST(CstGrammarTest, ParsesBasicSort) {
+ CNode output;
+ auto input = fromjson("{val: 1, test: -1}");
+ BSONLexer lexer(input, PipelineParserGen::token::START_SORT);
+ auto parseTree = PipelineParserGen(lexer, &output);
+ ASSERT_EQ(0, parseTree.parse());
+ ASSERT_EQ(output.toBson().toString(),
+ "{ val: \"<KeyValue intOneKey>\", test: \"<KeyValue intNegOneKey>\" }");
+}
+
+TEST(CstGrammarTest, ParsesMetaSort) {
+ CNode output;
+ auto input = fromjson("{val: {$meta: \"textScore\"}}");
+ BSONLexer lexer(input, PipelineParserGen::token::START_SORT);
+ auto parseTree = PipelineParserGen(lexer, &output);
+ ASSERT_EQ(0, parseTree.parse());
+ ASSERT_EQ(output.toBson().toString(), "{ val: { meta: \"<KeyValue textScore>\" } }");
+}
+
} // namespace
} // namespace mongo
diff --git a/src/mongo/db/cst/key_fieldname.h b/src/mongo/db/cst/key_fieldname.h
index 90d3fcbfe19..1c9b9b7f570 100644
--- a/src/mongo/db/cst/key_fieldname.h
+++ b/src/mongo/db/cst/key_fieldname.h
@@ -71,6 +71,7 @@
ENUMIFY(lte) \
ENUMIFY(ltrim) \
ENUMIFY(match) \
+ ENUMIFY(meta) \
ENUMIFY(mod) \
ENUMIFY(multiply) \
ENUMIFY(ne) \
@@ -88,8 +89,8 @@
ENUMIFY(regexFindAll) \
ENUMIFY(regexMatch) \
ENUMIFY(replaceAll) \
- ENUMIFY(replacementArg) \
ENUMIFY(replaceOne) \
+ ENUMIFY(replacementArg) \
ENUMIFY(round) \
ENUMIFY(rtrim) \
ENUMIFY(sample) \
@@ -97,9 +98,9 @@
ENUMIFY(skip) \
ENUMIFY(split) \
ENUMIFY(sqrt) \
- ENUMIFY(strcasecmp) \
ENUMIFY(strLenBytes) \
ENUMIFY(strLenCP) \
+ ENUMIFY(strcasecmp) \
ENUMIFY(substr) \
ENUMIFY(substrBytes) \
ENUMIFY(substrCP) \
diff --git a/src/mongo/db/cst/key_value.h b/src/mongo/db/cst/key_value.h
index f7c223f7135..35c4987f82b 100644
--- a/src/mongo/db/cst/key_value.h
+++ b/src/mongo/db/cst/key_value.h
@@ -33,14 +33,24 @@
#include "mongo/util/printable_enum.h"
-#define KEYVALUES(ENUMIFY) \
- ENUMIFY(intZeroKey) \
- ENUMIFY(longZeroKey) \
- ENUMIFY(doubleZeroKey) \
- ENUMIFY(decimalZeroKey) \
- ENUMIFY(trueKey) \
- ENUMIFY(falseKey) \
- ENUMIFY(absentKey)
+#define KEYVALUES(ENUMIFY) \
+ ENUMIFY(intOneKey) \
+ ENUMIFY(intNegOneKey) \
+ ENUMIFY(intZeroKey) \
+ ENUMIFY(longOneKey) \
+ ENUMIFY(longNegOneKey) \
+ ENUMIFY(longZeroKey) \
+ ENUMIFY(doubleOneKey) \
+ ENUMIFY(doubleNegOneKey) \
+ ENUMIFY(doubleZeroKey) \
+ ENUMIFY(decimalOneKey) \
+ ENUMIFY(decimalNegOneKey) \
+ ENUMIFY(decimalZeroKey) \
+ ENUMIFY(trueKey) \
+ ENUMIFY(falseKey) \
+ ENUMIFY(absentKey) \
+ ENUMIFY(textScore) \
+ ENUMIFY(randVal)
MAKE_PRINTABLE_ENUM(KeyValue, KEYVALUES);
MAKE_PRINTABLE_ENUM_STRING_ARRAY(key_value, KeyValue, KEYVALUES);
diff --git a/src/mongo/db/cst/pipeline_grammar.yy b/src/mongo/db/cst/pipeline_grammar.yy
index b08b1b7e7a3..fa9580fedcd 100644
--- a/src/mongo/db/cst/pipeline_grammar.yy
+++ b/src/mongo/db/cst/pipeline_grammar.yy
@@ -144,8 +144,12 @@
CONVERT
DATE_FROM_STRING
DATE_TO_STRING
+ DECIMAL_NEGATIVE_ONE "-1 (decimal)"
+ DECIMAL_ONE "1 (decimal)"
DECIMAL_ZERO "zero (decimal)"
DIVIDE
+ DOUBLE_NEGATIVE_ONE "-1 (double)"
+ DOUBLE_ONE "1 (double)"
DOUBLE_ZERO "zero (double)"
END_ARRAY "end of array"
END_OBJECT "end of object"
@@ -157,21 +161,27 @@
ID
INDEX_OF_BYTES
INDEX_OF_CP
+ INT_NEGATIVE_ONE "-1 (int)"
+ INT_ONE "1 (int)"
INT_ZERO "zero (int)"
LITERAL
LN
LOG
LOGTEN
+ LONG_NEGATIVE_ONE "-1 (long)"
+ LONG_ONE "1 (long)"
LONG_ZERO "zero (long)"
LT
LTE
LTRIM
+ META
MOD
MULTIPLY
NE
NOT
OR
POW
+ RAND_VAL "randVal"
REGEX_FIND
REGEX_FIND_ALL
REGEX_MATCH
@@ -196,6 +206,7 @@
SUBSTR_BYTES
SUBSTR_CP
SUBTRACT
+ TEXT_SCORE "textScore"
TO_BOOL
TO_DATE
TO_DECIMAL
@@ -225,17 +236,17 @@
%token <BSONCode> JAVASCRIPT "Code"
%token <BSONSymbol> SYMBOL "Symbol"
%token <BSONCodeWScope> JAVASCRIPT_W_SCOPE "CodeWScope"
-%token <int> INT_NON_ZERO "non-zero integer"
-%token <long long> LONG_NON_ZERO "non-zero long"
-%token <double> DOUBLE_NON_ZERO "non-zero double"
-%token <Decimal128> DECIMAL_NON_ZERO "non-zero decimal"
+%token <int> INT_OTHER "arbitrary integer"
+%token <long long> LONG_OTHER "arbitrary long"
+%token <double> DOUBLE_OTHER "arbitrary double"
+%token <Decimal128> DECIMAL_OTHER "arbitrary decimal"
%token <Timestamp> TIMESTAMP "Timestamp"
%token <UserMinKey> MIN_KEY "minKey"
%token <UserMaxKey> MAX_KEY "maxKey"
%token <std::string> DOLLAR_STRING "$-prefixed string"
%token <std::string> DOLLAR_DOLLAR_STRING "$$-prefixed string"
%token <std::string> DOLLAR_PREF_FIELDNAME "$-prefixed fieldname"
-%token START_PIPELINE START_MATCH
+%token START_PIPELINE START_MATCH START_SORT
//
// Semantic values (aka the C++ types produced by the actions).
@@ -272,6 +283,10 @@
%nterm <std::vector<CNode>> expressions values exprZeroToTwo
%nterm <CNode> matchExpression filterFields filterVal
+// Sort related rules
+%nterm <CNode> sortSpecs specList metaSort oneOrNegOne metaSortKeyword
+%nterm <std::pair<CNode::Fieldname, CNode>> sortSpec
+
%start start;
//
// Grammar rules
@@ -287,6 +302,9 @@ start:
invariant(cst);
*cst = $matchExpression;
}
+ | START_SORT sortSpecs {
+ *cst = CNode{$sortSpecs};
+ }
;
// Entry point to pipeline parsing.
@@ -398,25 +416,49 @@ projection:
| javascript
| symbol
| javascriptWScope
- | INT_NON_ZERO {
+ | INT_ONE {
+ $$ = CNode{NonZeroKey{1}};
+ }
+ | INT_NEGATIVE_ONE {
+ $$ = CNode{NonZeroKey{-1}};
+ }
+ | INT_OTHER {
$$ = CNode{NonZeroKey{$1}};
}
| INT_ZERO {
$$ = CNode{KeyValue::intZeroKey};
}
- | LONG_NON_ZERO {
+ | LONG_ONE {
+ $$ = CNode{NonZeroKey{1ll}};
+ }
+ | LONG_NEGATIVE_ONE {
+ $$ = CNode{NonZeroKey{-1ll}};
+ }
+ | LONG_OTHER {
$$ = CNode{NonZeroKey{$1}};
}
| LONG_ZERO {
$$ = CNode{KeyValue::longZeroKey};
}
- | DOUBLE_NON_ZERO {
+ | DOUBLE_ONE {
+ $$ = CNode{NonZeroKey{1.0}};
+ }
+ | DOUBLE_NEGATIVE_ONE {
+ $$ = CNode{NonZeroKey{-1.0}};
+ }
+ | DOUBLE_OTHER {
$$ = CNode{NonZeroKey{$1}};
}
| DOUBLE_ZERO {
$$ = CNode{KeyValue::doubleZeroKey};
}
- | DECIMAL_NON_ZERO {
+ | DECIMAL_ONE {
+ $$ = CNode{NonZeroKey{1.0}};
+ }
+ | DECIMAL_NEGATIVE_ONE {
+ $$ = CNode{NonZeroKey{-1.0}};
+ }
+ | DECIMAL_OTHER {
$$ = CNode{NonZeroKey{$1}};
}
| DECIMAL_ZERO {
@@ -694,6 +736,9 @@ aggExprAsUserFieldname:
| LTRIM {
$$ = UserFieldname{"$ltrim"};
}
+ | META {
+ $$ = UserFieldname{"$meta"};
+ }
| REGEX_FIND {
$$ = UserFieldname{"$regexFind"};
}
@@ -749,7 +794,16 @@ string:
STRING {
$$ = CNode{UserString{$1}};
}
+ // Here we need to list all keys in value BSON positions so they can be converted back to string
+ // in contexts where they're not special. It's laborious but this is the perennial Bison way.
+ | RAND_VAL {
+ $$ = CNode{UserString{"randVal"}};
+ }
+ | TEXT_SCORE {
+ $$ = CNode{UserString{"textScore"}};
+ }
;
+
fieldPath:
DOLLAR_STRING {
std::string str = $1;
@@ -846,39 +900,63 @@ maxKey:
;
int:
- INT_NON_ZERO {
+ INT_OTHER {
$$ = CNode{UserInt{$1}};
}
| INT_ZERO {
$$ = CNode{UserInt{0}};
}
+ | INT_ONE {
+ $$ = CNode{UserInt{1}};
+ }
+ | INT_NEGATIVE_ONE {
+ $$ = CNode{UserInt{-1}};
+ }
;
long:
- LONG_NON_ZERO {
+ LONG_OTHER {
$$ = CNode{UserLong{$1}};
}
| LONG_ZERO {
$$ = CNode{UserLong{0ll}};
}
+ | LONG_ONE {
+ $$ = CNode{UserLong{1ll}};
+ }
+ | LONG_NEGATIVE_ONE {
+ $$ = CNode{UserLong{-1ll}};
+ }
;
double:
- DOUBLE_NON_ZERO {
+ DOUBLE_OTHER {
$$ = CNode{UserDouble{$1}};
}
| DOUBLE_ZERO {
$$ = CNode{UserDouble{0.0}};
}
+ | DOUBLE_ONE {
+ $$ = CNode{UserDouble{1.0}};
+ }
+ | DOUBLE_NEGATIVE_ONE {
+ $$ = CNode{UserDouble{-1.0}};
+ }
;
decimal:
- DECIMAL_NON_ZERO {
+ DECIMAL_OTHER {
$$ = CNode{UserDecimal{$1}};
}
| DECIMAL_ZERO {
$$ = CNode{UserDecimal{0.0}};
}
+ | DECIMAL_ONE {
+ $$ = CNode{UserDecimal{1.0}};
+ }
+ | DECIMAL_NEGATIVE_ONE {
+ $$ = CNode{UserDecimal{-1.0}};
+ }
;
bool:
@@ -1350,6 +1428,70 @@ toUpper:
}
;
+metaSortKeyword:
+ RAND_VAL {
+ $$ = CNode{KeyValue::randVal};
+ }
+ | TEXT_SCORE {
+ $$ = CNode{KeyValue::textScore};
+ }
+;
+
+metaSort:
+ START_OBJECT META metaSortKeyword END_OBJECT {
+ $$ = CNode{CNode::ObjectChildren{{KeyFieldname::meta, $metaSortKeyword}}};
+}
+;
+
+sortSpecs:
+ START_OBJECT specList END_OBJECT {
+ $$ = $2;
+}
+
+specList:
+ %empty {
+ $$ = CNode::noopLeaf();
+ }
+ | specList[sortArg] sortSpec {
+ $$ = $sortArg;
+ $$.objectChildren().emplace_back($sortSpec);
+ }
+;
+
+oneOrNegOne:
+ INT_ONE {
+ $$ = CNode{KeyValue::intOneKey};
+ }
+ | INT_NEGATIVE_ONE {
+ $$ = CNode{KeyValue::intNegOneKey};
+ }
+ | LONG_ONE {
+ $$ = CNode{KeyValue::longOneKey};
+ }
+ | LONG_NEGATIVE_ONE {
+ $$ = CNode{KeyValue::longNegOneKey};
+ }
+ | DOUBLE_ONE {
+ $$ = CNode{KeyValue::doubleOneKey};
+ }
+ | DOUBLE_NEGATIVE_ONE {
+ $$ = CNode{KeyValue::doubleNegOneKey};
+ }
+ | DECIMAL_ONE {
+ $$ = CNode{KeyValue::decimalOneKey};
+ }
+ | DECIMAL_NEGATIVE_ONE {
+ $$ = CNode{KeyValue::decimalNegOneKey};
+ }
+
+sortSpec:
+ valueFieldname metaSort {
+ $$ = {$1, $2};
+ } | valueFieldname oneOrNegOne {
+ $$ = {$1, $2};
+ }
+;
+
literalEscapes:
const | literal
;
diff --git a/src/mongo/db/cst/pipeline_parser_gen.cpp b/src/mongo/db/cst/pipeline_parser_gen.cpp
index da6216a4345..e7bf5ae4429 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.5.4.
+// A Bison parser, made by GNU Bison 3.7.
// Skeleton implementation for Bison LALR(1) parsers in C++
@@ -30,15 +30,16 @@
// This special exception was added by the Free Software Foundation in
// version 2.2 of Bison.
-// Undocumented macros, especially those whose name start with YY_,
-// are private implementation details. Do not rely on them.
+// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
+// especially those whose name start with YY_ or yy_. They are
+// private implementation details that can be changed or removed.
#include "pipeline_parser_gen.hpp"
// Unqualified %code blocks.
-#line 83 "src/mongo/db/cst/pipeline_grammar.yy"
+#line 83 "pipeline_grammar.yy"
#include "mongo/db/cst/bson_lexer.h"
#include "mongo/db/cst/c_node_disambiguation.h"
@@ -59,7 +60,7 @@ void PipelineParserGen::error(const PipelineParserGen::location_type& loc, const
// mongo.
#define YYLLOC_DEFAULT(newPos, rhsPositions, nRhs)
-#line 67 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 68 "pipeline_parser_gen.cpp"
#ifndef YY_
@@ -74,6 +75,7 @@ void PipelineParserGen::error(const PipelineParserGen::location_type& loc, const
#endif
#endif
+
// Whether we are compiled with exception support.
#ifndef YY_EXCEPTIONS
#if defined __GNUC__ && !defined __EXCEPTIONS
@@ -124,10 +126,10 @@ void PipelineParserGen::error(const PipelineParserGen::location_type& loc, const
yy_reduce_print_(Rule); \
} while (false)
-#define YY_STACK_PRINT() \
- do { \
- if (yydebug_) \
- yystack_print_(); \
+#define YY_STACK_PRINT() \
+ do { \
+ if (yydebug_) \
+ yy_stack_print_(); \
} while (false)
#else // !YYDEBUG
@@ -149,47 +151,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 159 "src/mongo/db/cst/pipeline_parser_gen.cpp"
-
-
-/* Return YYSTR after stripping away unnecessary quotes and
- backslashes, so that it's suitable for yyerror. The heuristic is
- that double-quoting is unnecessary unless the string contains an
- apostrophe, a comma, or backslash (other than backslash-backslash).
- YYSTR is taken from yytname. */
-std::string PipelineParserGen::yytnamerr_(const char* yystr) {
- if (*yystr == '"') {
- std::string yyr;
- char const* yyp = yystr;
-
- for (;;)
- switch (*++yyp) {
- case '\'':
- case ',':
- goto do_not_strip_quotes;
-
- case '\\':
- if (*++yyp != '\\')
- goto do_not_strip_quotes;
- else
- goto append;
-
- append:
- default:
- yyr += *yyp;
- break;
-
- case '"':
- return yyr;
- }
- do_not_strip_quotes:;
- }
-
- return yystr;
-}
-
+#line 161 "pipeline_parser_gen.cpp"
/// Build a parser object.
PipelineParserGen::PipelineParserGen(BSONLexer& lexer_yyarg, CNode* cst_yyarg)
@@ -208,7 +172,7 @@ PipelineParserGen::~PipelineParserGen() {}
PipelineParserGen::syntax_error::~syntax_error() YY_NOEXCEPT YY_NOTHROW {}
/*---------------.
-| Symbol types. |
+| symbol kinds. |
`---------------*/
@@ -228,241 +192,247 @@ void PipelineParserGen::by_state::move(by_state& that) {
PipelineParserGen::by_state::by_state(state_type s) YY_NOEXCEPT : state(s) {}
-PipelineParserGen::symbol_number_type PipelineParserGen::by_state::type_get() const YY_NOEXCEPT {
+PipelineParserGen::symbol_kind_type PipelineParserGen::by_state::kind() const YY_NOEXCEPT {
if (state == empty_state)
- return empty_symbol;
+ return symbol_kind::S_YYEMPTY;
else
- return yystos_[+state];
+ return YY_CAST(symbol_kind_type, yystos_[+state]);
}
PipelineParserGen::stack_symbol_type::stack_symbol_type() {}
PipelineParserGen::stack_symbol_type::stack_symbol_type(YY_RVREF(stack_symbol_type) that)
: super_type(YY_MOVE(that.state), YY_MOVE(that.location)) {
- switch (that.type_get()) {
- case 99: // "BinData"
+ switch (that.kind()) {
+ case symbol_kind::S_BINARY: // "BinData"
value.YY_MOVE_OR_COPY<BSONBinData>(YY_MOVE(that.value));
break;
- case 106: // "Code"
+ case symbol_kind::S_JAVASCRIPT: // "Code"
value.YY_MOVE_OR_COPY<BSONCode>(YY_MOVE(that.value));
break;
- case 108: // "CodeWScope"
+ case symbol_kind::S_JAVASCRIPT_W_SCOPE: // "CodeWScope"
value.YY_MOVE_OR_COPY<BSONCodeWScope>(YY_MOVE(that.value));
break;
- case 105: // "dbPointer"
+ case symbol_kind::S_DB_POINTER: // "dbPointer"
value.YY_MOVE_OR_COPY<BSONDBRef>(YY_MOVE(that.value));
break;
- case 104: // "regex"
+ case symbol_kind::S_REGEX: // "regex"
value.YY_MOVE_OR_COPY<BSONRegEx>(YY_MOVE(that.value));
break;
- case 107: // "Symbol"
+ case symbol_kind::S_SYMBOL: // "Symbol"
value.YY_MOVE_OR_COPY<BSONSymbol>(YY_MOVE(that.value));
break;
- case 135: // dbPointer
- case 136: // javascript
- case 137: // symbol
- case 138: // javascriptWScope
- case 139: // int
- case 140: // timestamp
- case 141: // long
- case 142: // double
- case 143: // decimal
- case 144: // minKey
- case 145: // maxKey
- case 146: // value
- case 147: // string
- case 148: // fieldPath
- case 149: // binary
- case 150: // undefined
- case 151: // objectId
- case 152: // bool
- case 153: // date
- case 154: // null
- case 155: // regex
- case 156: // simpleValue
- case 157: // compoundValue
- case 158: // valueArray
- case 159: // valueObject
- case 160: // valueFields
- case 161: // variable
- case 162: // pipeline
- case 163: // stageList
- case 164: // stage
- case 165: // inhibitOptimization
- case 166: // unionWith
- case 167: // skip
- case 168: // limit
- case 169: // project
- case 170: // sample
- case 171: // projectFields
- case 172: // projection
- case 173: // num
- case 174: // expression
- case 175: // compoundExpression
- case 176: // exprFixedTwoArg
- case 177: // expressionArray
- case 178: // expressionObject
- case 179: // expressionFields
- case 180: // maths
- case 181: // add
- case 182: // atan2
- case 183: // boolExps
- case 184: // and
- case 185: // or
- case 186: // not
- case 187: // literalEscapes
- case 188: // const
- case 189: // literal
- case 190: // stringExps
- case 191: // concat
- case 192: // dateFromString
- case 193: // dateToString
- case 194: // indexOfBytes
- case 195: // indexOfCP
- case 196: // ltrim
- case 197: // regexFind
- case 198: // regexFindAll
- case 199: // regexMatch
- case 200: // regexArgs
- case 201: // replaceOne
- case 202: // replaceAll
- case 203: // rtrim
- case 204: // split
- case 205: // strLenBytes
- case 206: // strLenCP
- case 207: // strcasecmp
- case 208: // substr
- case 209: // substrBytes
- case 210: // substrCP
- case 211: // toLower
- case 212: // toUpper
- case 213: // trim
- case 214: // compExprs
- case 215: // cmp
- case 216: // eq
- case 217: // gt
- case 218: // gte
- case 219: // lt
- case 220: // lte
- case 221: // ne
- case 222: // typeExpression
- case 223: // convert
- case 224: // toBool
- case 225: // toDate
- case 226: // toDecimal
- case 227: // toDouble
- case 228: // toInt
- case 229: // toLong
- case 230: // toObjectId
- case 231: // toString
- case 232: // type
- case 233: // abs
- case 234: // ceil
- case 235: // divide
- case 236: // exponent
- case 237: // floor
- case 238: // ln
- case 239: // log
- case 240: // logten
- case 241: // mod
- case 242: // multiply
- case 243: // pow
- case 244: // round
- case 245: // sqrt
- case 246: // subtract
- case 247: // trunc
- case 257: // matchExpression
- case 258: // filterFields
- case 259: // filterVal
+ case symbol_kind::S_dbPointer: // dbPointer
+ case symbol_kind::S_javascript: // javascript
+ case symbol_kind::S_symbol: // symbol
+ case symbol_kind::S_javascriptWScope: // javascriptWScope
+ case symbol_kind::S_int: // int
+ case symbol_kind::S_timestamp: // timestamp
+ case symbol_kind::S_long: // long
+ case symbol_kind::S_double: // double
+ case symbol_kind::S_decimal: // decimal
+ case symbol_kind::S_minKey: // minKey
+ case symbol_kind::S_maxKey: // maxKey
+ case symbol_kind::S_value: // value
+ case symbol_kind::S_string: // string
+ case symbol_kind::S_fieldPath: // fieldPath
+ case symbol_kind::S_binary: // binary
+ case symbol_kind::S_undefined: // undefined
+ case symbol_kind::S_objectId: // objectId
+ case symbol_kind::S_bool: // bool
+ case symbol_kind::S_date: // date
+ case symbol_kind::S_null: // null
+ case symbol_kind::S_regex: // regex
+ case symbol_kind::S_simpleValue: // simpleValue
+ case symbol_kind::S_compoundValue: // compoundValue
+ case symbol_kind::S_valueArray: // valueArray
+ case symbol_kind::S_valueObject: // valueObject
+ case symbol_kind::S_valueFields: // valueFields
+ case symbol_kind::S_variable: // variable
+ case symbol_kind::S_pipeline: // pipeline
+ case symbol_kind::S_stageList: // stageList
+ case symbol_kind::S_stage: // stage
+ case symbol_kind::S_inhibitOptimization: // inhibitOptimization
+ case symbol_kind::S_unionWith: // unionWith
+ case symbol_kind::S_skip: // skip
+ case symbol_kind::S_limit: // limit
+ case symbol_kind::S_project: // project
+ case symbol_kind::S_sample: // sample
+ case symbol_kind::S_projectFields: // projectFields
+ case symbol_kind::S_projection: // projection
+ case symbol_kind::S_num: // num
+ case symbol_kind::S_expression: // expression
+ case symbol_kind::S_compoundExpression: // compoundExpression
+ case symbol_kind::S_exprFixedTwoArg: // exprFixedTwoArg
+ case symbol_kind::S_expressionArray: // expressionArray
+ case symbol_kind::S_expressionObject: // expressionObject
+ case symbol_kind::S_expressionFields: // expressionFields
+ case symbol_kind::S_maths: // maths
+ case symbol_kind::S_add: // add
+ case symbol_kind::S_atan2: // atan2
+ case symbol_kind::S_boolExps: // boolExps
+ case symbol_kind::S_and: // and
+ case symbol_kind::S_or: // or
+ case symbol_kind::S_not: // not
+ case symbol_kind::S_literalEscapes: // literalEscapes
+ case symbol_kind::S_const: // const
+ case symbol_kind::S_literal: // literal
+ case symbol_kind::S_stringExps: // stringExps
+ case symbol_kind::S_concat: // concat
+ case symbol_kind::S_dateFromString: // dateFromString
+ case symbol_kind::S_dateToString: // dateToString
+ case symbol_kind::S_indexOfBytes: // indexOfBytes
+ case symbol_kind::S_indexOfCP: // indexOfCP
+ case symbol_kind::S_ltrim: // ltrim
+ case symbol_kind::S_regexFind: // regexFind
+ case symbol_kind::S_regexFindAll: // regexFindAll
+ case symbol_kind::S_regexMatch: // regexMatch
+ case symbol_kind::S_regexArgs: // regexArgs
+ case symbol_kind::S_replaceOne: // replaceOne
+ case symbol_kind::S_replaceAll: // replaceAll
+ case symbol_kind::S_rtrim: // rtrim
+ case symbol_kind::S_split: // split
+ case symbol_kind::S_strLenBytes: // strLenBytes
+ case symbol_kind::S_strLenCP: // strLenCP
+ case symbol_kind::S_strcasecmp: // strcasecmp
+ case symbol_kind::S_substr: // substr
+ case symbol_kind::S_substrBytes: // substrBytes
+ case symbol_kind::S_substrCP: // substrCP
+ case symbol_kind::S_toLower: // toLower
+ case symbol_kind::S_toUpper: // toUpper
+ case symbol_kind::S_trim: // trim
+ case symbol_kind::S_compExprs: // compExprs
+ case symbol_kind::S_cmp: // cmp
+ case symbol_kind::S_eq: // eq
+ case symbol_kind::S_gt: // gt
+ case symbol_kind::S_gte: // gte
+ case symbol_kind::S_lt: // lt
+ case symbol_kind::S_lte: // lte
+ case symbol_kind::S_ne: // ne
+ case symbol_kind::S_typeExpression: // typeExpression
+ case symbol_kind::S_convert: // convert
+ case symbol_kind::S_toBool: // toBool
+ case symbol_kind::S_toDate: // toDate
+ case symbol_kind::S_toDecimal: // toDecimal
+ case symbol_kind::S_toDouble: // toDouble
+ case symbol_kind::S_toInt: // toInt
+ case symbol_kind::S_toLong: // toLong
+ case symbol_kind::S_toObjectId: // toObjectId
+ case symbol_kind::S_toString: // toString
+ case symbol_kind::S_type: // type
+ case symbol_kind::S_abs: // abs
+ case symbol_kind::S_ceil: // ceil
+ case symbol_kind::S_divide: // divide
+ case symbol_kind::S_exponent: // exponent
+ case symbol_kind::S_floor: // floor
+ case symbol_kind::S_ln: // ln
+ case symbol_kind::S_log: // log
+ case symbol_kind::S_logten: // logten
+ case symbol_kind::S_mod: // mod
+ case symbol_kind::S_multiply: // multiply
+ case symbol_kind::S_pow: // pow
+ case symbol_kind::S_round: // round
+ case symbol_kind::S_sqrt: // sqrt
+ case symbol_kind::S_subtract: // subtract
+ case symbol_kind::S_trunc: // trunc
+ case symbol_kind::S_matchExpression: // matchExpression
+ case symbol_kind::S_filterFields: // filterFields
+ case symbol_kind::S_filterVal: // filterVal
+ case symbol_kind::S_sortSpecs: // sortSpecs
+ case symbol_kind::S_specList: // specList
+ case symbol_kind::S_metaSort: // metaSort
+ case symbol_kind::S_oneOrNegOne: // oneOrNegOne
+ case symbol_kind::S_metaSortKeyword: // metaSortKeyword
value.YY_MOVE_OR_COPY<CNode>(YY_MOVE(that.value));
break;
- case 122: // projectionFieldname
- case 123: // expressionFieldname
- case 124: // stageAsUserFieldname
- case 125: // filterFieldname
- case 126: // argAsUserFieldname
- case 127: // aggExprAsUserFieldname
- case 128: // invariableUserFieldname
- case 129: // idAsUserFieldname
- case 130: // valueFieldname
+ case symbol_kind::S_projectionFieldname: // projectionFieldname
+ case symbol_kind::S_expressionFieldname: // expressionFieldname
+ case symbol_kind::S_stageAsUserFieldname: // stageAsUserFieldname
+ case symbol_kind::S_filterFieldname: // filterFieldname
+ case symbol_kind::S_argAsUserFieldname: // argAsUserFieldname
+ case symbol_kind::S_aggExprAsUserFieldname: // aggExprAsUserFieldname
+ case symbol_kind::S_invariableUserFieldname: // invariableUserFieldname
+ case symbol_kind::S_idAsUserFieldname: // idAsUserFieldname
+ case symbol_kind::S_valueFieldname: // valueFieldname
value.YY_MOVE_OR_COPY<CNode::Fieldname>(YY_MOVE(that.value));
break;
- case 102: // "Date"
+ case symbol_kind::S_DATE_LITERAL: // "Date"
value.YY_MOVE_OR_COPY<Date_t>(YY_MOVE(that.value));
break;
- case 112: // "non-zero decimal"
+ case symbol_kind::S_DECIMAL_OTHER: // "arbitrary decimal"
value.YY_MOVE_OR_COPY<Decimal128>(YY_MOVE(that.value));
break;
- case 101: // "ObjectID"
+ case symbol_kind::S_OBJECT_ID: // "ObjectID"
value.YY_MOVE_OR_COPY<OID>(YY_MOVE(that.value));
break;
- case 113: // "Timestamp"
+ case symbol_kind::S_TIMESTAMP: // "Timestamp"
value.YY_MOVE_OR_COPY<Timestamp>(YY_MOVE(that.value));
break;
- case 115: // "maxKey"
+ case symbol_kind::S_MAX_KEY: // "maxKey"
value.YY_MOVE_OR_COPY<UserMaxKey>(YY_MOVE(that.value));
break;
- case 114: // "minKey"
+ case symbol_kind::S_MIN_KEY: // "minKey"
value.YY_MOVE_OR_COPY<UserMinKey>(YY_MOVE(that.value));
break;
- case 103: // "null"
+ case symbol_kind::S_JSNULL: // "null"
value.YY_MOVE_OR_COPY<UserNull>(YY_MOVE(that.value));
break;
- case 100: // "undefined"
+ case symbol_kind::S_UNDEFINED: // "undefined"
value.YY_MOVE_OR_COPY<UserUndefined>(YY_MOVE(that.value));
break;
- case 111: // "non-zero double"
+ case symbol_kind::S_DOUBLE_OTHER: // "arbitrary double"
value.YY_MOVE_OR_COPY<double>(YY_MOVE(that.value));
break;
- case 109: // "non-zero integer"
+ case symbol_kind::S_INT_OTHER: // "arbitrary integer"
value.YY_MOVE_OR_COPY<int>(YY_MOVE(that.value));
break;
- case 110: // "non-zero long"
+ case symbol_kind::S_LONG_OTHER: // "arbitrary long"
value.YY_MOVE_OR_COPY<long long>(YY_MOVE(that.value));
break;
- case 131: // projectField
- case 132: // expressionField
- case 133: // valueField
- case 134: // filterField
- case 248: // onErrorArg
- case 249: // onNullArg
- case 250: // formatArg
- case 251: // timezoneArg
- case 252: // charsArg
- case 253: // optionsArg
+ case symbol_kind::S_projectField: // projectField
+ case symbol_kind::S_expressionField: // expressionField
+ case symbol_kind::S_valueField: // valueField
+ case symbol_kind::S_filterField: // filterField
+ case symbol_kind::S_onErrorArg: // onErrorArg
+ case symbol_kind::S_onNullArg: // onNullArg
+ case symbol_kind::S_formatArg: // formatArg
+ case symbol_kind::S_timezoneArg: // timezoneArg
+ case symbol_kind::S_charsArg: // charsArg
+ case symbol_kind::S_optionsArg: // optionsArg
+ case symbol_kind::S_sortSpec: // sortSpec
value.YY_MOVE_OR_COPY<std::pair<CNode::Fieldname, CNode>>(YY_MOVE(that.value));
break;
- case 97: // "fieldname"
- case 98: // "string"
- case 116: // "$-prefixed string"
- case 117: // "$$-prefixed string"
- case 118: // "$-prefixed fieldname"
+ case symbol_kind::S_FIELDNAME: // "fieldname"
+ case symbol_kind::S_STRING: // "string"
+ case symbol_kind::S_DOLLAR_STRING: // "$-prefixed string"
+ case symbol_kind::S_DOLLAR_DOLLAR_STRING: // "$$-prefixed string"
+ case symbol_kind::S_DOLLAR_PREF_FIELDNAME: // "$-prefixed fieldname"
value.YY_MOVE_OR_COPY<std::string>(YY_MOVE(that.value));
break;
- case 254: // expressions
- case 255: // values
- case 256: // exprZeroToTwo
+ case symbol_kind::S_expressions: // expressions
+ case symbol_kind::S_values: // values
+ case symbol_kind::S_exprZeroToTwo: // exprZeroToTwo
value.YY_MOVE_OR_COPY<std::vector<CNode>>(YY_MOVE(that.value));
break;
@@ -478,230 +448,236 @@ PipelineParserGen::stack_symbol_type::stack_symbol_type(YY_RVREF(stack_symbol_ty
PipelineParserGen::stack_symbol_type::stack_symbol_type(state_type s, YY_MOVE_REF(symbol_type) that)
: super_type(s, YY_MOVE(that.location)) {
- switch (that.type_get()) {
- case 99: // "BinData"
+ switch (that.kind()) {
+ case symbol_kind::S_BINARY: // "BinData"
value.move<BSONBinData>(YY_MOVE(that.value));
break;
- case 106: // "Code"
+ case symbol_kind::S_JAVASCRIPT: // "Code"
value.move<BSONCode>(YY_MOVE(that.value));
break;
- case 108: // "CodeWScope"
+ case symbol_kind::S_JAVASCRIPT_W_SCOPE: // "CodeWScope"
value.move<BSONCodeWScope>(YY_MOVE(that.value));
break;
- case 105: // "dbPointer"
+ case symbol_kind::S_DB_POINTER: // "dbPointer"
value.move<BSONDBRef>(YY_MOVE(that.value));
break;
- case 104: // "regex"
+ case symbol_kind::S_REGEX: // "regex"
value.move<BSONRegEx>(YY_MOVE(that.value));
break;
- case 107: // "Symbol"
+ case symbol_kind::S_SYMBOL: // "Symbol"
value.move<BSONSymbol>(YY_MOVE(that.value));
break;
- case 135: // dbPointer
- case 136: // javascript
- case 137: // symbol
- case 138: // javascriptWScope
- case 139: // int
- case 140: // timestamp
- case 141: // long
- case 142: // double
- case 143: // decimal
- case 144: // minKey
- case 145: // maxKey
- case 146: // value
- case 147: // string
- case 148: // fieldPath
- case 149: // binary
- case 150: // undefined
- case 151: // objectId
- case 152: // bool
- case 153: // date
- case 154: // null
- case 155: // regex
- case 156: // simpleValue
- case 157: // compoundValue
- case 158: // valueArray
- case 159: // valueObject
- case 160: // valueFields
- case 161: // variable
- case 162: // pipeline
- case 163: // stageList
- case 164: // stage
- case 165: // inhibitOptimization
- case 166: // unionWith
- case 167: // skip
- case 168: // limit
- case 169: // project
- case 170: // sample
- case 171: // projectFields
- case 172: // projection
- case 173: // num
- case 174: // expression
- case 175: // compoundExpression
- case 176: // exprFixedTwoArg
- case 177: // expressionArray
- case 178: // expressionObject
- case 179: // expressionFields
- case 180: // maths
- case 181: // add
- case 182: // atan2
- case 183: // boolExps
- case 184: // and
- case 185: // or
- case 186: // not
- case 187: // literalEscapes
- case 188: // const
- case 189: // literal
- case 190: // stringExps
- case 191: // concat
- case 192: // dateFromString
- case 193: // dateToString
- case 194: // indexOfBytes
- case 195: // indexOfCP
- case 196: // ltrim
- case 197: // regexFind
- case 198: // regexFindAll
- case 199: // regexMatch
- case 200: // regexArgs
- case 201: // replaceOne
- case 202: // replaceAll
- case 203: // rtrim
- case 204: // split
- case 205: // strLenBytes
- case 206: // strLenCP
- case 207: // strcasecmp
- case 208: // substr
- case 209: // substrBytes
- case 210: // substrCP
- case 211: // toLower
- case 212: // toUpper
- case 213: // trim
- case 214: // compExprs
- case 215: // cmp
- case 216: // eq
- case 217: // gt
- case 218: // gte
- case 219: // lt
- case 220: // lte
- case 221: // ne
- case 222: // typeExpression
- case 223: // convert
- case 224: // toBool
- case 225: // toDate
- case 226: // toDecimal
- case 227: // toDouble
- case 228: // toInt
- case 229: // toLong
- case 230: // toObjectId
- case 231: // toString
- case 232: // type
- case 233: // abs
- case 234: // ceil
- case 235: // divide
- case 236: // exponent
- case 237: // floor
- case 238: // ln
- case 239: // log
- case 240: // logten
- case 241: // mod
- case 242: // multiply
- case 243: // pow
- case 244: // round
- case 245: // sqrt
- case 246: // subtract
- case 247: // trunc
- case 257: // matchExpression
- case 258: // filterFields
- case 259: // filterVal
+ case symbol_kind::S_dbPointer: // dbPointer
+ case symbol_kind::S_javascript: // javascript
+ case symbol_kind::S_symbol: // symbol
+ case symbol_kind::S_javascriptWScope: // javascriptWScope
+ case symbol_kind::S_int: // int
+ case symbol_kind::S_timestamp: // timestamp
+ case symbol_kind::S_long: // long
+ case symbol_kind::S_double: // double
+ case symbol_kind::S_decimal: // decimal
+ case symbol_kind::S_minKey: // minKey
+ case symbol_kind::S_maxKey: // maxKey
+ case symbol_kind::S_value: // value
+ case symbol_kind::S_string: // string
+ case symbol_kind::S_fieldPath: // fieldPath
+ case symbol_kind::S_binary: // binary
+ case symbol_kind::S_undefined: // undefined
+ case symbol_kind::S_objectId: // objectId
+ case symbol_kind::S_bool: // bool
+ case symbol_kind::S_date: // date
+ case symbol_kind::S_null: // null
+ case symbol_kind::S_regex: // regex
+ case symbol_kind::S_simpleValue: // simpleValue
+ case symbol_kind::S_compoundValue: // compoundValue
+ case symbol_kind::S_valueArray: // valueArray
+ case symbol_kind::S_valueObject: // valueObject
+ case symbol_kind::S_valueFields: // valueFields
+ case symbol_kind::S_variable: // variable
+ case symbol_kind::S_pipeline: // pipeline
+ case symbol_kind::S_stageList: // stageList
+ case symbol_kind::S_stage: // stage
+ case symbol_kind::S_inhibitOptimization: // inhibitOptimization
+ case symbol_kind::S_unionWith: // unionWith
+ case symbol_kind::S_skip: // skip
+ case symbol_kind::S_limit: // limit
+ case symbol_kind::S_project: // project
+ case symbol_kind::S_sample: // sample
+ case symbol_kind::S_projectFields: // projectFields
+ case symbol_kind::S_projection: // projection
+ case symbol_kind::S_num: // num
+ case symbol_kind::S_expression: // expression
+ case symbol_kind::S_compoundExpression: // compoundExpression
+ case symbol_kind::S_exprFixedTwoArg: // exprFixedTwoArg
+ case symbol_kind::S_expressionArray: // expressionArray
+ case symbol_kind::S_expressionObject: // expressionObject
+ case symbol_kind::S_expressionFields: // expressionFields
+ case symbol_kind::S_maths: // maths
+ case symbol_kind::S_add: // add
+ case symbol_kind::S_atan2: // atan2
+ case symbol_kind::S_boolExps: // boolExps
+ case symbol_kind::S_and: // and
+ case symbol_kind::S_or: // or
+ case symbol_kind::S_not: // not
+ case symbol_kind::S_literalEscapes: // literalEscapes
+ case symbol_kind::S_const: // const
+ case symbol_kind::S_literal: // literal
+ case symbol_kind::S_stringExps: // stringExps
+ case symbol_kind::S_concat: // concat
+ case symbol_kind::S_dateFromString: // dateFromString
+ case symbol_kind::S_dateToString: // dateToString
+ case symbol_kind::S_indexOfBytes: // indexOfBytes
+ case symbol_kind::S_indexOfCP: // indexOfCP
+ case symbol_kind::S_ltrim: // ltrim
+ case symbol_kind::S_regexFind: // regexFind
+ case symbol_kind::S_regexFindAll: // regexFindAll
+ case symbol_kind::S_regexMatch: // regexMatch
+ case symbol_kind::S_regexArgs: // regexArgs
+ case symbol_kind::S_replaceOne: // replaceOne
+ case symbol_kind::S_replaceAll: // replaceAll
+ case symbol_kind::S_rtrim: // rtrim
+ case symbol_kind::S_split: // split
+ case symbol_kind::S_strLenBytes: // strLenBytes
+ case symbol_kind::S_strLenCP: // strLenCP
+ case symbol_kind::S_strcasecmp: // strcasecmp
+ case symbol_kind::S_substr: // substr
+ case symbol_kind::S_substrBytes: // substrBytes
+ case symbol_kind::S_substrCP: // substrCP
+ case symbol_kind::S_toLower: // toLower
+ case symbol_kind::S_toUpper: // toUpper
+ case symbol_kind::S_trim: // trim
+ case symbol_kind::S_compExprs: // compExprs
+ case symbol_kind::S_cmp: // cmp
+ case symbol_kind::S_eq: // eq
+ case symbol_kind::S_gt: // gt
+ case symbol_kind::S_gte: // gte
+ case symbol_kind::S_lt: // lt
+ case symbol_kind::S_lte: // lte
+ case symbol_kind::S_ne: // ne
+ case symbol_kind::S_typeExpression: // typeExpression
+ case symbol_kind::S_convert: // convert
+ case symbol_kind::S_toBool: // toBool
+ case symbol_kind::S_toDate: // toDate
+ case symbol_kind::S_toDecimal: // toDecimal
+ case symbol_kind::S_toDouble: // toDouble
+ case symbol_kind::S_toInt: // toInt
+ case symbol_kind::S_toLong: // toLong
+ case symbol_kind::S_toObjectId: // toObjectId
+ case symbol_kind::S_toString: // toString
+ case symbol_kind::S_type: // type
+ case symbol_kind::S_abs: // abs
+ case symbol_kind::S_ceil: // ceil
+ case symbol_kind::S_divide: // divide
+ case symbol_kind::S_exponent: // exponent
+ case symbol_kind::S_floor: // floor
+ case symbol_kind::S_ln: // ln
+ case symbol_kind::S_log: // log
+ case symbol_kind::S_logten: // logten
+ case symbol_kind::S_mod: // mod
+ case symbol_kind::S_multiply: // multiply
+ case symbol_kind::S_pow: // pow
+ case symbol_kind::S_round: // round
+ case symbol_kind::S_sqrt: // sqrt
+ case symbol_kind::S_subtract: // subtract
+ case symbol_kind::S_trunc: // trunc
+ case symbol_kind::S_matchExpression: // matchExpression
+ case symbol_kind::S_filterFields: // filterFields
+ case symbol_kind::S_filterVal: // filterVal
+ case symbol_kind::S_sortSpecs: // sortSpecs
+ case symbol_kind::S_specList: // specList
+ case symbol_kind::S_metaSort: // metaSort
+ case symbol_kind::S_oneOrNegOne: // oneOrNegOne
+ case symbol_kind::S_metaSortKeyword: // metaSortKeyword
value.move<CNode>(YY_MOVE(that.value));
break;
- case 122: // projectionFieldname
- case 123: // expressionFieldname
- case 124: // stageAsUserFieldname
- case 125: // filterFieldname
- case 126: // argAsUserFieldname
- case 127: // aggExprAsUserFieldname
- case 128: // invariableUserFieldname
- case 129: // idAsUserFieldname
- case 130: // valueFieldname
+ case symbol_kind::S_projectionFieldname: // projectionFieldname
+ case symbol_kind::S_expressionFieldname: // expressionFieldname
+ case symbol_kind::S_stageAsUserFieldname: // stageAsUserFieldname
+ case symbol_kind::S_filterFieldname: // filterFieldname
+ case symbol_kind::S_argAsUserFieldname: // argAsUserFieldname
+ case symbol_kind::S_aggExprAsUserFieldname: // aggExprAsUserFieldname
+ case symbol_kind::S_invariableUserFieldname: // invariableUserFieldname
+ case symbol_kind::S_idAsUserFieldname: // idAsUserFieldname
+ case symbol_kind::S_valueFieldname: // valueFieldname
value.move<CNode::Fieldname>(YY_MOVE(that.value));
break;
- case 102: // "Date"
+ case symbol_kind::S_DATE_LITERAL: // "Date"
value.move<Date_t>(YY_MOVE(that.value));
break;
- case 112: // "non-zero decimal"
+ case symbol_kind::S_DECIMAL_OTHER: // "arbitrary decimal"
value.move<Decimal128>(YY_MOVE(that.value));
break;
- case 101: // "ObjectID"
+ case symbol_kind::S_OBJECT_ID: // "ObjectID"
value.move<OID>(YY_MOVE(that.value));
break;
- case 113: // "Timestamp"
+ case symbol_kind::S_TIMESTAMP: // "Timestamp"
value.move<Timestamp>(YY_MOVE(that.value));
break;
- case 115: // "maxKey"
+ case symbol_kind::S_MAX_KEY: // "maxKey"
value.move<UserMaxKey>(YY_MOVE(that.value));
break;
- case 114: // "minKey"
+ case symbol_kind::S_MIN_KEY: // "minKey"
value.move<UserMinKey>(YY_MOVE(that.value));
break;
- case 103: // "null"
+ case symbol_kind::S_JSNULL: // "null"
value.move<UserNull>(YY_MOVE(that.value));
break;
- case 100: // "undefined"
+ case symbol_kind::S_UNDEFINED: // "undefined"
value.move<UserUndefined>(YY_MOVE(that.value));
break;
- case 111: // "non-zero double"
+ case symbol_kind::S_DOUBLE_OTHER: // "arbitrary double"
value.move<double>(YY_MOVE(that.value));
break;
- case 109: // "non-zero integer"
+ case symbol_kind::S_INT_OTHER: // "arbitrary integer"
value.move<int>(YY_MOVE(that.value));
break;
- case 110: // "non-zero long"
+ case symbol_kind::S_LONG_OTHER: // "arbitrary long"
value.move<long long>(YY_MOVE(that.value));
break;
- case 131: // projectField
- case 132: // expressionField
- case 133: // valueField
- case 134: // filterField
- case 248: // onErrorArg
- case 249: // onNullArg
- case 250: // formatArg
- case 251: // timezoneArg
- case 252: // charsArg
- case 253: // optionsArg
+ case symbol_kind::S_projectField: // projectField
+ case symbol_kind::S_expressionField: // expressionField
+ case symbol_kind::S_valueField: // valueField
+ case symbol_kind::S_filterField: // filterField
+ case symbol_kind::S_onErrorArg: // onErrorArg
+ case symbol_kind::S_onNullArg: // onNullArg
+ case symbol_kind::S_formatArg: // formatArg
+ case symbol_kind::S_timezoneArg: // timezoneArg
+ case symbol_kind::S_charsArg: // charsArg
+ case symbol_kind::S_optionsArg: // optionsArg
+ case symbol_kind::S_sortSpec: // sortSpec
value.move<std::pair<CNode::Fieldname, CNode>>(YY_MOVE(that.value));
break;
- case 97: // "fieldname"
- case 98: // "string"
- case 116: // "$-prefixed string"
- case 117: // "$$-prefixed string"
- case 118: // "$-prefixed fieldname"
+ case symbol_kind::S_FIELDNAME: // "fieldname"
+ case symbol_kind::S_STRING: // "string"
+ case symbol_kind::S_DOLLAR_STRING: // "$-prefixed string"
+ case symbol_kind::S_DOLLAR_DOLLAR_STRING: // "$$-prefixed string"
+ case symbol_kind::S_DOLLAR_PREF_FIELDNAME: // "$-prefixed fieldname"
value.move<std::string>(YY_MOVE(that.value));
break;
- case 254: // expressions
- case 255: // values
- case 256: // exprZeroToTwo
+ case symbol_kind::S_expressions: // expressions
+ case symbol_kind::S_values: // values
+ case symbol_kind::S_exprZeroToTwo: // exprZeroToTwo
value.move<std::vector<CNode>>(YY_MOVE(that.value));
break;
@@ -710,237 +686,243 @@ PipelineParserGen::stack_symbol_type::stack_symbol_type(state_type s, YY_MOVE_RE
}
// that is emptied.
- that.type = empty_symbol;
+ that.kind_ = symbol_kind::S_YYEMPTY;
}
#if YY_CPLUSPLUS < 201103L
PipelineParserGen::stack_symbol_type& PipelineParserGen::stack_symbol_type::operator=(
const stack_symbol_type& that) {
state = that.state;
- switch (that.type_get()) {
- case 99: // "BinData"
+ switch (that.kind()) {
+ case symbol_kind::S_BINARY: // "BinData"
value.copy<BSONBinData>(that.value);
break;
- case 106: // "Code"
+ case symbol_kind::S_JAVASCRIPT: // "Code"
value.copy<BSONCode>(that.value);
break;
- case 108: // "CodeWScope"
+ case symbol_kind::S_JAVASCRIPT_W_SCOPE: // "CodeWScope"
value.copy<BSONCodeWScope>(that.value);
break;
- case 105: // "dbPointer"
+ case symbol_kind::S_DB_POINTER: // "dbPointer"
value.copy<BSONDBRef>(that.value);
break;
- case 104: // "regex"
+ case symbol_kind::S_REGEX: // "regex"
value.copy<BSONRegEx>(that.value);
break;
- case 107: // "Symbol"
+ case symbol_kind::S_SYMBOL: // "Symbol"
value.copy<BSONSymbol>(that.value);
break;
- case 135: // dbPointer
- case 136: // javascript
- case 137: // symbol
- case 138: // javascriptWScope
- case 139: // int
- case 140: // timestamp
- case 141: // long
- case 142: // double
- case 143: // decimal
- case 144: // minKey
- case 145: // maxKey
- case 146: // value
- case 147: // string
- case 148: // fieldPath
- case 149: // binary
- case 150: // undefined
- case 151: // objectId
- case 152: // bool
- case 153: // date
- case 154: // null
- case 155: // regex
- case 156: // simpleValue
- case 157: // compoundValue
- case 158: // valueArray
- case 159: // valueObject
- case 160: // valueFields
- case 161: // variable
- case 162: // pipeline
- case 163: // stageList
- case 164: // stage
- case 165: // inhibitOptimization
- case 166: // unionWith
- case 167: // skip
- case 168: // limit
- case 169: // project
- case 170: // sample
- case 171: // projectFields
- case 172: // projection
- case 173: // num
- case 174: // expression
- case 175: // compoundExpression
- case 176: // exprFixedTwoArg
- case 177: // expressionArray
- case 178: // expressionObject
- case 179: // expressionFields
- case 180: // maths
- case 181: // add
- case 182: // atan2
- case 183: // boolExps
- case 184: // and
- case 185: // or
- case 186: // not
- case 187: // literalEscapes
- case 188: // const
- case 189: // literal
- case 190: // stringExps
- case 191: // concat
- case 192: // dateFromString
- case 193: // dateToString
- case 194: // indexOfBytes
- case 195: // indexOfCP
- case 196: // ltrim
- case 197: // regexFind
- case 198: // regexFindAll
- case 199: // regexMatch
- case 200: // regexArgs
- case 201: // replaceOne
- case 202: // replaceAll
- case 203: // rtrim
- case 204: // split
- case 205: // strLenBytes
- case 206: // strLenCP
- case 207: // strcasecmp
- case 208: // substr
- case 209: // substrBytes
- case 210: // substrCP
- case 211: // toLower
- case 212: // toUpper
- case 213: // trim
- case 214: // compExprs
- case 215: // cmp
- case 216: // eq
- case 217: // gt
- case 218: // gte
- case 219: // lt
- case 220: // lte
- case 221: // ne
- case 222: // typeExpression
- case 223: // convert
- case 224: // toBool
- case 225: // toDate
- case 226: // toDecimal
- case 227: // toDouble
- case 228: // toInt
- case 229: // toLong
- case 230: // toObjectId
- case 231: // toString
- case 232: // type
- case 233: // abs
- case 234: // ceil
- case 235: // divide
- case 236: // exponent
- case 237: // floor
- case 238: // ln
- case 239: // log
- case 240: // logten
- case 241: // mod
- case 242: // multiply
- case 243: // pow
- case 244: // round
- case 245: // sqrt
- case 246: // subtract
- case 247: // trunc
- case 257: // matchExpression
- case 258: // filterFields
- case 259: // filterVal
+ case symbol_kind::S_dbPointer: // dbPointer
+ case symbol_kind::S_javascript: // javascript
+ case symbol_kind::S_symbol: // symbol
+ case symbol_kind::S_javascriptWScope: // javascriptWScope
+ case symbol_kind::S_int: // int
+ case symbol_kind::S_timestamp: // timestamp
+ case symbol_kind::S_long: // long
+ case symbol_kind::S_double: // double
+ case symbol_kind::S_decimal: // decimal
+ case symbol_kind::S_minKey: // minKey
+ case symbol_kind::S_maxKey: // maxKey
+ case symbol_kind::S_value: // value
+ case symbol_kind::S_string: // string
+ case symbol_kind::S_fieldPath: // fieldPath
+ case symbol_kind::S_binary: // binary
+ case symbol_kind::S_undefined: // undefined
+ case symbol_kind::S_objectId: // objectId
+ case symbol_kind::S_bool: // bool
+ case symbol_kind::S_date: // date
+ case symbol_kind::S_null: // null
+ case symbol_kind::S_regex: // regex
+ case symbol_kind::S_simpleValue: // simpleValue
+ case symbol_kind::S_compoundValue: // compoundValue
+ case symbol_kind::S_valueArray: // valueArray
+ case symbol_kind::S_valueObject: // valueObject
+ case symbol_kind::S_valueFields: // valueFields
+ case symbol_kind::S_variable: // variable
+ case symbol_kind::S_pipeline: // pipeline
+ case symbol_kind::S_stageList: // stageList
+ case symbol_kind::S_stage: // stage
+ case symbol_kind::S_inhibitOptimization: // inhibitOptimization
+ case symbol_kind::S_unionWith: // unionWith
+ case symbol_kind::S_skip: // skip
+ case symbol_kind::S_limit: // limit
+ case symbol_kind::S_project: // project
+ case symbol_kind::S_sample: // sample
+ case symbol_kind::S_projectFields: // projectFields
+ case symbol_kind::S_projection: // projection
+ case symbol_kind::S_num: // num
+ case symbol_kind::S_expression: // expression
+ case symbol_kind::S_compoundExpression: // compoundExpression
+ case symbol_kind::S_exprFixedTwoArg: // exprFixedTwoArg
+ case symbol_kind::S_expressionArray: // expressionArray
+ case symbol_kind::S_expressionObject: // expressionObject
+ case symbol_kind::S_expressionFields: // expressionFields
+ case symbol_kind::S_maths: // maths
+ case symbol_kind::S_add: // add
+ case symbol_kind::S_atan2: // atan2
+ case symbol_kind::S_boolExps: // boolExps
+ case symbol_kind::S_and: // and
+ case symbol_kind::S_or: // or
+ case symbol_kind::S_not: // not
+ case symbol_kind::S_literalEscapes: // literalEscapes
+ case symbol_kind::S_const: // const
+ case symbol_kind::S_literal: // literal
+ case symbol_kind::S_stringExps: // stringExps
+ case symbol_kind::S_concat: // concat
+ case symbol_kind::S_dateFromString: // dateFromString
+ case symbol_kind::S_dateToString: // dateToString
+ case symbol_kind::S_indexOfBytes: // indexOfBytes
+ case symbol_kind::S_indexOfCP: // indexOfCP
+ case symbol_kind::S_ltrim: // ltrim
+ case symbol_kind::S_regexFind: // regexFind
+ case symbol_kind::S_regexFindAll: // regexFindAll
+ case symbol_kind::S_regexMatch: // regexMatch
+ case symbol_kind::S_regexArgs: // regexArgs
+ case symbol_kind::S_replaceOne: // replaceOne
+ case symbol_kind::S_replaceAll: // replaceAll
+ case symbol_kind::S_rtrim: // rtrim
+ case symbol_kind::S_split: // split
+ case symbol_kind::S_strLenBytes: // strLenBytes
+ case symbol_kind::S_strLenCP: // strLenCP
+ case symbol_kind::S_strcasecmp: // strcasecmp
+ case symbol_kind::S_substr: // substr
+ case symbol_kind::S_substrBytes: // substrBytes
+ case symbol_kind::S_substrCP: // substrCP
+ case symbol_kind::S_toLower: // toLower
+ case symbol_kind::S_toUpper: // toUpper
+ case symbol_kind::S_trim: // trim
+ case symbol_kind::S_compExprs: // compExprs
+ case symbol_kind::S_cmp: // cmp
+ case symbol_kind::S_eq: // eq
+ case symbol_kind::S_gt: // gt
+ case symbol_kind::S_gte: // gte
+ case symbol_kind::S_lt: // lt
+ case symbol_kind::S_lte: // lte
+ case symbol_kind::S_ne: // ne
+ case symbol_kind::S_typeExpression: // typeExpression
+ case symbol_kind::S_convert: // convert
+ case symbol_kind::S_toBool: // toBool
+ case symbol_kind::S_toDate: // toDate
+ case symbol_kind::S_toDecimal: // toDecimal
+ case symbol_kind::S_toDouble: // toDouble
+ case symbol_kind::S_toInt: // toInt
+ case symbol_kind::S_toLong: // toLong
+ case symbol_kind::S_toObjectId: // toObjectId
+ case symbol_kind::S_toString: // toString
+ case symbol_kind::S_type: // type
+ case symbol_kind::S_abs: // abs
+ case symbol_kind::S_ceil: // ceil
+ case symbol_kind::S_divide: // divide
+ case symbol_kind::S_exponent: // exponent
+ case symbol_kind::S_floor: // floor
+ case symbol_kind::S_ln: // ln
+ case symbol_kind::S_log: // log
+ case symbol_kind::S_logten: // logten
+ case symbol_kind::S_mod: // mod
+ case symbol_kind::S_multiply: // multiply
+ case symbol_kind::S_pow: // pow
+ case symbol_kind::S_round: // round
+ case symbol_kind::S_sqrt: // sqrt
+ case symbol_kind::S_subtract: // subtract
+ case symbol_kind::S_trunc: // trunc
+ case symbol_kind::S_matchExpression: // matchExpression
+ case symbol_kind::S_filterFields: // filterFields
+ case symbol_kind::S_filterVal: // filterVal
+ case symbol_kind::S_sortSpecs: // sortSpecs
+ case symbol_kind::S_specList: // specList
+ case symbol_kind::S_metaSort: // metaSort
+ case symbol_kind::S_oneOrNegOne: // oneOrNegOne
+ case symbol_kind::S_metaSortKeyword: // metaSortKeyword
value.copy<CNode>(that.value);
break;
- case 122: // projectionFieldname
- case 123: // expressionFieldname
- case 124: // stageAsUserFieldname
- case 125: // filterFieldname
- case 126: // argAsUserFieldname
- case 127: // aggExprAsUserFieldname
- case 128: // invariableUserFieldname
- case 129: // idAsUserFieldname
- case 130: // valueFieldname
+ case symbol_kind::S_projectionFieldname: // projectionFieldname
+ case symbol_kind::S_expressionFieldname: // expressionFieldname
+ case symbol_kind::S_stageAsUserFieldname: // stageAsUserFieldname
+ case symbol_kind::S_filterFieldname: // filterFieldname
+ case symbol_kind::S_argAsUserFieldname: // argAsUserFieldname
+ case symbol_kind::S_aggExprAsUserFieldname: // aggExprAsUserFieldname
+ case symbol_kind::S_invariableUserFieldname: // invariableUserFieldname
+ case symbol_kind::S_idAsUserFieldname: // idAsUserFieldname
+ case symbol_kind::S_valueFieldname: // valueFieldname
value.copy<CNode::Fieldname>(that.value);
break;
- case 102: // "Date"
+ case symbol_kind::S_DATE_LITERAL: // "Date"
value.copy<Date_t>(that.value);
break;
- case 112: // "non-zero decimal"
+ case symbol_kind::S_DECIMAL_OTHER: // "arbitrary decimal"
value.copy<Decimal128>(that.value);
break;
- case 101: // "ObjectID"
+ case symbol_kind::S_OBJECT_ID: // "ObjectID"
value.copy<OID>(that.value);
break;
- case 113: // "Timestamp"
+ case symbol_kind::S_TIMESTAMP: // "Timestamp"
value.copy<Timestamp>(that.value);
break;
- case 115: // "maxKey"
+ case symbol_kind::S_MAX_KEY: // "maxKey"
value.copy<UserMaxKey>(that.value);
break;
- case 114: // "minKey"
+ case symbol_kind::S_MIN_KEY: // "minKey"
value.copy<UserMinKey>(that.value);
break;
- case 103: // "null"
+ case symbol_kind::S_JSNULL: // "null"
value.copy<UserNull>(that.value);
break;
- case 100: // "undefined"
+ case symbol_kind::S_UNDEFINED: // "undefined"
value.copy<UserUndefined>(that.value);
break;
- case 111: // "non-zero double"
+ case symbol_kind::S_DOUBLE_OTHER: // "arbitrary double"
value.copy<double>(that.value);
break;
- case 109: // "non-zero integer"
+ case symbol_kind::S_INT_OTHER: // "arbitrary integer"
value.copy<int>(that.value);
break;
- case 110: // "non-zero long"
+ case symbol_kind::S_LONG_OTHER: // "arbitrary long"
value.copy<long long>(that.value);
break;
- case 131: // projectField
- case 132: // expressionField
- case 133: // valueField
- case 134: // filterField
- case 248: // onErrorArg
- case 249: // onNullArg
- case 250: // formatArg
- case 251: // timezoneArg
- case 252: // charsArg
- case 253: // optionsArg
+ case symbol_kind::S_projectField: // projectField
+ case symbol_kind::S_expressionField: // expressionField
+ case symbol_kind::S_valueField: // valueField
+ case symbol_kind::S_filterField: // filterField
+ case symbol_kind::S_onErrorArg: // onErrorArg
+ case symbol_kind::S_onNullArg: // onNullArg
+ case symbol_kind::S_formatArg: // formatArg
+ case symbol_kind::S_timezoneArg: // timezoneArg
+ case symbol_kind::S_charsArg: // charsArg
+ case symbol_kind::S_optionsArg: // optionsArg
+ case symbol_kind::S_sortSpec: // sortSpec
value.copy<std::pair<CNode::Fieldname, CNode>>(that.value);
break;
- case 97: // "fieldname"
- case 98: // "string"
- case 116: // "$-prefixed string"
- case 117: // "$$-prefixed string"
- case 118: // "$-prefixed fieldname"
+ case symbol_kind::S_FIELDNAME: // "fieldname"
+ case symbol_kind::S_STRING: // "string"
+ case symbol_kind::S_DOLLAR_STRING: // "$-prefixed string"
+ case symbol_kind::S_DOLLAR_DOLLAR_STRING: // "$$-prefixed string"
+ case symbol_kind::S_DOLLAR_PREF_FIELDNAME: // "$-prefixed fieldname"
value.copy<std::string>(that.value);
break;
- case 254: // expressions
- case 255: // values
- case 256: // exprZeroToTwo
+ case symbol_kind::S_expressions: // expressions
+ case symbol_kind::S_values: // values
+ case symbol_kind::S_exprZeroToTwo: // exprZeroToTwo
value.copy<std::vector<CNode>>(that.value);
break;
@@ -955,230 +937,236 @@ PipelineParserGen::stack_symbol_type& PipelineParserGen::stack_symbol_type::oper
PipelineParserGen::stack_symbol_type& PipelineParserGen::stack_symbol_type::operator=(
stack_symbol_type& that) {
state = that.state;
- switch (that.type_get()) {
- case 99: // "BinData"
+ switch (that.kind()) {
+ case symbol_kind::S_BINARY: // "BinData"
value.move<BSONBinData>(that.value);
break;
- case 106: // "Code"
+ case symbol_kind::S_JAVASCRIPT: // "Code"
value.move<BSONCode>(that.value);
break;
- case 108: // "CodeWScope"
+ case symbol_kind::S_JAVASCRIPT_W_SCOPE: // "CodeWScope"
value.move<BSONCodeWScope>(that.value);
break;
- case 105: // "dbPointer"
+ case symbol_kind::S_DB_POINTER: // "dbPointer"
value.move<BSONDBRef>(that.value);
break;
- case 104: // "regex"
+ case symbol_kind::S_REGEX: // "regex"
value.move<BSONRegEx>(that.value);
break;
- case 107: // "Symbol"
+ case symbol_kind::S_SYMBOL: // "Symbol"
value.move<BSONSymbol>(that.value);
break;
- case 135: // dbPointer
- case 136: // javascript
- case 137: // symbol
- case 138: // javascriptWScope
- case 139: // int
- case 140: // timestamp
- case 141: // long
- case 142: // double
- case 143: // decimal
- case 144: // minKey
- case 145: // maxKey
- case 146: // value
- case 147: // string
- case 148: // fieldPath
- case 149: // binary
- case 150: // undefined
- case 151: // objectId
- case 152: // bool
- case 153: // date
- case 154: // null
- case 155: // regex
- case 156: // simpleValue
- case 157: // compoundValue
- case 158: // valueArray
- case 159: // valueObject
- case 160: // valueFields
- case 161: // variable
- case 162: // pipeline
- case 163: // stageList
- case 164: // stage
- case 165: // inhibitOptimization
- case 166: // unionWith
- case 167: // skip
- case 168: // limit
- case 169: // project
- case 170: // sample
- case 171: // projectFields
- case 172: // projection
- case 173: // num
- case 174: // expression
- case 175: // compoundExpression
- case 176: // exprFixedTwoArg
- case 177: // expressionArray
- case 178: // expressionObject
- case 179: // expressionFields
- case 180: // maths
- case 181: // add
- case 182: // atan2
- case 183: // boolExps
- case 184: // and
- case 185: // or
- case 186: // not
- case 187: // literalEscapes
- case 188: // const
- case 189: // literal
- case 190: // stringExps
- case 191: // concat
- case 192: // dateFromString
- case 193: // dateToString
- case 194: // indexOfBytes
- case 195: // indexOfCP
- case 196: // ltrim
- case 197: // regexFind
- case 198: // regexFindAll
- case 199: // regexMatch
- case 200: // regexArgs
- case 201: // replaceOne
- case 202: // replaceAll
- case 203: // rtrim
- case 204: // split
- case 205: // strLenBytes
- case 206: // strLenCP
- case 207: // strcasecmp
- case 208: // substr
- case 209: // substrBytes
- case 210: // substrCP
- case 211: // toLower
- case 212: // toUpper
- case 213: // trim
- case 214: // compExprs
- case 215: // cmp
- case 216: // eq
- case 217: // gt
- case 218: // gte
- case 219: // lt
- case 220: // lte
- case 221: // ne
- case 222: // typeExpression
- case 223: // convert
- case 224: // toBool
- case 225: // toDate
- case 226: // toDecimal
- case 227: // toDouble
- case 228: // toInt
- case 229: // toLong
- case 230: // toObjectId
- case 231: // toString
- case 232: // type
- case 233: // abs
- case 234: // ceil
- case 235: // divide
- case 236: // exponent
- case 237: // floor
- case 238: // ln
- case 239: // log
- case 240: // logten
- case 241: // mod
- case 242: // multiply
- case 243: // pow
- case 244: // round
- case 245: // sqrt
- case 246: // subtract
- case 247: // trunc
- case 257: // matchExpression
- case 258: // filterFields
- case 259: // filterVal
+ case symbol_kind::S_dbPointer: // dbPointer
+ case symbol_kind::S_javascript: // javascript
+ case symbol_kind::S_symbol: // symbol
+ case symbol_kind::S_javascriptWScope: // javascriptWScope
+ case symbol_kind::S_int: // int
+ case symbol_kind::S_timestamp: // timestamp
+ case symbol_kind::S_long: // long
+ case symbol_kind::S_double: // double
+ case symbol_kind::S_decimal: // decimal
+ case symbol_kind::S_minKey: // minKey
+ case symbol_kind::S_maxKey: // maxKey
+ case symbol_kind::S_value: // value
+ case symbol_kind::S_string: // string
+ case symbol_kind::S_fieldPath: // fieldPath
+ case symbol_kind::S_binary: // binary
+ case symbol_kind::S_undefined: // undefined
+ case symbol_kind::S_objectId: // objectId
+ case symbol_kind::S_bool: // bool
+ case symbol_kind::S_date: // date
+ case symbol_kind::S_null: // null
+ case symbol_kind::S_regex: // regex
+ case symbol_kind::S_simpleValue: // simpleValue
+ case symbol_kind::S_compoundValue: // compoundValue
+ case symbol_kind::S_valueArray: // valueArray
+ case symbol_kind::S_valueObject: // valueObject
+ case symbol_kind::S_valueFields: // valueFields
+ case symbol_kind::S_variable: // variable
+ case symbol_kind::S_pipeline: // pipeline
+ case symbol_kind::S_stageList: // stageList
+ case symbol_kind::S_stage: // stage
+ case symbol_kind::S_inhibitOptimization: // inhibitOptimization
+ case symbol_kind::S_unionWith: // unionWith
+ case symbol_kind::S_skip: // skip
+ case symbol_kind::S_limit: // limit
+ case symbol_kind::S_project: // project
+ case symbol_kind::S_sample: // sample
+ case symbol_kind::S_projectFields: // projectFields
+ case symbol_kind::S_projection: // projection
+ case symbol_kind::S_num: // num
+ case symbol_kind::S_expression: // expression
+ case symbol_kind::S_compoundExpression: // compoundExpression
+ case symbol_kind::S_exprFixedTwoArg: // exprFixedTwoArg
+ case symbol_kind::S_expressionArray: // expressionArray
+ case symbol_kind::S_expressionObject: // expressionObject
+ case symbol_kind::S_expressionFields: // expressionFields
+ case symbol_kind::S_maths: // maths
+ case symbol_kind::S_add: // add
+ case symbol_kind::S_atan2: // atan2
+ case symbol_kind::S_boolExps: // boolExps
+ case symbol_kind::S_and: // and
+ case symbol_kind::S_or: // or
+ case symbol_kind::S_not: // not
+ case symbol_kind::S_literalEscapes: // literalEscapes
+ case symbol_kind::S_const: // const
+ case symbol_kind::S_literal: // literal
+ case symbol_kind::S_stringExps: // stringExps
+ case symbol_kind::S_concat: // concat
+ case symbol_kind::S_dateFromString: // dateFromString
+ case symbol_kind::S_dateToString: // dateToString
+ case symbol_kind::S_indexOfBytes: // indexOfBytes
+ case symbol_kind::S_indexOfCP: // indexOfCP
+ case symbol_kind::S_ltrim: // ltrim
+ case symbol_kind::S_regexFind: // regexFind
+ case symbol_kind::S_regexFindAll: // regexFindAll
+ case symbol_kind::S_regexMatch: // regexMatch
+ case symbol_kind::S_regexArgs: // regexArgs
+ case symbol_kind::S_replaceOne: // replaceOne
+ case symbol_kind::S_replaceAll: // replaceAll
+ case symbol_kind::S_rtrim: // rtrim
+ case symbol_kind::S_split: // split
+ case symbol_kind::S_strLenBytes: // strLenBytes
+ case symbol_kind::S_strLenCP: // strLenCP
+ case symbol_kind::S_strcasecmp: // strcasecmp
+ case symbol_kind::S_substr: // substr
+ case symbol_kind::S_substrBytes: // substrBytes
+ case symbol_kind::S_substrCP: // substrCP
+ case symbol_kind::S_toLower: // toLower
+ case symbol_kind::S_toUpper: // toUpper
+ case symbol_kind::S_trim: // trim
+ case symbol_kind::S_compExprs: // compExprs
+ case symbol_kind::S_cmp: // cmp
+ case symbol_kind::S_eq: // eq
+ case symbol_kind::S_gt: // gt
+ case symbol_kind::S_gte: // gte
+ case symbol_kind::S_lt: // lt
+ case symbol_kind::S_lte: // lte
+ case symbol_kind::S_ne: // ne
+ case symbol_kind::S_typeExpression: // typeExpression
+ case symbol_kind::S_convert: // convert
+ case symbol_kind::S_toBool: // toBool
+ case symbol_kind::S_toDate: // toDate
+ case symbol_kind::S_toDecimal: // toDecimal
+ case symbol_kind::S_toDouble: // toDouble
+ case symbol_kind::S_toInt: // toInt
+ case symbol_kind::S_toLong: // toLong
+ case symbol_kind::S_toObjectId: // toObjectId
+ case symbol_kind::S_toString: // toString
+ case symbol_kind::S_type: // type
+ case symbol_kind::S_abs: // abs
+ case symbol_kind::S_ceil: // ceil
+ case symbol_kind::S_divide: // divide
+ case symbol_kind::S_exponent: // exponent
+ case symbol_kind::S_floor: // floor
+ case symbol_kind::S_ln: // ln
+ case symbol_kind::S_log: // log
+ case symbol_kind::S_logten: // logten
+ case symbol_kind::S_mod: // mod
+ case symbol_kind::S_multiply: // multiply
+ case symbol_kind::S_pow: // pow
+ case symbol_kind::S_round: // round
+ case symbol_kind::S_sqrt: // sqrt
+ case symbol_kind::S_subtract: // subtract
+ case symbol_kind::S_trunc: // trunc
+ case symbol_kind::S_matchExpression: // matchExpression
+ case symbol_kind::S_filterFields: // filterFields
+ case symbol_kind::S_filterVal: // filterVal
+ case symbol_kind::S_sortSpecs: // sortSpecs
+ case symbol_kind::S_specList: // specList
+ case symbol_kind::S_metaSort: // metaSort
+ case symbol_kind::S_oneOrNegOne: // oneOrNegOne
+ case symbol_kind::S_metaSortKeyword: // metaSortKeyword
value.move<CNode>(that.value);
break;
- case 122: // projectionFieldname
- case 123: // expressionFieldname
- case 124: // stageAsUserFieldname
- case 125: // filterFieldname
- case 126: // argAsUserFieldname
- case 127: // aggExprAsUserFieldname
- case 128: // invariableUserFieldname
- case 129: // idAsUserFieldname
- case 130: // valueFieldname
+ case symbol_kind::S_projectionFieldname: // projectionFieldname
+ case symbol_kind::S_expressionFieldname: // expressionFieldname
+ case symbol_kind::S_stageAsUserFieldname: // stageAsUserFieldname
+ case symbol_kind::S_filterFieldname: // filterFieldname
+ case symbol_kind::S_argAsUserFieldname: // argAsUserFieldname
+ case symbol_kind::S_aggExprAsUserFieldname: // aggExprAsUserFieldname
+ case symbol_kind::S_invariableUserFieldname: // invariableUserFieldname
+ case symbol_kind::S_idAsUserFieldname: // idAsUserFieldname
+ case symbol_kind::S_valueFieldname: // valueFieldname
value.move<CNode::Fieldname>(that.value);
break;
- case 102: // "Date"
+ case symbol_kind::S_DATE_LITERAL: // "Date"
value.move<Date_t>(that.value);
break;
- case 112: // "non-zero decimal"
+ case symbol_kind::S_DECIMAL_OTHER: // "arbitrary decimal"
value.move<Decimal128>(that.value);
break;
- case 101: // "ObjectID"
+ case symbol_kind::S_OBJECT_ID: // "ObjectID"
value.move<OID>(that.value);
break;
- case 113: // "Timestamp"
+ case symbol_kind::S_TIMESTAMP: // "Timestamp"
value.move<Timestamp>(that.value);
break;
- case 115: // "maxKey"
+ case symbol_kind::S_MAX_KEY: // "maxKey"
value.move<UserMaxKey>(that.value);
break;
- case 114: // "minKey"
+ case symbol_kind::S_MIN_KEY: // "minKey"
value.move<UserMinKey>(that.value);
break;
- case 103: // "null"
+ case symbol_kind::S_JSNULL: // "null"
value.move<UserNull>(that.value);
break;
- case 100: // "undefined"
+ case symbol_kind::S_UNDEFINED: // "undefined"
value.move<UserUndefined>(that.value);
break;
- case 111: // "non-zero double"
+ case symbol_kind::S_DOUBLE_OTHER: // "arbitrary double"
value.move<double>(that.value);
break;
- case 109: // "non-zero integer"
+ case symbol_kind::S_INT_OTHER: // "arbitrary integer"
value.move<int>(that.value);
break;
- case 110: // "non-zero long"
+ case symbol_kind::S_LONG_OTHER: // "arbitrary long"
value.move<long long>(that.value);
break;
- case 131: // projectField
- case 132: // expressionField
- case 133: // valueField
- case 134: // filterField
- case 248: // onErrorArg
- case 249: // onNullArg
- case 250: // formatArg
- case 251: // timezoneArg
- case 252: // charsArg
- case 253: // optionsArg
+ case symbol_kind::S_projectField: // projectField
+ case symbol_kind::S_expressionField: // expressionField
+ case symbol_kind::S_valueField: // valueField
+ case symbol_kind::S_filterField: // filterField
+ case symbol_kind::S_onErrorArg: // onErrorArg
+ case symbol_kind::S_onNullArg: // onNullArg
+ case symbol_kind::S_formatArg: // formatArg
+ case symbol_kind::S_timezoneArg: // timezoneArg
+ case symbol_kind::S_charsArg: // charsArg
+ case symbol_kind::S_optionsArg: // optionsArg
+ case symbol_kind::S_sortSpec: // sortSpec
value.move<std::pair<CNode::Fieldname, CNode>>(that.value);
break;
- case 97: // "fieldname"
- case 98: // "string"
- case 116: // "$-prefixed string"
- case 117: // "$$-prefixed string"
- case 118: // "$-prefixed fieldname"
+ case symbol_kind::S_FIELDNAME: // "fieldname"
+ case symbol_kind::S_STRING: // "string"
+ case symbol_kind::S_DOLLAR_STRING: // "$-prefixed string"
+ case symbol_kind::S_DOLLAR_DOLLAR_STRING: // "$$-prefixed string"
+ case symbol_kind::S_DOLLAR_PREF_FIELDNAME: // "$-prefixed fieldname"
value.move<std::string>(that.value);
break;
- case 254: // expressions
- case 255: // values
- case 256: // exprZeroToTwo
+ case symbol_kind::S_expressions: // expressions
+ case symbol_kind::S_values: // values
+ case symbol_kind::S_exprZeroToTwo: // exprZeroToTwo
value.move<std::vector<CNode>>(that.value);
break;
@@ -1204,18 +1192,15 @@ template <typename Base>
void PipelineParserGen::yy_print_(std::ostream& yyo, const basic_symbol<Base>& yysym) const {
std::ostream& yyoutput = yyo;
YYUSE(yyoutput);
- symbol_number_type yytype = yysym.type_get();
-#if defined __GNUC__ && !defined __clang__ && !defined __ICC && \
- __GNUC__ * 100 + __GNUC_MINOR__ <= 408
- // Avoid a (spurious) G++ 4.8 warning about "array subscript is
- // below array bounds".
if (yysym.empty())
- std::abort();
-#endif
- yyo << (yytype < yyntokens_ ? "token" : "nterm") << ' ' << yytname_[yytype] << " ("
- << yysym.location << ": ";
- YYUSE(yytype);
- yyo << ')';
+ yyo << "empty symbol";
+ else {
+ symbol_kind_type yykind = yysym.kind();
+ yyo << (yykind < YYNTOKENS ? "token" : "nterm") << ' ' << yysym.name() << " ("
+ << yysym.location << ": ";
+ YYUSE(yykind);
+ yyo << ')';
+ }
}
#endif
@@ -1258,11 +1243,11 @@ void PipelineParserGen::set_debug_level(debug_level_type l) {
#endif // YYDEBUG
PipelineParserGen::state_type PipelineParserGen::yy_lr_goto_state_(state_type yystate, int yysym) {
- int yyr = yypgoto_[yysym - yyntokens_] + yystate;
+ int yyr = yypgoto_[yysym - YYNTOKENS] + yystate;
if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate)
return yytable_[yyr];
else
- return yydefgoto_[yysym - yyntokens_];
+ return yydefgoto_[yysym - YYNTOKENS];
}
bool PipelineParserGen::yy_pact_value_is_default_(int yyvalue) {
@@ -1314,6 +1299,7 @@ int PipelineParserGen::parse() {
`-----------------------------------------------*/
yynewstate:
YYCDEBUG << "Entering state " << int(yystack_[0].state) << '\n';
+ YY_STACK_PRINT();
// Accept?
if (yystack_[0].state == yyfinal_)
@@ -1333,7 +1319,7 @@ int PipelineParserGen::parse() {
// Read a lookahead token.
if (yyla.empty()) {
- YYCDEBUG << "Reading a token: ";
+ YYCDEBUG << "Reading a token\n";
#if YY_EXCEPTIONS
try
#endif // YY_EXCEPTIONS
@@ -1351,10 +1337,19 @@ int PipelineParserGen::parse() {
}
YY_SYMBOL_PRINT("Next token is", yyla);
+ if (yyla.kind() == symbol_kind::S_YYerror) {
+ // The scanner already issued an error message, process directly
+ // to error recovery. But do not keep the error token as
+ // lookahead, it is too special and may lead us to an endless
+ // loop in error recovery. */
+ yyla.kind_ = symbol_kind::S_YYUNDEF;
+ goto yyerrlab1;
+ }
+
/* If the proper action on seeing token YYLA.TYPE is to reduce or
to detect an error, take that action. */
- yyn += yyla.type_get();
- if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.type_get()) {
+ yyn += yyla.kind();
+ if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.kind()) {
goto yydefault;
}
@@ -1398,229 +1393,235 @@ int PipelineParserGen::parse() {
correct type. The default '$$ = $1' action is NOT applied
when using variants. */
switch (yyr1_[yyn]) {
- case 99: // "BinData"
+ case symbol_kind::S_BINARY: // "BinData"
yylhs.value.emplace<BSONBinData>();
break;
- case 106: // "Code"
+ case symbol_kind::S_JAVASCRIPT: // "Code"
yylhs.value.emplace<BSONCode>();
break;
- case 108: // "CodeWScope"
+ case symbol_kind::S_JAVASCRIPT_W_SCOPE: // "CodeWScope"
yylhs.value.emplace<BSONCodeWScope>();
break;
- case 105: // "dbPointer"
+ case symbol_kind::S_DB_POINTER: // "dbPointer"
yylhs.value.emplace<BSONDBRef>();
break;
- case 104: // "regex"
+ case symbol_kind::S_REGEX: // "regex"
yylhs.value.emplace<BSONRegEx>();
break;
- case 107: // "Symbol"
+ case symbol_kind::S_SYMBOL: // "Symbol"
yylhs.value.emplace<BSONSymbol>();
break;
- case 135: // dbPointer
- case 136: // javascript
- case 137: // symbol
- case 138: // javascriptWScope
- case 139: // int
- case 140: // timestamp
- case 141: // long
- case 142: // double
- case 143: // decimal
- case 144: // minKey
- case 145: // maxKey
- case 146: // value
- case 147: // string
- case 148: // fieldPath
- case 149: // binary
- case 150: // undefined
- case 151: // objectId
- case 152: // bool
- case 153: // date
- case 154: // null
- case 155: // regex
- case 156: // simpleValue
- case 157: // compoundValue
- case 158: // valueArray
- case 159: // valueObject
- case 160: // valueFields
- case 161: // variable
- case 162: // pipeline
- case 163: // stageList
- case 164: // stage
- case 165: // inhibitOptimization
- case 166: // unionWith
- case 167: // skip
- case 168: // limit
- case 169: // project
- case 170: // sample
- case 171: // projectFields
- case 172: // projection
- case 173: // num
- case 174: // expression
- case 175: // compoundExpression
- case 176: // exprFixedTwoArg
- case 177: // expressionArray
- case 178: // expressionObject
- case 179: // expressionFields
- case 180: // maths
- case 181: // add
- case 182: // atan2
- case 183: // boolExps
- case 184: // and
- case 185: // or
- case 186: // not
- case 187: // literalEscapes
- case 188: // const
- case 189: // literal
- case 190: // stringExps
- case 191: // concat
- case 192: // dateFromString
- case 193: // dateToString
- case 194: // indexOfBytes
- case 195: // indexOfCP
- case 196: // ltrim
- case 197: // regexFind
- case 198: // regexFindAll
- case 199: // regexMatch
- case 200: // regexArgs
- case 201: // replaceOne
- case 202: // replaceAll
- case 203: // rtrim
- case 204: // split
- case 205: // strLenBytes
- case 206: // strLenCP
- case 207: // strcasecmp
- case 208: // substr
- case 209: // substrBytes
- case 210: // substrCP
- case 211: // toLower
- case 212: // toUpper
- case 213: // trim
- case 214: // compExprs
- case 215: // cmp
- case 216: // eq
- case 217: // gt
- case 218: // gte
- case 219: // lt
- case 220: // lte
- case 221: // ne
- case 222: // typeExpression
- case 223: // convert
- case 224: // toBool
- case 225: // toDate
- case 226: // toDecimal
- case 227: // toDouble
- case 228: // toInt
- case 229: // toLong
- case 230: // toObjectId
- case 231: // toString
- case 232: // type
- case 233: // abs
- case 234: // ceil
- case 235: // divide
- case 236: // exponent
- case 237: // floor
- case 238: // ln
- case 239: // log
- case 240: // logten
- case 241: // mod
- case 242: // multiply
- case 243: // pow
- case 244: // round
- case 245: // sqrt
- case 246: // subtract
- case 247: // trunc
- case 257: // matchExpression
- case 258: // filterFields
- case 259: // filterVal
+ case symbol_kind::S_dbPointer: // dbPointer
+ case symbol_kind::S_javascript: // javascript
+ case symbol_kind::S_symbol: // symbol
+ case symbol_kind::S_javascriptWScope: // javascriptWScope
+ case symbol_kind::S_int: // int
+ case symbol_kind::S_timestamp: // timestamp
+ case symbol_kind::S_long: // long
+ case symbol_kind::S_double: // double
+ case symbol_kind::S_decimal: // decimal
+ case symbol_kind::S_minKey: // minKey
+ case symbol_kind::S_maxKey: // maxKey
+ case symbol_kind::S_value: // value
+ case symbol_kind::S_string: // string
+ case symbol_kind::S_fieldPath: // fieldPath
+ case symbol_kind::S_binary: // binary
+ case symbol_kind::S_undefined: // undefined
+ case symbol_kind::S_objectId: // objectId
+ case symbol_kind::S_bool: // bool
+ case symbol_kind::S_date: // date
+ case symbol_kind::S_null: // null
+ case symbol_kind::S_regex: // regex
+ case symbol_kind::S_simpleValue: // simpleValue
+ case symbol_kind::S_compoundValue: // compoundValue
+ case symbol_kind::S_valueArray: // valueArray
+ case symbol_kind::S_valueObject: // valueObject
+ case symbol_kind::S_valueFields: // valueFields
+ case symbol_kind::S_variable: // variable
+ case symbol_kind::S_pipeline: // pipeline
+ case symbol_kind::S_stageList: // stageList
+ case symbol_kind::S_stage: // stage
+ case symbol_kind::S_inhibitOptimization: // inhibitOptimization
+ case symbol_kind::S_unionWith: // unionWith
+ case symbol_kind::S_skip: // skip
+ case symbol_kind::S_limit: // limit
+ case symbol_kind::S_project: // project
+ case symbol_kind::S_sample: // sample
+ case symbol_kind::S_projectFields: // projectFields
+ case symbol_kind::S_projection: // projection
+ case symbol_kind::S_num: // num
+ case symbol_kind::S_expression: // expression
+ case symbol_kind::S_compoundExpression: // compoundExpression
+ case symbol_kind::S_exprFixedTwoArg: // exprFixedTwoArg
+ case symbol_kind::S_expressionArray: // expressionArray
+ case symbol_kind::S_expressionObject: // expressionObject
+ case symbol_kind::S_expressionFields: // expressionFields
+ case symbol_kind::S_maths: // maths
+ case symbol_kind::S_add: // add
+ case symbol_kind::S_atan2: // atan2
+ case symbol_kind::S_boolExps: // boolExps
+ case symbol_kind::S_and: // and
+ case symbol_kind::S_or: // or
+ case symbol_kind::S_not: // not
+ case symbol_kind::S_literalEscapes: // literalEscapes
+ case symbol_kind::S_const: // const
+ case symbol_kind::S_literal: // literal
+ case symbol_kind::S_stringExps: // stringExps
+ case symbol_kind::S_concat: // concat
+ case symbol_kind::S_dateFromString: // dateFromString
+ case symbol_kind::S_dateToString: // dateToString
+ case symbol_kind::S_indexOfBytes: // indexOfBytes
+ case symbol_kind::S_indexOfCP: // indexOfCP
+ case symbol_kind::S_ltrim: // ltrim
+ case symbol_kind::S_regexFind: // regexFind
+ case symbol_kind::S_regexFindAll: // regexFindAll
+ case symbol_kind::S_regexMatch: // regexMatch
+ case symbol_kind::S_regexArgs: // regexArgs
+ case symbol_kind::S_replaceOne: // replaceOne
+ case symbol_kind::S_replaceAll: // replaceAll
+ case symbol_kind::S_rtrim: // rtrim
+ case symbol_kind::S_split: // split
+ case symbol_kind::S_strLenBytes: // strLenBytes
+ case symbol_kind::S_strLenCP: // strLenCP
+ case symbol_kind::S_strcasecmp: // strcasecmp
+ case symbol_kind::S_substr: // substr
+ case symbol_kind::S_substrBytes: // substrBytes
+ case symbol_kind::S_substrCP: // substrCP
+ case symbol_kind::S_toLower: // toLower
+ case symbol_kind::S_toUpper: // toUpper
+ case symbol_kind::S_trim: // trim
+ case symbol_kind::S_compExprs: // compExprs
+ case symbol_kind::S_cmp: // cmp
+ case symbol_kind::S_eq: // eq
+ case symbol_kind::S_gt: // gt
+ case symbol_kind::S_gte: // gte
+ case symbol_kind::S_lt: // lt
+ case symbol_kind::S_lte: // lte
+ case symbol_kind::S_ne: // ne
+ case symbol_kind::S_typeExpression: // typeExpression
+ case symbol_kind::S_convert: // convert
+ case symbol_kind::S_toBool: // toBool
+ case symbol_kind::S_toDate: // toDate
+ case symbol_kind::S_toDecimal: // toDecimal
+ case symbol_kind::S_toDouble: // toDouble
+ case symbol_kind::S_toInt: // toInt
+ case symbol_kind::S_toLong: // toLong
+ case symbol_kind::S_toObjectId: // toObjectId
+ case symbol_kind::S_toString: // toString
+ case symbol_kind::S_type: // type
+ case symbol_kind::S_abs: // abs
+ case symbol_kind::S_ceil: // ceil
+ case symbol_kind::S_divide: // divide
+ case symbol_kind::S_exponent: // exponent
+ case symbol_kind::S_floor: // floor
+ case symbol_kind::S_ln: // ln
+ case symbol_kind::S_log: // log
+ case symbol_kind::S_logten: // logten
+ case symbol_kind::S_mod: // mod
+ case symbol_kind::S_multiply: // multiply
+ case symbol_kind::S_pow: // pow
+ case symbol_kind::S_round: // round
+ case symbol_kind::S_sqrt: // sqrt
+ case symbol_kind::S_subtract: // subtract
+ case symbol_kind::S_trunc: // trunc
+ case symbol_kind::S_matchExpression: // matchExpression
+ case symbol_kind::S_filterFields: // filterFields
+ case symbol_kind::S_filterVal: // filterVal
+ case symbol_kind::S_sortSpecs: // sortSpecs
+ case symbol_kind::S_specList: // specList
+ case symbol_kind::S_metaSort: // metaSort
+ case symbol_kind::S_oneOrNegOne: // oneOrNegOne
+ case symbol_kind::S_metaSortKeyword: // metaSortKeyword
yylhs.value.emplace<CNode>();
break;
- case 122: // projectionFieldname
- case 123: // expressionFieldname
- case 124: // stageAsUserFieldname
- case 125: // filterFieldname
- case 126: // argAsUserFieldname
- case 127: // aggExprAsUserFieldname
- case 128: // invariableUserFieldname
- case 129: // idAsUserFieldname
- case 130: // valueFieldname
+ case symbol_kind::S_projectionFieldname: // projectionFieldname
+ case symbol_kind::S_expressionFieldname: // expressionFieldname
+ case symbol_kind::S_stageAsUserFieldname: // stageAsUserFieldname
+ case symbol_kind::S_filterFieldname: // filterFieldname
+ case symbol_kind::S_argAsUserFieldname: // argAsUserFieldname
+ case symbol_kind::S_aggExprAsUserFieldname: // aggExprAsUserFieldname
+ case symbol_kind::S_invariableUserFieldname: // invariableUserFieldname
+ case symbol_kind::S_idAsUserFieldname: // idAsUserFieldname
+ case symbol_kind::S_valueFieldname: // valueFieldname
yylhs.value.emplace<CNode::Fieldname>();
break;
- case 102: // "Date"
+ case symbol_kind::S_DATE_LITERAL: // "Date"
yylhs.value.emplace<Date_t>();
break;
- case 112: // "non-zero decimal"
+ case symbol_kind::S_DECIMAL_OTHER: // "arbitrary decimal"
yylhs.value.emplace<Decimal128>();
break;
- case 101: // "ObjectID"
+ case symbol_kind::S_OBJECT_ID: // "ObjectID"
yylhs.value.emplace<OID>();
break;
- case 113: // "Timestamp"
+ case symbol_kind::S_TIMESTAMP: // "Timestamp"
yylhs.value.emplace<Timestamp>();
break;
- case 115: // "maxKey"
+ case symbol_kind::S_MAX_KEY: // "maxKey"
yylhs.value.emplace<UserMaxKey>();
break;
- case 114: // "minKey"
+ case symbol_kind::S_MIN_KEY: // "minKey"
yylhs.value.emplace<UserMinKey>();
break;
- case 103: // "null"
+ case symbol_kind::S_JSNULL: // "null"
yylhs.value.emplace<UserNull>();
break;
- case 100: // "undefined"
+ case symbol_kind::S_UNDEFINED: // "undefined"
yylhs.value.emplace<UserUndefined>();
break;
- case 111: // "non-zero double"
+ case symbol_kind::S_DOUBLE_OTHER: // "arbitrary double"
yylhs.value.emplace<double>();
break;
- case 109: // "non-zero integer"
+ case symbol_kind::S_INT_OTHER: // "arbitrary integer"
yylhs.value.emplace<int>();
break;
- case 110: // "non-zero long"
+ case symbol_kind::S_LONG_OTHER: // "arbitrary long"
yylhs.value.emplace<long long>();
break;
- case 131: // projectField
- case 132: // expressionField
- case 133: // valueField
- case 134: // filterField
- case 248: // onErrorArg
- case 249: // onNullArg
- case 250: // formatArg
- case 251: // timezoneArg
- case 252: // charsArg
- case 253: // optionsArg
+ case symbol_kind::S_projectField: // projectField
+ case symbol_kind::S_expressionField: // expressionField
+ case symbol_kind::S_valueField: // valueField
+ case symbol_kind::S_filterField: // filterField
+ case symbol_kind::S_onErrorArg: // onErrorArg
+ case symbol_kind::S_onNullArg: // onNullArg
+ case symbol_kind::S_formatArg: // formatArg
+ case symbol_kind::S_timezoneArg: // timezoneArg
+ case symbol_kind::S_charsArg: // charsArg
+ case symbol_kind::S_optionsArg: // optionsArg
+ case symbol_kind::S_sortSpec: // sortSpec
yylhs.value.emplace<std::pair<CNode::Fieldname, CNode>>();
break;
- case 97: // "fieldname"
- case 98: // "string"
- case 116: // "$-prefixed string"
- case 117: // "$$-prefixed string"
- case 118: // "$-prefixed fieldname"
+ case symbol_kind::S_FIELDNAME: // "fieldname"
+ case symbol_kind::S_STRING: // "string"
+ case symbol_kind::S_DOLLAR_STRING: // "$-prefixed string"
+ case symbol_kind::S_DOLLAR_DOLLAR_STRING: // "$$-prefixed string"
+ case symbol_kind::S_DOLLAR_PREF_FIELDNAME: // "$-prefixed fieldname"
yylhs.value.emplace<std::string>();
break;
- case 254: // expressions
- case 255: // values
- case 256: // exprZeroToTwo
+ case symbol_kind::S_expressions: // expressions
+ case symbol_kind::S_values: // values
+ case symbol_kind::S_exprZeroToTwo: // exprZeroToTwo
yylhs.value.emplace<std::vector<CNode>>();
break;
@@ -1643,106 +1644,114 @@ int PipelineParserGen::parse() {
#endif // YY_EXCEPTIONS
{
switch (yyn) {
- case 2:
-#line 282 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 2: // start: START_PIPELINE pipeline
+#line 297 "pipeline_grammar.yy"
{
invariant(cst);
*cst = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 1720 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1719 "pipeline_parser_gen.cpp"
break;
- case 3:
-#line 286 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 3: // start: START_MATCH matchExpression
+#line 301 "pipeline_grammar.yy"
{
invariant(cst);
*cst = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 1729 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1728 "pipeline_parser_gen.cpp"
break;
- case 4:
-#line 294 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 4: // start: START_SORT sortSpecs
+#line 305 "pipeline_grammar.yy"
+ {
+ *cst = CNode{YY_MOVE(yystack_[0].value.as<CNode>())};
+ }
+#line 1736 "pipeline_parser_gen.cpp"
+ break;
+
+ case 5: // pipeline: "array" stageList "end of array"
+#line 312 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[1].value.as<CNode>());
}
-#line 1737 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1744 "pipeline_parser_gen.cpp"
break;
- case 5:
-#line 300 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 6: // stageList: %empty
+#line 318 "pipeline_grammar.yy"
{
}
-#line 1743 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1750 "pipeline_parser_gen.cpp"
break;
- case 6:
-#line 301 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 7: // stageList: "object" stage "end of object" stageList
+#line 319 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() =
CNode{CNode::ArrayChildren{YY_MOVE(yystack_[2].value.as<CNode>())}};
}
-#line 1751 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1758 "pipeline_parser_gen.cpp"
break;
- case 7:
-#line 309 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 8: // $@1: %empty
+#line 327 "pipeline_grammar.yy"
{
lexer.sortObjTokens();
}
-#line 1757 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1764 "pipeline_parser_gen.cpp"
break;
- case 9:
-#line 312 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 10: // stage: inhibitOptimization
+#line 330 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 1763 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1770 "pipeline_parser_gen.cpp"
break;
- case 10:
-#line 312 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 11: // stage: unionWith
+#line 330 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 1769 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1776 "pipeline_parser_gen.cpp"
break;
- case 11:
-#line 312 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 12: // stage: skip
+#line 330 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 1775 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1782 "pipeline_parser_gen.cpp"
break;
- case 12:
-#line 312 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 13: // stage: limit
+#line 330 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 1781 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1788 "pipeline_parser_gen.cpp"
break;
- case 13:
-#line 312 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 14: // stage: project
+#line 330 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 1787 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1794 "pipeline_parser_gen.cpp"
break;
- case 14:
-#line 312 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 15: // stage: sample
+#line 330 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 1793 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1800 "pipeline_parser_gen.cpp"
break;
- case 15:
-#line 315 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 16: // sample: STAGE_SAMPLE "object" "size argument" num "end of object"
+#line 333 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{std::pair{
KeyFieldname::sample,
@@ -1750,20 +1759,22 @@ int PipelineParserGen::parse() {
{KeyFieldname::sizeArg, YY_MOVE(yystack_[1].value.as<CNode>())},
}}}}};
}
-#line 1805 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1812 "pipeline_parser_gen.cpp"
break;
- case 16:
-#line 325 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 17: // inhibitOptimization: STAGE_INHIBIT_OPTIMIZATION "object" "end of
+ // object"
+#line 343 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
std::pair{KeyFieldname::inhibitOptimization, CNode::noopLeaf()}}};
}
-#line 1813 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1820 "pipeline_parser_gen.cpp"
break;
- case 17:
-#line 331 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 18: // unionWith: STAGE_UNION_WITH START_ORDERED_OBJECT "coll argument"
+ // string "pipeline argument" double "end of object"
+#line 349 "pipeline_grammar.yy"
{
auto pipeline = YY_MOVE(yystack_[1].value.as<CNode>());
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{std::pair{
@@ -1772,61 +1783,61 @@ int PipelineParserGen::parse() {
{KeyFieldname::collArg, YY_MOVE(yystack_[3].value.as<CNode>())},
{KeyFieldname::pipelineArg, std::move(pipeline)}}}}}};
}
-#line 1826 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1833 "pipeline_parser_gen.cpp"
break;
- case 18:
-#line 341 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 19: // num: int
+#line 359 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 1832 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1839 "pipeline_parser_gen.cpp"
break;
- case 19:
-#line 341 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 20: // num: long
+#line 359 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 1838 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1845 "pipeline_parser_gen.cpp"
break;
- case 20:
-#line 341 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 21: // num: double
+#line 359 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 1844 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1851 "pipeline_parser_gen.cpp"
break;
- case 21:
-#line 341 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 22: // num: decimal
+#line 359 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 1850 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1857 "pipeline_parser_gen.cpp"
break;
- case 22:
-#line 345 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 23: // skip: STAGE_SKIP num
+#line 363 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
std::pair{KeyFieldname::skip, YY_MOVE(yystack_[0].value.as<CNode>())}}};
}
-#line 1858 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1865 "pipeline_parser_gen.cpp"
break;
- case 23:
-#line 350 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 24: // limit: STAGE_LIMIT num
+#line 368 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{std::pair{
KeyFieldname::limit, YY_MOVE(yystack_[0].value.as<CNode>())}}};
}
-#line 1866 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1873 "pipeline_parser_gen.cpp"
break;
- case 24:
-#line 355 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 25: // project: STAGE_PROJECT "object" projectFields "end of object"
+#line 373 "pipeline_grammar.yy"
{
auto&& fields = YY_MOVE(yystack_[1].value.as<CNode>());
if (auto inclusion =
@@ -1842,244 +1853,308 @@ int PipelineParserGen::parse() {
// function.
error(yystack_[3].location, inclusion.getStatus().reason());
}
-#line 1884 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1891 "pipeline_parser_gen.cpp"
break;
- case 25:
-#line 371 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 26: // projectFields: %empty
+#line 389 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode::noopLeaf();
}
-#line 1892 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1899 "pipeline_parser_gen.cpp"
break;
- case 26:
-#line 374 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 27: // projectFields: projectFields projectField
+#line 392 "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 1901 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1908 "pipeline_parser_gen.cpp"
break;
- case 27:
-#line 381 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 28: // projectField: ID projection
+#line 399 "pipeline_grammar.yy"
{
yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = {
KeyFieldname::id, YY_MOVE(yystack_[0].value.as<CNode>())};
}
-#line 1909 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1916 "pipeline_parser_gen.cpp"
break;
- case 28:
-#line 384 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 29: // projectField: projectionFieldname projection
+#line 402 "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 1917 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1924 "pipeline_parser_gen.cpp"
break;
- case 29:
-#line 390 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 30: // projection: string
+#line 408 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 1923 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1930 "pipeline_parser_gen.cpp"
break;
- case 30:
-#line 391 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 31: // projection: binary
+#line 409 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 1929 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1936 "pipeline_parser_gen.cpp"
break;
- case 31:
-#line 392 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 32: // projection: undefined
+#line 410 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 1935 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1942 "pipeline_parser_gen.cpp"
break;
- case 32:
-#line 393 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 33: // projection: objectId
+#line 411 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 1941 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1948 "pipeline_parser_gen.cpp"
break;
- case 33:
-#line 394 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 34: // projection: date
+#line 412 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 1947 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1954 "pipeline_parser_gen.cpp"
break;
- case 34:
-#line 395 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 35: // projection: null
+#line 413 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 1953 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1960 "pipeline_parser_gen.cpp"
break;
- case 35:
-#line 396 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 36: // projection: regex
+#line 414 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 1959 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1966 "pipeline_parser_gen.cpp"
break;
- case 36:
-#line 397 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 37: // projection: dbPointer
+#line 415 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 1965 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1972 "pipeline_parser_gen.cpp"
break;
- case 37:
-#line 398 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 38: // projection: javascript
+#line 416 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 1971 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1978 "pipeline_parser_gen.cpp"
break;
- case 38:
-#line 399 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 39: // projection: symbol
+#line 417 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 1977 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1984 "pipeline_parser_gen.cpp"
break;
- case 39:
-#line 400 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 40: // projection: javascriptWScope
+#line 418 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 1983 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 1990 "pipeline_parser_gen.cpp"
+ break;
+
+ case 41: // projection: "1 (int)"
+#line 419 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{NonZeroKey{1}};
+ }
+#line 1998 "pipeline_parser_gen.cpp"
+ break;
+
+ case 42: // projection: "-1 (int)"
+#line 422 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{NonZeroKey{-1}};
+ }
+#line 2006 "pipeline_parser_gen.cpp"
break;
- case 40:
-#line 401 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 43: // projection: "arbitrary integer"
+#line 425 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() =
CNode{NonZeroKey{YY_MOVE(yystack_[0].value.as<int>())}};
}
-#line 1991 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2014 "pipeline_parser_gen.cpp"
break;
- case 41:
-#line 404 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 44: // projection: "zero (int)"
+#line 428 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{KeyValue::intZeroKey};
}
-#line 1999 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2022 "pipeline_parser_gen.cpp"
break;
- case 42:
-#line 407 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 45: // projection: "1 (long)"
+#line 431 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{NonZeroKey{1ll}};
+ }
+#line 2030 "pipeline_parser_gen.cpp"
+ break;
+
+ case 46: // projection: "-1 (long)"
+#line 434 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{NonZeroKey{-1ll}};
+ }
+#line 2038 "pipeline_parser_gen.cpp"
+ break;
+
+ case 47: // projection: "arbitrary long"
+#line 437 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() =
CNode{NonZeroKey{YY_MOVE(yystack_[0].value.as<long long>())}};
}
-#line 2007 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2046 "pipeline_parser_gen.cpp"
break;
- case 43:
-#line 410 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 48: // projection: "zero (long)"
+#line 440 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{KeyValue::longZeroKey};
}
-#line 2015 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2054 "pipeline_parser_gen.cpp"
+ break;
+
+ case 49: // projection: "1 (double)"
+#line 443 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{NonZeroKey{1.0}};
+ }
+#line 2062 "pipeline_parser_gen.cpp"
+ break;
+
+ case 50: // projection: "-1 (double)"
+#line 446 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{NonZeroKey{-1.0}};
+ }
+#line 2070 "pipeline_parser_gen.cpp"
break;
- case 44:
-#line 413 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 51: // projection: "arbitrary double"
+#line 449 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() =
CNode{NonZeroKey{YY_MOVE(yystack_[0].value.as<double>())}};
}
-#line 2023 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2078 "pipeline_parser_gen.cpp"
break;
- case 45:
-#line 416 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 52: // projection: "zero (double)"
+#line 452 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{KeyValue::doubleZeroKey};
}
-#line 2031 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2086 "pipeline_parser_gen.cpp"
+ break;
+
+ case 53: // projection: "1 (decimal)"
+#line 455 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{NonZeroKey{1.0}};
+ }
+#line 2094 "pipeline_parser_gen.cpp"
+ break;
+
+ case 54: // projection: "-1 (decimal)"
+#line 458 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{NonZeroKey{-1.0}};
+ }
+#line 2102 "pipeline_parser_gen.cpp"
break;
- case 46:
-#line 419 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 55: // projection: "arbitrary decimal"
+#line 461 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() =
CNode{NonZeroKey{YY_MOVE(yystack_[0].value.as<Decimal128>())}};
}
-#line 2039 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2110 "pipeline_parser_gen.cpp"
break;
- case 47:
-#line 422 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 56: // projection: "zero (decimal)"
+#line 464 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{KeyValue::decimalZeroKey};
}
-#line 2047 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2118 "pipeline_parser_gen.cpp"
break;
- case 48:
-#line 425 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 57: // projection: "true"
+#line 467 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{KeyValue::trueKey};
}
-#line 2055 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2126 "pipeline_parser_gen.cpp"
break;
- case 49:
-#line 428 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 58: // projection: "false"
+#line 470 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{KeyValue::falseKey};
}
-#line 2063 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2134 "pipeline_parser_gen.cpp"
break;
- case 50:
-#line 431 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 59: // projection: timestamp
+#line 473 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 2069 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2140 "pipeline_parser_gen.cpp"
break;
- case 51:
-#line 432 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 60: // projection: minKey
+#line 474 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 2075 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2146 "pipeline_parser_gen.cpp"
break;
- case 52:
-#line 433 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 61: // projection: maxKey
+#line 475 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 2081 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2152 "pipeline_parser_gen.cpp"
break;
- case 53:
-#line 434 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 62: // projection: compoundExpression
+#line 476 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() =
c_node_disambiguation::disambiguateCompoundProjection(
@@ -2091,801 +2166,825 @@ int PipelineParserGen::parse() {
"object project field cannot contain both inclusion and "
"exclusion indicators");
}
-#line 2092 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2163 "pipeline_parser_gen.cpp"
break;
- case 54:
-#line 443 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 63: // projectionFieldname: invariableUserFieldname
+#line 485 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() =
YY_MOVE(yystack_[0].value.as<CNode::Fieldname>());
}
-#line 2098 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2169 "pipeline_parser_gen.cpp"
break;
- case 55:
-#line 443 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 64: // projectionFieldname: stageAsUserFieldname
+#line 485 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() =
YY_MOVE(yystack_[0].value.as<CNode::Fieldname>());
}
-#line 2104 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2175 "pipeline_parser_gen.cpp"
break;
- case 56:
-#line 443 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 65: // projectionFieldname: argAsUserFieldname
+#line 485 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() =
YY_MOVE(yystack_[0].value.as<CNode::Fieldname>());
}
-#line 2110 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2181 "pipeline_parser_gen.cpp"
break;
- case 57:
-#line 443 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 66: // projectionFieldname: aggExprAsUserFieldname
+#line 485 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() =
YY_MOVE(yystack_[0].value.as<CNode::Fieldname>());
}
-#line 2116 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2187 "pipeline_parser_gen.cpp"
break;
- case 58:
-#line 447 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 67: // matchExpression: "object" filterFields "end of object"
+#line 489 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[1].value.as<CNode>());
}
-#line 2124 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2195 "pipeline_parser_gen.cpp"
break;
- case 59:
-#line 453 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 68: // filterFields: %empty
+#line 495 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode::noopLeaf();
}
-#line 2132 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2203 "pipeline_parser_gen.cpp"
break;
- case 60:
-#line 456 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 69: // filterFields: filterFields filterField
+#line 498 "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 2141 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2212 "pipeline_parser_gen.cpp"
break;
- case 61:
-#line 462 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 70: // filterField: filterFieldname filterVal
+#line 504 "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 2149 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2220 "pipeline_parser_gen.cpp"
break;
- case 62:
-#line 468 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 71: // filterVal: value
+#line 510 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 2155 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2226 "pipeline_parser_gen.cpp"
break;
- case 63:
-#line 473 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 72: // filterFieldname: idAsUserFieldname
+#line 515 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() =
YY_MOVE(yystack_[0].value.as<CNode::Fieldname>());
}
-#line 2161 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2232 "pipeline_parser_gen.cpp"
break;
- case 64:
-#line 473 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 73: // filterFieldname: invariableUserFieldname
+#line 515 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() =
YY_MOVE(yystack_[0].value.as<CNode::Fieldname>());
}
-#line 2167 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2238 "pipeline_parser_gen.cpp"
break;
- case 65:
-#line 473 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 74: // filterFieldname: argAsUserFieldname
+#line 515 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() =
YY_MOVE(yystack_[0].value.as<CNode::Fieldname>());
}
-#line 2173 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2244 "pipeline_parser_gen.cpp"
break;
- case 66:
-#line 477 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 75: // invariableUserFieldname: "fieldname"
+#line 519 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() =
UserFieldname{YY_MOVE(yystack_[0].value.as<std::string>())};
}
-#line 2181 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2252 "pipeline_parser_gen.cpp"
break;
- case 67:
-#line 485 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 76: // stageAsUserFieldname: STAGE_INHIBIT_OPTIMIZATION
+#line 527 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() =
UserFieldname{"$_internalInhibitOptimization"};
}
-#line 2189 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2260 "pipeline_parser_gen.cpp"
break;
- case 68:
-#line 488 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 77: // stageAsUserFieldname: STAGE_UNION_WITH
+#line 530 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$unionWith"};
}
-#line 2197 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2268 "pipeline_parser_gen.cpp"
break;
- case 69:
-#line 491 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 78: // stageAsUserFieldname: STAGE_SKIP
+#line 533 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$skip"};
}
-#line 2205 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2276 "pipeline_parser_gen.cpp"
break;
- case 70:
-#line 494 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 79: // stageAsUserFieldname: STAGE_LIMIT
+#line 536 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$limit"};
}
-#line 2213 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2284 "pipeline_parser_gen.cpp"
break;
- case 71:
-#line 497 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 80: // stageAsUserFieldname: STAGE_PROJECT
+#line 539 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$project"};
}
-#line 2221 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2292 "pipeline_parser_gen.cpp"
break;
- case 72:
-#line 500 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 81: // stageAsUserFieldname: STAGE_SAMPLE
+#line 542 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$sample"};
}
-#line 2229 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2300 "pipeline_parser_gen.cpp"
break;
- case 73:
-#line 509 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 82: // argAsUserFieldname: "coll argument"
+#line 551 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"coll"};
}
-#line 2237 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2308 "pipeline_parser_gen.cpp"
break;
- case 74:
-#line 512 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 83: // argAsUserFieldname: "pipeline argument"
+#line 554 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"pipeline"};
}
-#line 2245 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2316 "pipeline_parser_gen.cpp"
break;
- case 75:
-#line 515 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 84: // argAsUserFieldname: "size argument"
+#line 557 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"size"};
}
-#line 2253 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2324 "pipeline_parser_gen.cpp"
break;
- case 76:
-#line 518 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 85: // argAsUserFieldname: "input argument"
+#line 560 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"input"};
}
-#line 2261 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2332 "pipeline_parser_gen.cpp"
break;
- case 77:
-#line 521 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 86: // argAsUserFieldname: "to argument"
+#line 563 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"to"};
}
-#line 2269 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2340 "pipeline_parser_gen.cpp"
break;
- case 78:
-#line 524 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 87: // argAsUserFieldname: "onError argument"
+#line 566 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"onError"};
}
-#line 2277 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2348 "pipeline_parser_gen.cpp"
break;
- case 79:
-#line 527 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 88: // argAsUserFieldname: "onNull argument"
+#line 569 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"onNull"};
}
-#line 2285 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2356 "pipeline_parser_gen.cpp"
break;
- case 80:
-#line 530 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 89: // argAsUserFieldname: "dateString argument"
+#line 572 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"dateString"};
}
-#line 2293 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2364 "pipeline_parser_gen.cpp"
break;
- case 81:
-#line 533 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 90: // argAsUserFieldname: "format argument"
+#line 575 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"format"};
}
-#line 2301 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2372 "pipeline_parser_gen.cpp"
break;
- case 82:
-#line 536 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 91: // argAsUserFieldname: "timezone argument"
+#line 578 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"timezone"};
}
-#line 2309 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2380 "pipeline_parser_gen.cpp"
break;
- case 83:
-#line 539 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 92: // argAsUserFieldname: "date argument"
+#line 581 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"date"};
}
-#line 2317 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2388 "pipeline_parser_gen.cpp"
break;
- case 84:
-#line 542 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 93: // argAsUserFieldname: "chars argument"
+#line 584 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"chars"};
}
-#line 2325 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2396 "pipeline_parser_gen.cpp"
break;
- case 85:
-#line 545 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 94: // argAsUserFieldname: "regex argument"
+#line 587 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"regex"};
}
-#line 2333 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2404 "pipeline_parser_gen.cpp"
break;
- case 86:
-#line 548 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 95: // argAsUserFieldname: "options argument"
+#line 590 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"options"};
}
-#line 2341 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2412 "pipeline_parser_gen.cpp"
break;
- case 87:
-#line 551 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 96: // argAsUserFieldname: "find argument"
+#line 593 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"find"};
}
-#line 2349 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2420 "pipeline_parser_gen.cpp"
break;
- case 88:
-#line 554 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 97: // argAsUserFieldname: "replacement argument"
+#line 596 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"replacement"};
}
-#line 2357 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2428 "pipeline_parser_gen.cpp"
break;
- case 89:
-#line 562 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 98: // aggExprAsUserFieldname: ADD
+#line 604 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$add"};
}
-#line 2365 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2436 "pipeline_parser_gen.cpp"
break;
- case 90:
-#line 565 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 99: // aggExprAsUserFieldname: ATAN2
+#line 607 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$atan2"};
}
-#line 2373 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2444 "pipeline_parser_gen.cpp"
break;
- case 91:
-#line 568 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 100: // aggExprAsUserFieldname: AND
+#line 610 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$and"};
}
-#line 2381 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2452 "pipeline_parser_gen.cpp"
break;
- case 92:
-#line 571 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 101: // aggExprAsUserFieldname: CONST_EXPR
+#line 613 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$const"};
}
-#line 2389 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2460 "pipeline_parser_gen.cpp"
break;
- case 93:
-#line 574 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 102: // aggExprAsUserFieldname: LITERAL
+#line 616 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$literal"};
}
-#line 2397 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2468 "pipeline_parser_gen.cpp"
break;
- case 94:
-#line 577 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 103: // aggExprAsUserFieldname: OR
+#line 619 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$or"};
}
-#line 2405 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2476 "pipeline_parser_gen.cpp"
break;
- case 95:
-#line 580 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 104: // aggExprAsUserFieldname: NOT
+#line 622 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$not"};
}
-#line 2413 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2484 "pipeline_parser_gen.cpp"
break;
- case 96:
-#line 583 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 105: // aggExprAsUserFieldname: CMP
+#line 625 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$cmp"};
}
-#line 2421 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2492 "pipeline_parser_gen.cpp"
break;
- case 97:
-#line 586 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 106: // aggExprAsUserFieldname: EQ
+#line 628 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$eq"};
}
-#line 2429 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2500 "pipeline_parser_gen.cpp"
break;
- case 98:
-#line 589 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 107: // aggExprAsUserFieldname: GT
+#line 631 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$gt"};
}
-#line 2437 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2508 "pipeline_parser_gen.cpp"
break;
- case 99:
-#line 592 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 108: // aggExprAsUserFieldname: GTE
+#line 634 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$gte"};
}
-#line 2445 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2516 "pipeline_parser_gen.cpp"
break;
- case 100:
-#line 595 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 109: // aggExprAsUserFieldname: LT
+#line 637 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$lt"};
}
-#line 2453 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2524 "pipeline_parser_gen.cpp"
break;
- case 101:
-#line 598 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 110: // aggExprAsUserFieldname: LTE
+#line 640 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$lte"};
}
-#line 2461 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2532 "pipeline_parser_gen.cpp"
break;
- case 102:
-#line 601 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 111: // aggExprAsUserFieldname: NE
+#line 643 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$ne"};
}
-#line 2469 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2540 "pipeline_parser_gen.cpp"
break;
- case 103:
-#line 604 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 112: // aggExprAsUserFieldname: CONVERT
+#line 646 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$convert"};
}
-#line 2477 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2548 "pipeline_parser_gen.cpp"
break;
- case 104:
-#line 607 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 113: // aggExprAsUserFieldname: TO_BOOL
+#line 649 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$toBool"};
}
-#line 2485 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2556 "pipeline_parser_gen.cpp"
break;
- case 105:
-#line 610 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 114: // aggExprAsUserFieldname: TO_DATE
+#line 652 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$toDate"};
}
-#line 2493 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2564 "pipeline_parser_gen.cpp"
break;
- case 106:
-#line 613 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 115: // aggExprAsUserFieldname: TO_DECIMAL
+#line 655 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$toDecimal"};
}
-#line 2501 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2572 "pipeline_parser_gen.cpp"
break;
- case 107:
-#line 616 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 116: // aggExprAsUserFieldname: TO_DOUBLE
+#line 658 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$toDouble"};
}
-#line 2509 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2580 "pipeline_parser_gen.cpp"
break;
- case 108:
-#line 619 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 117: // aggExprAsUserFieldname: TO_INT
+#line 661 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$toInt"};
}
-#line 2517 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2588 "pipeline_parser_gen.cpp"
break;
- case 109:
-#line 622 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 118: // aggExprAsUserFieldname: TO_LONG
+#line 664 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$toLong"};
}
-#line 2525 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2596 "pipeline_parser_gen.cpp"
break;
- case 110:
-#line 625 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 119: // aggExprAsUserFieldname: TO_OBJECT_ID
+#line 667 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$toObjectId"};
}
-#line 2533 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2604 "pipeline_parser_gen.cpp"
break;
- case 111:
-#line 628 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 120: // aggExprAsUserFieldname: TO_STRING
+#line 670 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$toString"};
}
-#line 2541 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2612 "pipeline_parser_gen.cpp"
break;
- case 112:
-#line 631 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 121: // aggExprAsUserFieldname: TYPE
+#line 673 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$type"};
}
-#line 2549 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2620 "pipeline_parser_gen.cpp"
break;
- case 113:
-#line 634 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 122: // aggExprAsUserFieldname: ABS
+#line 676 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$abs"};
}
-#line 2557 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2628 "pipeline_parser_gen.cpp"
break;
- case 114:
-#line 637 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 123: // aggExprAsUserFieldname: CEIL
+#line 679 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$ceil"};
}
-#line 2565 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2636 "pipeline_parser_gen.cpp"
break;
- case 115:
-#line 640 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 124: // aggExprAsUserFieldname: DIVIDE
+#line 682 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$divide"};
}
-#line 2573 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2644 "pipeline_parser_gen.cpp"
break;
- case 116:
-#line 643 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 125: // aggExprAsUserFieldname: EXPONENT
+#line 685 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$exp"};
}
-#line 2581 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2652 "pipeline_parser_gen.cpp"
break;
- case 117:
-#line 646 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 126: // aggExprAsUserFieldname: FLOOR
+#line 688 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$floor"};
}
-#line 2589 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2660 "pipeline_parser_gen.cpp"
break;
- case 118:
-#line 649 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 127: // aggExprAsUserFieldname: LN
+#line 691 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$ln"};
}
-#line 2597 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2668 "pipeline_parser_gen.cpp"
break;
- case 119:
-#line 652 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 128: // aggExprAsUserFieldname: LOG
+#line 694 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$log"};
}
-#line 2605 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2676 "pipeline_parser_gen.cpp"
break;
- case 120:
-#line 655 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 129: // aggExprAsUserFieldname: LOGTEN
+#line 697 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$log10"};
}
-#line 2613 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2684 "pipeline_parser_gen.cpp"
break;
- case 121:
-#line 658 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 130: // aggExprAsUserFieldname: MOD
+#line 700 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$mod"};
}
-#line 2621 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2692 "pipeline_parser_gen.cpp"
break;
- case 122:
-#line 661 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 131: // aggExprAsUserFieldname: MULTIPLY
+#line 703 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$multiply"};
}
-#line 2629 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2700 "pipeline_parser_gen.cpp"
break;
- case 123:
-#line 664 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 132: // aggExprAsUserFieldname: POW
+#line 706 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$pow"};
}
-#line 2637 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2708 "pipeline_parser_gen.cpp"
break;
- case 124:
-#line 667 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 133: // aggExprAsUserFieldname: ROUND
+#line 709 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$round"};
}
-#line 2645 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2716 "pipeline_parser_gen.cpp"
break;
- case 125:
-#line 670 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 134: // aggExprAsUserFieldname: SQRT
+#line 712 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$sqrt"};
}
-#line 2653 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2724 "pipeline_parser_gen.cpp"
break;
- case 126:
-#line 673 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 135: // aggExprAsUserFieldname: SUBTRACT
+#line 715 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$subtract"};
}
-#line 2661 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2732 "pipeline_parser_gen.cpp"
break;
- case 127:
-#line 676 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 136: // aggExprAsUserFieldname: TRUNC
+#line 718 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$trunc"};
}
-#line 2669 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2740 "pipeline_parser_gen.cpp"
break;
- case 128:
-#line 679 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 137: // aggExprAsUserFieldname: CONCAT
+#line 721 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$concat"};
}
-#line 2677 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2748 "pipeline_parser_gen.cpp"
break;
- case 129:
-#line 682 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 138: // aggExprAsUserFieldname: DATE_FROM_STRING
+#line 724 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$dateFromString"};
}
-#line 2685 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2756 "pipeline_parser_gen.cpp"
break;
- case 130:
-#line 685 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 139: // aggExprAsUserFieldname: DATE_TO_STRING
+#line 727 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$dateToString"};
}
-#line 2693 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2764 "pipeline_parser_gen.cpp"
break;
- case 131:
-#line 688 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 140: // aggExprAsUserFieldname: INDEX_OF_BYTES
+#line 730 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$indexOfBytes"};
}
-#line 2701 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2772 "pipeline_parser_gen.cpp"
break;
- case 132:
-#line 691 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 141: // aggExprAsUserFieldname: INDEX_OF_CP
+#line 733 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$indexOfCP"};
}
-#line 2709 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2780 "pipeline_parser_gen.cpp"
break;
- case 133:
-#line 694 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 142: // aggExprAsUserFieldname: LTRIM
+#line 736 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$ltrim"};
}
-#line 2717 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2788 "pipeline_parser_gen.cpp"
+ break;
+
+ case 143: // aggExprAsUserFieldname: META
+#line 739 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$meta"};
+ }
+#line 2796 "pipeline_parser_gen.cpp"
break;
- case 134:
-#line 697 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 144: // aggExprAsUserFieldname: REGEX_FIND
+#line 742 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$regexFind"};
}
-#line 2725 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2804 "pipeline_parser_gen.cpp"
break;
- case 135:
-#line 700 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 145: // aggExprAsUserFieldname: REGEX_FIND_ALL
+#line 745 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$regexFindAll"};
}
-#line 2733 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2812 "pipeline_parser_gen.cpp"
break;
- case 136:
-#line 703 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 146: // aggExprAsUserFieldname: REGEX_MATCH
+#line 748 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$regexMatch"};
}
-#line 2741 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2820 "pipeline_parser_gen.cpp"
break;
- case 137:
-#line 706 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 147: // aggExprAsUserFieldname: REPLACE_ONE
+#line 751 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$replaceOne"};
}
-#line 2749 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2828 "pipeline_parser_gen.cpp"
break;
- case 138:
-#line 709 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 148: // aggExprAsUserFieldname: REPLACE_ALL
+#line 754 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$replaceAll"};
}
-#line 2757 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2836 "pipeline_parser_gen.cpp"
break;
- case 139:
-#line 712 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 149: // aggExprAsUserFieldname: RTRIM
+#line 757 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$rtrim"};
}
-#line 2765 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2844 "pipeline_parser_gen.cpp"
break;
- case 140:
-#line 715 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 150: // aggExprAsUserFieldname: SPLIT
+#line 760 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$split"};
}
-#line 2773 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2852 "pipeline_parser_gen.cpp"
break;
- case 141:
-#line 718 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 151: // aggExprAsUserFieldname: STR_LEN_BYTES
+#line 763 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$strLenBytes"};
}
-#line 2781 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2860 "pipeline_parser_gen.cpp"
break;
- case 142:
-#line 721 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 152: // aggExprAsUserFieldname: STR_LEN_CP
+#line 766 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$strLenCP"};
}
-#line 2789 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2868 "pipeline_parser_gen.cpp"
break;
- case 143:
-#line 724 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 153: // aggExprAsUserFieldname: STR_CASE_CMP
+#line 769 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$strcasecmp"};
}
-#line 2797 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2876 "pipeline_parser_gen.cpp"
break;
- case 144:
-#line 727 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 154: // aggExprAsUserFieldname: SUBSTR
+#line 772 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$substr"};
}
-#line 2805 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2884 "pipeline_parser_gen.cpp"
break;
- case 145:
-#line 730 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 155: // aggExprAsUserFieldname: SUBSTR_BYTES
+#line 775 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$substrBytes"};
}
-#line 2813 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2892 "pipeline_parser_gen.cpp"
break;
- case 146:
-#line 733 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 156: // aggExprAsUserFieldname: SUBSTR_CP
+#line 778 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$substrCP"};
}
-#line 2821 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2900 "pipeline_parser_gen.cpp"
break;
- case 147:
-#line 736 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 157: // aggExprAsUserFieldname: TO_LOWER
+#line 781 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$toLower"};
}
-#line 2829 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2908 "pipeline_parser_gen.cpp"
break;
- case 148:
-#line 739 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 158: // aggExprAsUserFieldname: TRIM
+#line 784 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$trim"};
}
-#line 2837 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2916 "pipeline_parser_gen.cpp"
break;
- case 149:
-#line 742 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 159: // aggExprAsUserFieldname: TO_UPPER
+#line 787 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$toUpper"};
}
-#line 2845 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2924 "pipeline_parser_gen.cpp"
break;
- case 150:
-#line 749 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 160: // string: "string"
+#line 794 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() =
CNode{UserString{YY_MOVE(yystack_[0].value.as<std::string>())}};
}
-#line 2853 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2932 "pipeline_parser_gen.cpp"
+ break;
+
+ case 161: // string: "randVal"
+#line 799 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{UserString{"randVal"}};
+ }
+#line 2940 "pipeline_parser_gen.cpp"
break;
- case 151:
-#line 754 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 162: // string: "textScore"
+#line 802 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{UserString{"textScore"}};
+ }
+#line 2948 "pipeline_parser_gen.cpp"
+ break;
+
+ case 163: // fieldPath: "$-prefixed string"
+#line 808 "pipeline_grammar.yy"
{
std::string str = YY_MOVE(yystack_[0].value.as<std::string>());
if (str.size() == 1) {
@@ -2893,11 +2992,11 @@ int PipelineParserGen::parse() {
}
yylhs.value.as<CNode>() = CNode{UserFieldPath{str.substr(1), false}};
}
-#line 2865 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2960 "pipeline_parser_gen.cpp"
break;
- case 152:
-#line 762 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 164: // variable: "$$-prefixed string"
+#line 816 "pipeline_grammar.yy"
{
std::string str = YY_MOVE(yystack_[0].value.as<std::string>()).substr(2);
auto status = c_node_validation::validateVariableName(str);
@@ -2906,815 +3005,883 @@ int PipelineParserGen::parse() {
}
yylhs.value.as<CNode>() = CNode{UserFieldPath{str, true}};
}
-#line 2878 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2973 "pipeline_parser_gen.cpp"
break;
- case 153:
-#line 771 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 165: // binary: "BinData"
+#line 825 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() =
CNode{UserBinary{YY_MOVE(yystack_[0].value.as<BSONBinData>())}};
}
-#line 2886 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2981 "pipeline_parser_gen.cpp"
break;
- case 154:
-#line 777 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 166: // undefined: "undefined"
+#line 831 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{UserUndefined{}};
}
-#line 2894 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2989 "pipeline_parser_gen.cpp"
break;
- case 155:
-#line 783 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 167: // objectId: "ObjectID"
+#line 837 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{UserObjectId{}};
}
-#line 2902 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 2997 "pipeline_parser_gen.cpp"
break;
- case 156:
-#line 789 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 168: // date: "Date"
+#line 843 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() =
CNode{UserDate{YY_MOVE(yystack_[0].value.as<Date_t>())}};
}
-#line 2910 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3005 "pipeline_parser_gen.cpp"
break;
- case 157:
-#line 795 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 169: // null: "null"
+#line 849 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{UserNull{}};
}
-#line 2918 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3013 "pipeline_parser_gen.cpp"
break;
- case 158:
-#line 801 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 170: // regex: "regex"
+#line 855 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() =
CNode{UserRegex{YY_MOVE(yystack_[0].value.as<BSONRegEx>())}};
}
-#line 2926 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3021 "pipeline_parser_gen.cpp"
break;
- case 159:
-#line 807 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 171: // dbPointer: "dbPointer"
+#line 861 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() =
CNode{UserDBPointer{YY_MOVE(yystack_[0].value.as<BSONDBRef>())}};
}
-#line 2934 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3029 "pipeline_parser_gen.cpp"
break;
- case 160:
-#line 813 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 172: // javascript: "Code"
+#line 867 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() =
CNode{UserJavascript{YY_MOVE(yystack_[0].value.as<BSONCode>())}};
}
-#line 2942 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3037 "pipeline_parser_gen.cpp"
break;
- case 161:
-#line 819 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 173: // symbol: "Symbol"
+#line 873 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() =
CNode{UserSymbol{YY_MOVE(yystack_[0].value.as<BSONSymbol>())}};
}
-#line 2950 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3045 "pipeline_parser_gen.cpp"
break;
- case 162:
-#line 825 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 174: // javascriptWScope: "CodeWScope"
+#line 879 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{UserJavascriptWithScope{
YY_MOVE(yystack_[0].value.as<BSONCodeWScope>())}};
}
-#line 2958 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3053 "pipeline_parser_gen.cpp"
break;
- case 163:
-#line 831 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 175: // timestamp: "Timestamp"
+#line 885 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() =
CNode{UserTimestamp{YY_MOVE(yystack_[0].value.as<Timestamp>())}};
}
-#line 2966 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3061 "pipeline_parser_gen.cpp"
break;
- case 164:
-#line 837 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 176: // minKey: "minKey"
+#line 891 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() =
CNode{UserMinKey{YY_MOVE(yystack_[0].value.as<UserMinKey>())}};
}
-#line 2974 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3069 "pipeline_parser_gen.cpp"
break;
- case 165:
-#line 843 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 177: // maxKey: "maxKey"
+#line 897 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() =
CNode{UserMaxKey{YY_MOVE(yystack_[0].value.as<UserMaxKey>())}};
}
-#line 2982 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3077 "pipeline_parser_gen.cpp"
break;
- case 166:
-#line 849 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 178: // int: "arbitrary integer"
+#line 903 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() =
CNode{UserInt{YY_MOVE(yystack_[0].value.as<int>())}};
}
-#line 2990 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3085 "pipeline_parser_gen.cpp"
break;
- case 167:
-#line 852 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 179: // int: "zero (int)"
+#line 906 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{UserInt{0}};
}
-#line 2998 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3093 "pipeline_parser_gen.cpp"
break;
- case 168:
-#line 858 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 180: // int: "1 (int)"
+#line 909 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{UserInt{1}};
+ }
+#line 3101 "pipeline_parser_gen.cpp"
+ break;
+
+ case 181: // int: "-1 (int)"
+#line 912 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{UserInt{-1}};
+ }
+#line 3109 "pipeline_parser_gen.cpp"
+ break;
+
+ case 182: // long: "arbitrary long"
+#line 918 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() =
CNode{UserLong{YY_MOVE(yystack_[0].value.as<long long>())}};
}
-#line 3006 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3117 "pipeline_parser_gen.cpp"
break;
- case 169:
-#line 861 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 183: // long: "zero (long)"
+#line 921 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{UserLong{0ll}};
}
-#line 3014 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3125 "pipeline_parser_gen.cpp"
+ break;
+
+ case 184: // long: "1 (long)"
+#line 924 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{UserLong{1ll}};
+ }
+#line 3133 "pipeline_parser_gen.cpp"
break;
- case 170:
-#line 867 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 185: // long: "-1 (long)"
+#line 927 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{UserLong{-1ll}};
+ }
+#line 3141 "pipeline_parser_gen.cpp"
+ break;
+
+ case 186: // double: "arbitrary double"
+#line 933 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() =
CNode{UserDouble{YY_MOVE(yystack_[0].value.as<double>())}};
}
-#line 3022 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3149 "pipeline_parser_gen.cpp"
break;
- case 171:
-#line 870 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 187: // double: "zero (double)"
+#line 936 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{UserDouble{0.0}};
}
-#line 3030 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3157 "pipeline_parser_gen.cpp"
break;
- case 172:
-#line 876 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 188: // double: "1 (double)"
+#line 939 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{UserDouble{1.0}};
+ }
+#line 3165 "pipeline_parser_gen.cpp"
+ break;
+
+ case 189: // double: "-1 (double)"
+#line 942 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{UserDouble{-1.0}};
+ }
+#line 3173 "pipeline_parser_gen.cpp"
+ break;
+
+ case 190: // decimal: "arbitrary decimal"
+#line 948 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() =
CNode{UserDecimal{YY_MOVE(yystack_[0].value.as<Decimal128>())}};
}
-#line 3038 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3181 "pipeline_parser_gen.cpp"
break;
- case 173:
-#line 879 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 191: // decimal: "zero (decimal)"
+#line 951 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{UserDecimal{0.0}};
}
-#line 3046 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3189 "pipeline_parser_gen.cpp"
+ break;
+
+ case 192: // decimal: "1 (decimal)"
+#line 954 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{UserDecimal{1.0}};
+ }
+#line 3197 "pipeline_parser_gen.cpp"
+ break;
+
+ case 193: // decimal: "-1 (decimal)"
+#line 957 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{UserDecimal{-1.0}};
+ }
+#line 3205 "pipeline_parser_gen.cpp"
break;
- case 174:
-#line 885 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 194: // bool: "true"
+#line 963 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{UserBoolean{true}};
}
-#line 3054 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3213 "pipeline_parser_gen.cpp"
break;
- case 175:
-#line 888 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 195: // bool: "false"
+#line 966 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{UserBoolean{false}};
}
-#line 3062 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3221 "pipeline_parser_gen.cpp"
break;
- case 176:
-#line 894 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 196: // simpleValue: string
+#line 972 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3068 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3227 "pipeline_parser_gen.cpp"
break;
- case 177:
-#line 895 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 197: // simpleValue: fieldPath
+#line 973 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3074 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3233 "pipeline_parser_gen.cpp"
break;
- case 178:
-#line 896 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 198: // simpleValue: variable
+#line 974 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3080 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3239 "pipeline_parser_gen.cpp"
break;
- case 179:
-#line 897 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 199: // simpleValue: binary
+#line 975 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3086 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3245 "pipeline_parser_gen.cpp"
break;
- case 180:
-#line 898 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 200: // simpleValue: undefined
+#line 976 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3092 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3251 "pipeline_parser_gen.cpp"
break;
- case 181:
-#line 899 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 201: // simpleValue: objectId
+#line 977 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3098 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3257 "pipeline_parser_gen.cpp"
break;
- case 182:
-#line 900 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 202: // simpleValue: date
+#line 978 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3104 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3263 "pipeline_parser_gen.cpp"
break;
- case 183:
-#line 901 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 203: // simpleValue: null
+#line 979 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3110 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3269 "pipeline_parser_gen.cpp"
break;
- case 184:
-#line 902 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 204: // simpleValue: regex
+#line 980 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3116 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3275 "pipeline_parser_gen.cpp"
break;
- case 185:
-#line 903 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 205: // simpleValue: dbPointer
+#line 981 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3122 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3281 "pipeline_parser_gen.cpp"
break;
- case 186:
-#line 904 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 206: // simpleValue: javascript
+#line 982 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3128 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3287 "pipeline_parser_gen.cpp"
break;
- case 187:
-#line 905 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 207: // simpleValue: symbol
+#line 983 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3134 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3293 "pipeline_parser_gen.cpp"
break;
- case 188:
-#line 906 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 208: // simpleValue: javascriptWScope
+#line 984 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3140 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3299 "pipeline_parser_gen.cpp"
break;
- case 189:
-#line 907 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 209: // simpleValue: int
+#line 985 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3146 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3305 "pipeline_parser_gen.cpp"
break;
- case 190:
-#line 908 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 210: // simpleValue: long
+#line 986 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3152 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3311 "pipeline_parser_gen.cpp"
break;
- case 191:
-#line 909 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 211: // simpleValue: double
+#line 987 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3158 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3317 "pipeline_parser_gen.cpp"
break;
- case 192:
-#line 910 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 212: // simpleValue: decimal
+#line 988 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3164 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3323 "pipeline_parser_gen.cpp"
break;
- case 193:
-#line 911 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 213: // simpleValue: bool
+#line 989 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3170 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3329 "pipeline_parser_gen.cpp"
break;
- case 194:
-#line 912 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 214: // simpleValue: timestamp
+#line 990 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3176 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3335 "pipeline_parser_gen.cpp"
break;
- case 195:
-#line 913 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 215: // simpleValue: minKey
+#line 991 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3182 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3341 "pipeline_parser_gen.cpp"
break;
- case 196:
-#line 914 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 216: // simpleValue: maxKey
+#line 992 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3188 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3347 "pipeline_parser_gen.cpp"
break;
- case 197:
-#line 921 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 217: // expressions: %empty
+#line 999 "pipeline_grammar.yy"
{
}
-#line 3194 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3353 "pipeline_parser_gen.cpp"
break;
- case 198:
-#line 922 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 218: // expressions: expression expressions
+#line 1000 "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 3203 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3362 "pipeline_parser_gen.cpp"
break;
- case 199:
-#line 929 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 219: // expression: simpleValue
+#line 1007 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3209 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3368 "pipeline_parser_gen.cpp"
break;
- case 200:
-#line 929 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 220: // expression: compoundExpression
+#line 1007 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3215 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3374 "pipeline_parser_gen.cpp"
break;
- case 201:
-#line 933 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 221: // exprFixedTwoArg: "array" expression expression "end of array"
+#line 1011 "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 3223 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3382 "pipeline_parser_gen.cpp"
break;
- case 202:
-#line 938 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 222: // compoundExpression: expressionArray
+#line 1016 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3229 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3388 "pipeline_parser_gen.cpp"
break;
- case 203:
-#line 938 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 223: // compoundExpression: expressionObject
+#line 1016 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3235 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3394 "pipeline_parser_gen.cpp"
break;
- case 204:
-#line 938 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 224: // compoundExpression: maths
+#line 1016 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3241 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3400 "pipeline_parser_gen.cpp"
break;
- case 205:
-#line 938 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 225: // compoundExpression: boolExps
+#line 1016 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3247 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3406 "pipeline_parser_gen.cpp"
break;
- case 206:
-#line 938 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 226: // compoundExpression: literalEscapes
+#line 1016 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3253 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3412 "pipeline_parser_gen.cpp"
break;
- case 207:
-#line 938 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 227: // compoundExpression: compExprs
+#line 1016 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3259 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3418 "pipeline_parser_gen.cpp"
break;
- case 208:
-#line 939 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 228: // compoundExpression: typeExpression
+#line 1017 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3265 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3424 "pipeline_parser_gen.cpp"
break;
- case 209:
-#line 939 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 229: // compoundExpression: stringExps
+#line 1017 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3271 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3430 "pipeline_parser_gen.cpp"
break;
- case 210:
-#line 945 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 230: // expressionArray: "array" expressions "end of array"
+#line 1023 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() =
CNode{YY_MOVE(yystack_[1].value.as<std::vector<CNode>>())};
}
-#line 3279 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3438 "pipeline_parser_gen.cpp"
break;
- case 211:
-#line 953 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 231: // expressionObject: "object" expressionFields "end of object"
+#line 1031 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[1].value.as<CNode>());
}
-#line 3287 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3446 "pipeline_parser_gen.cpp"
break;
- case 212:
-#line 959 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 232: // expressionFields: %empty
+#line 1037 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode::noopLeaf();
}
-#line 3295 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3454 "pipeline_parser_gen.cpp"
break;
- case 213:
-#line 962 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 233: // expressionFields: expressionFields expressionField
+#line 1040 "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 3304 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3463 "pipeline_parser_gen.cpp"
break;
- case 214:
-#line 969 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 234: // expressionField: expressionFieldname expression
+#line 1047 "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 3312 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3471 "pipeline_parser_gen.cpp"
break;
- case 215:
-#line 976 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 235: // expressionFieldname: invariableUserFieldname
+#line 1054 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() =
YY_MOVE(yystack_[0].value.as<CNode::Fieldname>());
}
-#line 3318 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3477 "pipeline_parser_gen.cpp"
break;
- case 216:
-#line 976 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 236: // expressionFieldname: stageAsUserFieldname
+#line 1054 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() =
YY_MOVE(yystack_[0].value.as<CNode::Fieldname>());
}
-#line 3324 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3483 "pipeline_parser_gen.cpp"
break;
- case 217:
-#line 976 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 237: // expressionFieldname: argAsUserFieldname
+#line 1054 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() =
YY_MOVE(yystack_[0].value.as<CNode::Fieldname>());
}
-#line 3330 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3489 "pipeline_parser_gen.cpp"
break;
- case 218:
-#line 976 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 238: // expressionFieldname: idAsUserFieldname
+#line 1054 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() =
YY_MOVE(yystack_[0].value.as<CNode::Fieldname>());
}
-#line 3336 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3495 "pipeline_parser_gen.cpp"
break;
- case 219:
-#line 980 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 239: // idAsUserFieldname: ID
+#line 1058 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() = UserFieldname{"_id"};
}
-#line 3344 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3503 "pipeline_parser_gen.cpp"
break;
- case 220:
-#line 986 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 240: // maths: add
+#line 1064 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3350 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3509 "pipeline_parser_gen.cpp"
break;
- case 221:
-#line 986 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 241: // maths: atan2
+#line 1064 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3356 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3515 "pipeline_parser_gen.cpp"
break;
- case 222:
-#line 986 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 242: // maths: abs
+#line 1064 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3362 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3521 "pipeline_parser_gen.cpp"
break;
- case 223:
-#line 986 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 243: // maths: ceil
+#line 1064 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3368 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3527 "pipeline_parser_gen.cpp"
break;
- case 224:
-#line 986 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 244: // maths: divide
+#line 1064 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3374 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3533 "pipeline_parser_gen.cpp"
break;
- case 225:
-#line 986 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 245: // maths: exponent
+#line 1064 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3380 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3539 "pipeline_parser_gen.cpp"
break;
- case 226:
-#line 986 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 246: // maths: floor
+#line 1064 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3386 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3545 "pipeline_parser_gen.cpp"
break;
- case 227:
-#line 986 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 247: // maths: ln
+#line 1064 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3392 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3551 "pipeline_parser_gen.cpp"
break;
- case 228:
-#line 986 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 248: // maths: log
+#line 1064 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3398 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3557 "pipeline_parser_gen.cpp"
break;
- case 229:
-#line 986 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 249: // maths: logten
+#line 1064 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3404 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3563 "pipeline_parser_gen.cpp"
break;
- case 230:
-#line 986 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 250: // maths: mod
+#line 1064 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3410 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3569 "pipeline_parser_gen.cpp"
break;
- case 231:
-#line 986 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 251: // maths: multiply
+#line 1064 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3416 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3575 "pipeline_parser_gen.cpp"
break;
- case 232:
-#line 986 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 252: // maths: pow
+#line 1064 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3422 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3581 "pipeline_parser_gen.cpp"
break;
- case 233:
-#line 987 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 253: // maths: round
+#line 1065 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3428 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3587 "pipeline_parser_gen.cpp"
break;
- case 234:
-#line 987 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 254: // maths: sqrt
+#line 1065 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3434 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3593 "pipeline_parser_gen.cpp"
break;
- case 235:
-#line 987 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 255: // maths: subtract
+#line 1065 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3440 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3599 "pipeline_parser_gen.cpp"
break;
- case 236:
-#line 987 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 256: // maths: trunc
+#line 1065 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3446 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3605 "pipeline_parser_gen.cpp"
break;
- case 237:
-#line 991 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 257: // add: "object" ADD expressionArray "end of object"
+#line 1069 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::add, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 3455 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3614 "pipeline_parser_gen.cpp"
break;
- case 238:
-#line 998 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 258: // atan2: "object" ATAN2 exprFixedTwoArg "end of object"
+#line 1076 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::atan2, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 3464 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3623 "pipeline_parser_gen.cpp"
break;
- case 239:
-#line 1004 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 259: // abs: "object" ABS expression "end of object"
+#line 1082 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::abs, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 3472 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3631 "pipeline_parser_gen.cpp"
break;
- case 240:
-#line 1009 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 260: // ceil: "object" CEIL expression "end of object"
+#line 1087 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::ceil, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 3480 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3639 "pipeline_parser_gen.cpp"
break;
- case 241:
-#line 1014 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 261: // divide: "object" DIVIDE "array" expression expression "end of
+ // array" "end of object"
+#line 1092 "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 3489 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3648 "pipeline_parser_gen.cpp"
break;
- case 242:
-#line 1020 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 262: // exponent: "object" EXPONENT expression "end of object"
+#line 1098 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::exponent, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 3497 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3656 "pipeline_parser_gen.cpp"
break;
- case 243:
-#line 1025 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 263: // floor: "object" FLOOR expression "end of object"
+#line 1103 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::floor, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 3505 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3664 "pipeline_parser_gen.cpp"
break;
- case 244:
-#line 1030 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 264: // ln: "object" LN expression "end of object"
+#line 1108 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::ln, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 3513 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3672 "pipeline_parser_gen.cpp"
break;
- case 245:
-#line 1035 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 265: // log: "object" LOG "array" expression expression "end of array"
+ // "end of object"
+#line 1113 "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 3522 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3681 "pipeline_parser_gen.cpp"
break;
- case 246:
-#line 1041 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 266: // logten: "object" LOGTEN expression "end of object"
+#line 1119 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::logten, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 3530 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3689 "pipeline_parser_gen.cpp"
break;
- case 247:
-#line 1046 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 267: // mod: "object" MOD "array" expression expression "end of array"
+ // "end of object"
+#line 1124 "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 3539 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3698 "pipeline_parser_gen.cpp"
break;
- case 248:
-#line 1052 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 268: // multiply: "object" MULTIPLY "array" expression expression
+ // expressions "end of array" "end of object"
+#line 1130 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::multiply,
@@ -3725,292 +3892,298 @@ int PipelineParserGen::parse() {
yylhs.value.as<CNode>().objectChildren()[0].second.arrayChildren();
array.insert(array.end(), others.begin(), others.end());
}
-#line 3551 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3710 "pipeline_parser_gen.cpp"
break;
- case 249:
-#line 1061 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 269: // pow: "object" POW "array" expression expression "end of array"
+ // "end of object"
+#line 1139 "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 3560 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3719 "pipeline_parser_gen.cpp"
break;
- case 250:
-#line 1067 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 270: // round: "object" ROUND "array" expression expression "end of array"
+ // "end of object"
+#line 1145 "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 3569 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3728 "pipeline_parser_gen.cpp"
break;
- case 251:
-#line 1073 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 271: // sqrt: "object" SQRT expression "end of object"
+#line 1151 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::sqrt, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 3577 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3736 "pipeline_parser_gen.cpp"
break;
- case 252:
-#line 1078 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 272: // subtract: "object" SUBTRACT "array" expression expression "end of
+ // array" "end of object"
+#line 1156 "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 3586 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3745 "pipeline_parser_gen.cpp"
break;
- case 253:
-#line 1084 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 273: // trunc: "object" TRUNC "array" expression expression "end of array"
+ // "end of object"
+#line 1162 "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 3595 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3754 "pipeline_parser_gen.cpp"
break;
- case 254:
-#line 1090 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 274: // boolExps: and
+#line 1168 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3601 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3760 "pipeline_parser_gen.cpp"
break;
- case 255:
-#line 1090 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 275: // boolExps: or
+#line 1168 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3607 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3766 "pipeline_parser_gen.cpp"
break;
- case 256:
-#line 1090 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 276: // boolExps: not
+#line 1168 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3613 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3772 "pipeline_parser_gen.cpp"
break;
- case 257:
-#line 1094 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 277: // and: "object" AND expressionArray "end of object"
+#line 1172 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::andExpr, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 3622 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3781 "pipeline_parser_gen.cpp"
break;
- case 258:
-#line 1101 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 278: // or: "object" OR expressionArray "end of object"
+#line 1179 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::orExpr, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 3631 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3790 "pipeline_parser_gen.cpp"
break;
- case 259:
-#line 1108 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 279: // not: "object" NOT "array" expression "end of array" "end of
+ // object"
+#line 1186 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::notExpr,
CNode{CNode::ArrayChildren{YY_MOVE(yystack_[2].value.as<CNode>())}}}}};
}
-#line 3640 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3799 "pipeline_parser_gen.cpp"
break;
- case 260:
-#line 1115 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 280: // stringExps: concat
+#line 1193 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3646 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3805 "pipeline_parser_gen.cpp"
break;
- case 261:
-#line 1115 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 281: // stringExps: dateFromString
+#line 1193 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3652 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3811 "pipeline_parser_gen.cpp"
break;
- case 262:
-#line 1115 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 282: // stringExps: dateToString
+#line 1193 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3658 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3817 "pipeline_parser_gen.cpp"
break;
- case 263:
-#line 1115 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 283: // stringExps: indexOfBytes
+#line 1193 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3664 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3823 "pipeline_parser_gen.cpp"
break;
- case 264:
-#line 1115 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 284: // stringExps: indexOfCP
+#line 1193 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3670 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3829 "pipeline_parser_gen.cpp"
break;
- case 265:
-#line 1115 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 285: // stringExps: ltrim
+#line 1193 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3676 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3835 "pipeline_parser_gen.cpp"
break;
- case 266:
-#line 1115 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 286: // stringExps: regexFind
+#line 1193 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3682 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3841 "pipeline_parser_gen.cpp"
break;
- case 267:
-#line 1116 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 287: // stringExps: regexFindAll
+#line 1194 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3688 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3847 "pipeline_parser_gen.cpp"
break;
- case 268:
-#line 1116 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 288: // stringExps: regexMatch
+#line 1194 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3694 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3853 "pipeline_parser_gen.cpp"
break;
- case 269:
-#line 1116 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 289: // stringExps: replaceOne
+#line 1194 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3700 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3859 "pipeline_parser_gen.cpp"
break;
- case 270:
-#line 1116 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 290: // stringExps: replaceAll
+#line 1194 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3706 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3865 "pipeline_parser_gen.cpp"
break;
- case 271:
-#line 1116 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 291: // stringExps: rtrim
+#line 1194 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3712 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3871 "pipeline_parser_gen.cpp"
break;
- case 272:
-#line 1116 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 292: // stringExps: split
+#line 1194 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3718 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3877 "pipeline_parser_gen.cpp"
break;
- case 273:
-#line 1116 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 293: // stringExps: strLenBytes
+#line 1194 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3724 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3883 "pipeline_parser_gen.cpp"
break;
- case 274:
-#line 1116 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 294: // stringExps: strLenCP
+#line 1194 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3730 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3889 "pipeline_parser_gen.cpp"
break;
- case 275:
-#line 1117 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 295: // stringExps: strcasecmp
+#line 1195 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3736 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3895 "pipeline_parser_gen.cpp"
break;
- case 276:
-#line 1117 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 296: // stringExps: substr
+#line 1195 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3742 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3901 "pipeline_parser_gen.cpp"
break;
- case 277:
-#line 1117 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 297: // stringExps: substrBytes
+#line 1195 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3748 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3907 "pipeline_parser_gen.cpp"
break;
- case 278:
-#line 1117 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 298: // stringExps: substrCP
+#line 1195 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3754 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3913 "pipeline_parser_gen.cpp"
break;
- case 279:
-#line 1117 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 299: // stringExps: toLower
+#line 1195 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3760 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3919 "pipeline_parser_gen.cpp"
break;
- case 280:
-#line 1117 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 300: // stringExps: trim
+#line 1195 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3766 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3925 "pipeline_parser_gen.cpp"
break;
- case 281:
-#line 1117 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 301: // stringExps: toUpper
+#line 1195 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 3772 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3931 "pipeline_parser_gen.cpp"
break;
- case 282:
-#line 1121 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 302: // concat: "object" CONCAT "array" expressions "end of array" "end of
+ // object"
+#line 1199 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::concat, CNode{CNode::ArrayChildren{}}}}};
@@ -4019,47 +4192,49 @@ int PipelineParserGen::parse() {
yylhs.value.as<CNode>().objectChildren()[0].second.arrayChildren();
array.insert(array.end(), others.begin(), others.end());
}
-#line 3784 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3943 "pipeline_parser_gen.cpp"
break;
- case 283:
-#line 1131 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 303: // formatArg: %empty
+#line 1209 "pipeline_grammar.yy"
{
yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() =
std::pair{KeyFieldname::formatArg, CNode{KeyValue::absentKey}};
}
-#line 3792 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3951 "pipeline_parser_gen.cpp"
break;
- case 284:
-#line 1134 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 304: // formatArg: "format argument" expression
+#line 1212 "pipeline_grammar.yy"
{
yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = std::pair{
KeyFieldname::formatArg, YY_MOVE(yystack_[0].value.as<CNode>())};
}
-#line 3800 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3959 "pipeline_parser_gen.cpp"
break;
- case 285:
-#line 1140 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 305: // timezoneArg: %empty
+#line 1218 "pipeline_grammar.yy"
{
yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() =
std::pair{KeyFieldname::timezoneArg, CNode{KeyValue::absentKey}};
}
-#line 3808 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3967 "pipeline_parser_gen.cpp"
break;
- case 286:
-#line 1143 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 306: // timezoneArg: "timezone argument" expression
+#line 1221 "pipeline_grammar.yy"
{
yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = std::pair{
KeyFieldname::timezoneArg, YY_MOVE(yystack_[0].value.as<CNode>())};
}
-#line 3816 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3975 "pipeline_parser_gen.cpp"
break;
- case 287:
-#line 1150 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 307: // dateFromString: "object" DATE_FROM_STRING START_ORDERED_OBJECT
+ // "dateString argument" expression formatArg timezoneArg onErrorArg
+ // onNullArg "end of object" "end of object"
+#line 1228 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::dateFromString,
@@ -4075,11 +4250,13 @@ int PipelineParserGen::parse() {
YY_MOVE(yystack_[2]
.value.as<std::pair<CNode::Fieldname, CNode>>())}}}}};
}
-#line 3826 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3985 "pipeline_parser_gen.cpp"
break;
- case 288:
-#line 1159 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 308: // dateToString: "object" DATE_TO_STRING START_ORDERED_OBJECT "date
+ // argument" expression formatArg timezoneArg onNullArg "end of
+ // object" "end of object"
+#line 1237 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::dateToString,
@@ -4092,38 +4269,39 @@ int PipelineParserGen::parse() {
YY_MOVE(yystack_[2]
.value.as<std::pair<CNode::Fieldname, CNode>>())}}}}};
}
-#line 3836 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 3995 "pipeline_parser_gen.cpp"
break;
- case 289:
-#line 1167 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 309: // exprZeroToTwo: %empty
+#line 1245 "pipeline_grammar.yy"
{
yylhs.value.as<std::vector<CNode>>() = CNode::ArrayChildren{};
}
-#line 3844 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4003 "pipeline_parser_gen.cpp"
break;
- case 290:
-#line 1170 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 310: // exprZeroToTwo: expression
+#line 1248 "pipeline_grammar.yy"
{
yylhs.value.as<std::vector<CNode>>() =
CNode::ArrayChildren{YY_MOVE(yystack_[0].value.as<CNode>())};
}
-#line 3852 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4011 "pipeline_parser_gen.cpp"
break;
- case 291:
-#line 1173 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 311: // exprZeroToTwo: expression expression
+#line 1251 "pipeline_grammar.yy"
{
yylhs.value.as<std::vector<CNode>>() =
CNode::ArrayChildren{YY_MOVE(yystack_[1].value.as<CNode>()),
YY_MOVE(yystack_[0].value.as<CNode>())};
}
-#line 3860 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4019 "pipeline_parser_gen.cpp"
break;
- case 292:
-#line 1180 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 312: // indexOfBytes: "object" INDEX_OF_BYTES "array" expression
+ // expression exprZeroToTwo "end of array" "end of object"
+#line 1258 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::indexOfBytes,
@@ -4134,11 +4312,12 @@ int PipelineParserGen::parse() {
yylhs.value.as<CNode>().objectChildren()[0].second.arrayChildren();
array.insert(array.end(), others.begin(), others.end());
}
-#line 3872 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4031 "pipeline_parser_gen.cpp"
break;
- case 293:
-#line 1191 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 313: // indexOfCP: "object" INDEX_OF_CP "array" expression expression
+ // exprZeroToTwo "end of array" "end of object"
+#line 1269 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::indexOfCP,
@@ -4149,29 +4328,30 @@ int PipelineParserGen::parse() {
yylhs.value.as<CNode>().objectChildren()[0].second.arrayChildren();
array.insert(array.end(), others.begin(), others.end());
}
-#line 3884 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4043 "pipeline_parser_gen.cpp"
break;
- case 294:
-#line 1201 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 314: // charsArg: %empty
+#line 1279 "pipeline_grammar.yy"
{
yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() =
std::pair{KeyFieldname::charsArg, CNode{KeyValue::absentKey}};
}
-#line 3892 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4051 "pipeline_parser_gen.cpp"
break;
- case 295:
-#line 1204 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 315: // charsArg: "chars argument" expression
+#line 1282 "pipeline_grammar.yy"
{
yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = std::pair{
KeyFieldname::charsArg, YY_MOVE(yystack_[0].value.as<CNode>())};
}
-#line 3900 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4059 "pipeline_parser_gen.cpp"
break;
- case 296:
-#line 1210 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 316: // ltrim: "object" LTRIM START_ORDERED_OBJECT charsArg "input
+ // argument" expression "end of object" "end of object"
+#line 1288 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::ltrim,
@@ -4180,11 +4360,12 @@ int PipelineParserGen::parse() {
YY_MOVE(yystack_[4]
.value.as<std::pair<CNode::Fieldname, CNode>>())}}}}};
}
-#line 3910 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4069 "pipeline_parser_gen.cpp"
break;
- case 297:
-#line 1218 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 317: // rtrim: "object" RTRIM START_ORDERED_OBJECT charsArg "input
+ // argument" expression "end of object" "end of object"
+#line 1296 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::rtrim,
@@ -4193,11 +4374,12 @@ int PipelineParserGen::parse() {
YY_MOVE(yystack_[4]
.value.as<std::pair<CNode::Fieldname, CNode>>())}}}}};
}
-#line 3920 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4079 "pipeline_parser_gen.cpp"
break;
- case 298:
-#line 1226 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 318: // trim: "object" TRIM START_ORDERED_OBJECT charsArg "input argument"
+ // expression "end of object" "end of object"
+#line 1304 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::trim,
@@ -4206,29 +4388,30 @@ int PipelineParserGen::parse() {
YY_MOVE(yystack_[4]
.value.as<std::pair<CNode::Fieldname, CNode>>())}}}}};
}
-#line 3930 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4089 "pipeline_parser_gen.cpp"
break;
- case 299:
-#line 1234 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 319: // optionsArg: %empty
+#line 1312 "pipeline_grammar.yy"
{
yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() =
std::pair{KeyFieldname::optionsArg, CNode{KeyValue::absentKey}};
}
-#line 3938 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4097 "pipeline_parser_gen.cpp"
break;
- case 300:
-#line 1237 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 320: // optionsArg: "options argument" expression
+#line 1315 "pipeline_grammar.yy"
{
yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = std::pair{
KeyFieldname::optionsArg, YY_MOVE(yystack_[0].value.as<CNode>())};
}
-#line 3946 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4105 "pipeline_parser_gen.cpp"
break;
- case 301:
-#line 1242 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 321: // regexArgs: START_ORDERED_OBJECT "input argument" expression
+ // optionsArg "regex argument" expression "end of object"
+#line 1320 "pipeline_grammar.yy"
{
// Note that the order of these arguments must match the constructor for the
// regex expression.
@@ -4237,38 +4420,40 @@ int PipelineParserGen::parse() {
{KeyFieldname::regexArg, YY_MOVE(yystack_[1].value.as<CNode>())},
YY_MOVE(yystack_[3].value.as<std::pair<CNode::Fieldname, CNode>>())}};
}
-#line 3958 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4117 "pipeline_parser_gen.cpp"
break;
- case 302:
-#line 1251 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 322: // regexFind: "object" REGEX_FIND regexArgs "end of object"
+#line 1329 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::regexFind, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 3966 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4125 "pipeline_parser_gen.cpp"
break;
- case 303:
-#line 1257 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 323: // regexFindAll: "object" REGEX_FIND_ALL regexArgs "end of object"
+#line 1335 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::regexFindAll, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 3974 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4133 "pipeline_parser_gen.cpp"
break;
- case 304:
-#line 1263 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 324: // regexMatch: "object" REGEX_MATCH regexArgs "end of object"
+#line 1341 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::regexMatch, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 3982 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4141 "pipeline_parser_gen.cpp"
break;
- case 305:
-#line 1270 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 325: // replaceOne: "object" REPLACE_ONE START_ORDERED_OBJECT "find
+ // argument" expression "input argument" expression "replacement
+ // argument" expression "end of object" "end of object"
+#line 1348 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::replaceOne,
@@ -4278,11 +4463,13 @@ int PipelineParserGen::parse() {
{KeyFieldname::replacementArg,
YY_MOVE(yystack_[2].value.as<CNode>())}}}}}};
}
-#line 3993 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4152 "pipeline_parser_gen.cpp"
break;
- case 306:
-#line 1280 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 326: // replaceAll: "object" REPLACE_ALL START_ORDERED_OBJECT "find
+ // argument" expression "input argument" expression "replacement
+ // argument" expression "end of object" "end of object"
+#line 1358 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::replaceAll,
@@ -4292,51 +4479,54 @@ int PipelineParserGen::parse() {
{KeyFieldname::replacementArg,
YY_MOVE(yystack_[2].value.as<CNode>())}}}}}};
}
-#line 4004 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4163 "pipeline_parser_gen.cpp"
break;
- case 307:
-#line 1289 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 327: // split: "object" SPLIT "array" expression expression "end of array"
+ // "end of object"
+#line 1367 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::split,
CNode{CNode::ArrayChildren{YY_MOVE(yystack_[3].value.as<CNode>()),
YY_MOVE(yystack_[2].value.as<CNode>())}}}}};
}
-#line 4013 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4172 "pipeline_parser_gen.cpp"
break;
- case 308:
-#line 1296 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 328: // strLenBytes: "object" STR_LEN_BYTES expression "end of object"
+#line 1374 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::strLenBytes, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 4022 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4181 "pipeline_parser_gen.cpp"
break;
- case 309:
-#line 1303 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 329: // strLenCP: "object" STR_LEN_CP expression "end of object"
+#line 1381 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::strLenCP, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 4031 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4190 "pipeline_parser_gen.cpp"
break;
- case 310:
-#line 1311 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 330: // strcasecmp: "object" STR_CASE_CMP "array" expression expression
+ // "end of array" "end of object"
+#line 1389 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::strcasecmp,
CNode{CNode::ArrayChildren{YY_MOVE(yystack_[3].value.as<CNode>()),
YY_MOVE(yystack_[2].value.as<CNode>())}}}}};
}
-#line 4040 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4199 "pipeline_parser_gen.cpp"
break;
- case 311:
-#line 1319 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 331: // substr: "object" SUBSTR "array" expression expression expression
+ // "end of array" "end of object"
+#line 1397 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::substr,
@@ -4344,11 +4534,12 @@ int PipelineParserGen::parse() {
YY_MOVE(yystack_[3].value.as<CNode>()),
YY_MOVE(yystack_[2].value.as<CNode>())}}}}};
}
-#line 4049 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4208 "pipeline_parser_gen.cpp"
break;
- case 312:
-#line 1327 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 332: // substrBytes: "object" SUBSTR_BYTES "array" expression expression
+ // expression "end of array" "end of object"
+#line 1405 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::substrBytes,
@@ -4356,11 +4547,12 @@ int PipelineParserGen::parse() {
YY_MOVE(yystack_[3].value.as<CNode>()),
YY_MOVE(yystack_[2].value.as<CNode>())}}}}};
}
-#line 4058 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4217 "pipeline_parser_gen.cpp"
break;
- case 313:
-#line 1335 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 333: // substrCP: "object" SUBSTR_CP "array" expression expression
+ // expression "end of array" "end of object"
+#line 1413 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::substrCP,
@@ -4368,440 +4560,579 @@ int PipelineParserGen::parse() {
YY_MOVE(yystack_[3].value.as<CNode>()),
YY_MOVE(yystack_[2].value.as<CNode>())}}}}};
}
-#line 4067 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4226 "pipeline_parser_gen.cpp"
break;
- case 314:
-#line 1342 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 334: // toLower: "object" TO_LOWER expression "end of object"
+#line 1420 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::toLower, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 4075 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4234 "pipeline_parser_gen.cpp"
break;
- case 315:
-#line 1348 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 335: // toUpper: "object" TO_UPPER expression "end of object"
+#line 1426 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::toUpper, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 4083 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4242 "pipeline_parser_gen.cpp"
break;
- case 316:
-#line 1354 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 336: // metaSortKeyword: "randVal"
+#line 1432 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{KeyValue::randVal};
+ }
+#line 4250 "pipeline_parser_gen.cpp"
+ break;
+
+ case 337: // metaSortKeyword: "textScore"
+#line 1435 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{KeyValue::textScore};
+ }
+#line 4258 "pipeline_parser_gen.cpp"
+ break;
+
+ case 338: // metaSort: "object" META metaSortKeyword "end of object"
+#line 1441 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
+ {KeyFieldname::meta, YY_MOVE(yystack_[1].value.as<CNode>())}}};
+ }
+#line 4266 "pipeline_parser_gen.cpp"
+ break;
+
+ case 339: // sortSpecs: "object" specList "end of object"
+#line 1447 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = YY_MOVE(yystack_[1].value.as<CNode>());
+ }
+#line 4274 "pipeline_parser_gen.cpp"
+ break;
+
+ case 340: // specList: %empty
+#line 1452 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode::noopLeaf();
+ }
+#line 4282 "pipeline_parser_gen.cpp"
+ break;
+
+ case 341: // specList: specList sortSpec
+#line 1455 "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 4291 "pipeline_parser_gen.cpp"
+ break;
+
+ case 342: // oneOrNegOne: "1 (int)"
+#line 1462 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{KeyValue::intOneKey};
+ }
+#line 4299 "pipeline_parser_gen.cpp"
+ break;
+
+ case 343: // oneOrNegOne: "-1 (int)"
+#line 1465 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{KeyValue::intNegOneKey};
+ }
+#line 4307 "pipeline_parser_gen.cpp"
+ break;
+
+ case 344: // oneOrNegOne: "1 (long)"
+#line 1468 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{KeyValue::longOneKey};
+ }
+#line 4315 "pipeline_parser_gen.cpp"
+ break;
+
+ case 345: // oneOrNegOne: "-1 (long)"
+#line 1471 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{KeyValue::longNegOneKey};
+ }
+#line 4323 "pipeline_parser_gen.cpp"
+ break;
+
+ case 346: // oneOrNegOne: "1 (double)"
+#line 1474 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{KeyValue::doubleOneKey};
+ }
+#line 4331 "pipeline_parser_gen.cpp"
+ break;
+
+ case 347: // oneOrNegOne: "-1 (double)"
+#line 1477 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{KeyValue::doubleNegOneKey};
+ }
+#line 4339 "pipeline_parser_gen.cpp"
+ break;
+
+ case 348: // oneOrNegOne: "1 (decimal)"
+#line 1480 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{KeyValue::decimalOneKey};
+ }
+#line 4347 "pipeline_parser_gen.cpp"
+ break;
+
+ case 349: // oneOrNegOne: "-1 (decimal)"
+#line 1483 "pipeline_grammar.yy"
+ {
+ yylhs.value.as<CNode>() = CNode{KeyValue::decimalNegOneKey};
+ }
+#line 4355 "pipeline_parser_gen.cpp"
+ break;
+
+ case 350: // sortSpec: valueFieldname metaSort
+#line 1488 "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 4363 "pipeline_parser_gen.cpp"
+ break;
+
+ case 351: // sortSpec: valueFieldname oneOrNegOne
+#line 1490 "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 4371 "pipeline_parser_gen.cpp"
+ break;
+
+ case 352: // literalEscapes: const
+#line 1496 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 4089 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4377 "pipeline_parser_gen.cpp"
break;
- case 317:
-#line 1354 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 353: // literalEscapes: literal
+#line 1496 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 4095 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4383 "pipeline_parser_gen.cpp"
break;
- case 318:
-#line 1358 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 354: // const: "object" CONST_EXPR "array" value "end of array" "end of
+ // object"
+#line 1500 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::constExpr,
CNode{CNode::ArrayChildren{YY_MOVE(yystack_[2].value.as<CNode>())}}}}};
}
-#line 4104 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4392 "pipeline_parser_gen.cpp"
break;
- case 319:
-#line 1365 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 355: // literal: "object" LITERAL "array" value "end of array" "end of
+ // object"
+#line 1507 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::literal,
CNode{CNode::ArrayChildren{YY_MOVE(yystack_[2].value.as<CNode>())}}}}};
}
-#line 4113 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4401 "pipeline_parser_gen.cpp"
break;
- case 320:
-#line 1372 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 356: // value: simpleValue
+#line 1514 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 4119 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4407 "pipeline_parser_gen.cpp"
break;
- case 321:
-#line 1372 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 357: // value: compoundValue
+#line 1514 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 4125 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4413 "pipeline_parser_gen.cpp"
break;
- case 322:
-#line 1376 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 358: // compoundValue: valueArray
+#line 1518 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 4131 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4419 "pipeline_parser_gen.cpp"
break;
- case 323:
-#line 1376 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 359: // compoundValue: valueObject
+#line 1518 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 4137 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4425 "pipeline_parser_gen.cpp"
break;
- case 324:
-#line 1380 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 360: // valueArray: "array" values "end of array"
+#line 1522 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() =
CNode{YY_MOVE(yystack_[1].value.as<std::vector<CNode>>())};
}
-#line 4145 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4433 "pipeline_parser_gen.cpp"
break;
- case 325:
-#line 1386 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 361: // values: %empty
+#line 1528 "pipeline_grammar.yy"
{
}
-#line 4151 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4439 "pipeline_parser_gen.cpp"
break;
- case 326:
-#line 1387 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 362: // values: value values
+#line 1529 "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 4160 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4448 "pipeline_parser_gen.cpp"
break;
- case 327:
-#line 1394 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 363: // valueObject: "object" valueFields "end of object"
+#line 1536 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[1].value.as<CNode>());
}
-#line 4168 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4456 "pipeline_parser_gen.cpp"
break;
- case 328:
-#line 1400 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 364: // valueFields: %empty
+#line 1542 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode::noopLeaf();
}
-#line 4176 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4464 "pipeline_parser_gen.cpp"
break;
- case 329:
-#line 1403 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 365: // valueFields: valueFields valueField
+#line 1545 "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 4185 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4473 "pipeline_parser_gen.cpp"
break;
- case 330:
-#line 1410 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 366: // valueField: valueFieldname value
+#line 1552 "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 4193 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4481 "pipeline_parser_gen.cpp"
break;
- case 331:
-#line 1417 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 367: // valueFieldname: invariableUserFieldname
+#line 1559 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() =
YY_MOVE(yystack_[0].value.as<CNode::Fieldname>());
}
-#line 4199 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4487 "pipeline_parser_gen.cpp"
break;
- case 332:
-#line 1418 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 368: // valueFieldname: stageAsUserFieldname
+#line 1560 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() =
YY_MOVE(yystack_[0].value.as<CNode::Fieldname>());
}
-#line 4205 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4493 "pipeline_parser_gen.cpp"
break;
- case 333:
-#line 1419 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 369: // valueFieldname: argAsUserFieldname
+#line 1561 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() =
YY_MOVE(yystack_[0].value.as<CNode::Fieldname>());
}
-#line 4211 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4499 "pipeline_parser_gen.cpp"
break;
- case 334:
-#line 1420 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 370: // valueFieldname: aggExprAsUserFieldname
+#line 1562 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() =
YY_MOVE(yystack_[0].value.as<CNode::Fieldname>());
}
-#line 4217 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4505 "pipeline_parser_gen.cpp"
break;
- case 335:
-#line 1421 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 371: // valueFieldname: idAsUserFieldname
+#line 1563 "pipeline_grammar.yy"
{
yylhs.value.as<CNode::Fieldname>() =
YY_MOVE(yystack_[0].value.as<CNode::Fieldname>());
}
-#line 4223 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4511 "pipeline_parser_gen.cpp"
break;
- case 336:
-#line 1424 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 372: // compExprs: cmp
+#line 1566 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 4229 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4517 "pipeline_parser_gen.cpp"
break;
- case 337:
-#line 1424 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 373: // compExprs: eq
+#line 1566 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 4235 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4523 "pipeline_parser_gen.cpp"
break;
- case 338:
-#line 1424 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 374: // compExprs: gt
+#line 1566 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 4241 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4529 "pipeline_parser_gen.cpp"
break;
- case 339:
-#line 1424 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 375: // compExprs: gte
+#line 1566 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 4247 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4535 "pipeline_parser_gen.cpp"
break;
- case 340:
-#line 1424 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 376: // compExprs: lt
+#line 1566 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 4253 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4541 "pipeline_parser_gen.cpp"
break;
- case 341:
-#line 1424 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 377: // compExprs: lte
+#line 1566 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 4259 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4547 "pipeline_parser_gen.cpp"
break;
- case 342:
-#line 1424 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 378: // compExprs: ne
+#line 1566 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 4265 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4553 "pipeline_parser_gen.cpp"
break;
- case 343:
-#line 1426 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 379: // cmp: "object" CMP exprFixedTwoArg "end of object"
+#line 1568 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::cmp, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 4274 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4562 "pipeline_parser_gen.cpp"
break;
- case 344:
-#line 1431 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 380: // eq: "object" EQ exprFixedTwoArg "end of object"
+#line 1573 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::eq, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 4283 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4571 "pipeline_parser_gen.cpp"
break;
- case 345:
-#line 1436 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 381: // gt: "object" GT exprFixedTwoArg "end of object"
+#line 1578 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::gt, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 4292 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4580 "pipeline_parser_gen.cpp"
break;
- case 346:
-#line 1441 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 382: // gte: "object" GTE exprFixedTwoArg "end of object"
+#line 1583 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::gte, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 4301 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4589 "pipeline_parser_gen.cpp"
break;
- case 347:
-#line 1446 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 383: // lt: "object" LT exprFixedTwoArg "end of object"
+#line 1588 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::lt, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 4310 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4598 "pipeline_parser_gen.cpp"
break;
- case 348:
-#line 1451 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 384: // lte: "object" LTE exprFixedTwoArg "end of object"
+#line 1593 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::lte, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 4319 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4607 "pipeline_parser_gen.cpp"
break;
- case 349:
-#line 1456 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 385: // ne: "object" NE exprFixedTwoArg "end of object"
+#line 1598 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::ne, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 4328 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4616 "pipeline_parser_gen.cpp"
break;
- case 350:
-#line 1462 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 386: // typeExpression: convert
+#line 1604 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 4334 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4622 "pipeline_parser_gen.cpp"
break;
- case 351:
-#line 1463 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 387: // typeExpression: toBool
+#line 1605 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 4340 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4628 "pipeline_parser_gen.cpp"
break;
- case 352:
-#line 1464 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 388: // typeExpression: toDate
+#line 1606 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 4346 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4634 "pipeline_parser_gen.cpp"
break;
- case 353:
-#line 1465 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 389: // typeExpression: toDecimal
+#line 1607 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 4352 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4640 "pipeline_parser_gen.cpp"
break;
- case 354:
-#line 1466 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 390: // typeExpression: toDouble
+#line 1608 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 4358 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4646 "pipeline_parser_gen.cpp"
break;
- case 355:
-#line 1467 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 391: // typeExpression: toInt
+#line 1609 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 4364 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4652 "pipeline_parser_gen.cpp"
break;
- case 356:
-#line 1468 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 392: // typeExpression: toLong
+#line 1610 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 4370 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4658 "pipeline_parser_gen.cpp"
break;
- case 357:
-#line 1469 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 393: // typeExpression: toObjectId
+#line 1611 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 4376 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4664 "pipeline_parser_gen.cpp"
break;
- case 358:
-#line 1470 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 394: // typeExpression: toString
+#line 1612 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 4382 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4670 "pipeline_parser_gen.cpp"
break;
- case 359:
-#line 1471 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 395: // typeExpression: type
+#line 1613 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>());
}
-#line 4388 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4676 "pipeline_parser_gen.cpp"
break;
- case 360:
-#line 1476 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 396: // onErrorArg: %empty
+#line 1618 "pipeline_grammar.yy"
{
yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() =
std::pair{KeyFieldname::onErrorArg, CNode{KeyValue::absentKey}};
}
-#line 4396 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4684 "pipeline_parser_gen.cpp"
break;
- case 361:
-#line 1479 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 397: // onErrorArg: "onError argument" expression
+#line 1621 "pipeline_grammar.yy"
{
yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = std::pair{
KeyFieldname::onErrorArg, YY_MOVE(yystack_[0].value.as<CNode>())};
}
-#line 4404 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4692 "pipeline_parser_gen.cpp"
break;
- case 362:
-#line 1486 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 398: // onNullArg: %empty
+#line 1628 "pipeline_grammar.yy"
{
yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() =
std::pair{KeyFieldname::onNullArg, CNode{KeyValue::absentKey}};
}
-#line 4412 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4700 "pipeline_parser_gen.cpp"
break;
- case 363:
-#line 1489 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 399: // onNullArg: "onNull argument" expression
+#line 1631 "pipeline_grammar.yy"
{
yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = std::pair{
KeyFieldname::onNullArg, YY_MOVE(yystack_[0].value.as<CNode>())};
}
-#line 4420 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4708 "pipeline_parser_gen.cpp"
break;
- case 364:
-#line 1496 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 400: // convert: "object" CONVERT START_ORDERED_OBJECT "input argument"
+ // expression onErrorArg onNullArg "to argument" expression "end of
+ // object" "end of object"
+#line 1638 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::convert,
@@ -4813,92 +5144,92 @@ int PipelineParserGen::parse() {
YY_MOVE(yystack_[4]
.value.as<std::pair<CNode::Fieldname, CNode>>())}}}}};
}
-#line 4431 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4719 "pipeline_parser_gen.cpp"
break;
- case 365:
-#line 1505 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 401: // toBool: "object" TO_BOOL expression "end of object"
+#line 1647 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::toBool, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 4439 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4727 "pipeline_parser_gen.cpp"
break;
- case 366:
-#line 1510 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 402: // toDate: "object" TO_DATE expression "end of object"
+#line 1652 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::toDate, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 4447 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4735 "pipeline_parser_gen.cpp"
break;
- case 367:
-#line 1515 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 403: // toDecimal: "object" TO_DECIMAL expression "end of object"
+#line 1657 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::toDecimal, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 4455 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4743 "pipeline_parser_gen.cpp"
break;
- case 368:
-#line 1520 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 404: // toDouble: "object" TO_DOUBLE expression "end of object"
+#line 1662 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::toDouble, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 4463 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4751 "pipeline_parser_gen.cpp"
break;
- case 369:
-#line 1525 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 405: // toInt: "object" TO_INT expression "end of object"
+#line 1667 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::toInt, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 4471 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4759 "pipeline_parser_gen.cpp"
break;
- case 370:
-#line 1530 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 406: // toLong: "object" TO_LONG expression "end of object"
+#line 1672 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::toLong, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 4479 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4767 "pipeline_parser_gen.cpp"
break;
- case 371:
-#line 1535 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 407: // toObjectId: "object" TO_OBJECT_ID expression "end of object"
+#line 1677 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::toObjectId, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 4487 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4775 "pipeline_parser_gen.cpp"
break;
- case 372:
-#line 1540 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 408: // toString: "object" TO_STRING expression "end of object"
+#line 1682 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::toString, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 4495 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4783 "pipeline_parser_gen.cpp"
break;
- case 373:
-#line 1545 "src/mongo/db/cst/pipeline_grammar.yy"
+ case 409: // type: "object" TYPE expression "end of object"
+#line 1687 "pipeline_grammar.yy"
{
yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{
{KeyFieldname::type, YY_MOVE(yystack_[1].value.as<CNode>())}}};
}
-#line 4503 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4791 "pipeline_parser_gen.cpp"
break;
-#line 4507 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 4795 "pipeline_parser_gen.cpp"
default:
break;
@@ -4914,7 +5245,6 @@ int PipelineParserGen::parse() {
YY_SYMBOL_PRINT("-> $$ =", yylhs);
yypop_(yylen);
yylen = 0;
- YY_STACK_PRINT();
// Shift the result of the reduction.
yypush_(YY_NULLPTR, YY_MOVE(yylhs));
@@ -4929,7 +5259,9 @@ int PipelineParserGen::parse() {
// If not already recovering from an error, report this error.
if (!yyerrstatus_) {
++yynerrs_;
- error(yyla.location, yysyntax_error_(yystack_[0].state, yyla));
+ context yyctx(*this, yyla);
+ std::string msg = yysyntax_error_(yyctx);
+ error(yyla.location, YY_MOVE(msg));
}
@@ -4939,7 +5271,7 @@ int PipelineParserGen::parse() {
error, discard it. */
// Return failure if at end of input.
- if (yyla.type_get() == yyeof_)
+ if (yyla.kind() == symbol_kind::S_YYEOF)
YYABORT;
else if (!yyla.empty()) {
yy_destroy_("Error: discarding", yyla);
@@ -4964,6 +5296,7 @@ int PipelineParserGen::parse() {
this YYERROR. */
yypop_(yylen);
yylen = 0;
+ YY_STACK_PRINT();
goto yyerrlab1;
@@ -4972,28 +5305,29 @@ int PipelineParserGen::parse() {
`-------------------------------------------------------------*/
yyerrlab1:
yyerrstatus_ = 3; // Each real token shifted decrements this.
- {
- stack_symbol_type error_token;
- for (;;) {
- yyn = yypact_[+yystack_[0].state];
- if (!yy_pact_value_is_default_(yyn)) {
- yyn += yy_error_token_;
- if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yy_error_token_) {
- yyn = yytable_[yyn];
- if (0 < yyn)
- break;
- }
+ // Pop stack until we find a state that shifts the error token.
+ for (;;) {
+ yyn = yypact_[+yystack_[0].state];
+ if (!yy_pact_value_is_default_(yyn)) {
+ yyn += symbol_kind::S_YYerror;
+ if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == symbol_kind::S_YYerror) {
+ yyn = yytable_[yyn];
+ if (0 < yyn)
+ break;
}
+ }
- // Pop the current state because it cannot handle the error token.
- if (yystack_.size() == 1)
- YYABORT;
+ // Pop the current state because it cannot handle the error token.
+ if (yystack_.size() == 1)
+ YYABORT;
- yyerror_range[1].location = yystack_[0].location;
- yy_destroy_("Error: popping", yystack_[0]);
- yypop_();
- YY_STACK_PRINT();
- }
+ yyerror_range[1].location = yystack_[0].location;
+ yy_destroy_("Error: popping", yystack_[0]);
+ yypop_();
+ YY_STACK_PRINT();
+ }
+ {
+ stack_symbol_type error_token;
yyerror_range[2].location = yyla.location;
YYLLOC_DEFAULT(error_token.location, yyerror_range, 2);
@@ -5031,6 +5365,7 @@ int PipelineParserGen::parse() {
/* Do not reclaim the symbols of the rule whose action triggered
this YYABORT or YYACCEPT. */
yypop_(yylen);
+ YY_STACK_PRINT();
while (1 < yystack_.size()) {
yy_destroy_("Cleanup: popping", yystack_[0]);
yypop_();
@@ -5059,16 +5394,85 @@ void PipelineParserGen::error(const syntax_error& yyexc) {
error(yyexc.location, yyexc.what());
}
-// Generate an error message.
-std::string PipelineParserGen::yysyntax_error_(state_type yystate, const symbol_type& yyla) const {
- // Number of reported tokens (one for the "unexpected", one per
- // "expected").
- std::ptrdiff_t yycount = 0;
- // Its maximum.
- enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
- // Arguments of yyformat.
- char const* yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+/* Return YYSTR after stripping away unnecessary quotes and
+ backslashes, so that it's suitable for yyerror. The heuristic is
+ that double-quoting is unnecessary unless the string contains an
+ apostrophe, a comma, or backslash (other than backslash-backslash).
+ YYSTR is taken from yytname. */
+std::string PipelineParserGen::yytnamerr_(const char* yystr) {
+ if (*yystr == '"') {
+ std::string yyr;
+ char const* yyp = yystr;
+
+ for (;;)
+ switch (*++yyp) {
+ case '\'':
+ case ',':
+ goto do_not_strip_quotes;
+
+ case '\\':
+ if (*++yyp != '\\')
+ goto do_not_strip_quotes;
+ else
+ goto append;
+
+ append:
+ default:
+ yyr += *yyp;
+ break;
+ case '"':
+ return yyr;
+ }
+ do_not_strip_quotes:;
+ }
+
+ return yystr;
+}
+
+std::string PipelineParserGen::symbol_name(symbol_kind_type yysymbol) {
+ return yytnamerr_(yytname_[yysymbol]);
+}
+
+
+// PipelineParserGen::context.
+PipelineParserGen::context::context(const PipelineParserGen& yyparser, const symbol_type& yyla)
+ : yyparser_(yyparser), yyla_(yyla) {}
+
+int PipelineParserGen::context::expected_tokens(symbol_kind_type yyarg[], int yyargn) const {
+ // Actual number of expected tokens
+ int yycount = 0;
+
+ int yyn = yypact_[+yyparser_.yystack_[0].state];
+ if (!yy_pact_value_is_default_(yyn)) {
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. In other words, skip the first -YYN actions for
+ this state because they are default actions. */
+ int yyxbegin = yyn < 0 ? -yyn : 0;
+ // Stay within bounds of both yycheck and yytname.
+ int yychecklim = yylast_ - yyn + 1;
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+ for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck_[yyx + yyn] == yyx && yyx != symbol_kind::S_YYerror &&
+ !yy_table_value_is_error_(yytable_[yyx + yyn])) {
+ if (!yyarg)
+ ++yycount;
+ else if (yycount == yyargn)
+ return 0;
+ else
+ yyarg[yycount++] = YY_CAST(symbol_kind_type, yyx);
+ }
+ }
+
+ if (yyarg && yycount == 0 && 0 < yyargn)
+ yyarg[0] = symbol_kind::S_YYEMPTY;
+ return yycount;
+}
+
+
+int PipelineParserGen::yy_syntax_error_arguments_(const context& yyctx,
+ symbol_kind_type yyarg[],
+ int yyargn) const {
/* There are many possibilities here to consider:
- If this state is a consistent state with a default action, then
the only way this function was invoked is if the default action
@@ -5093,30 +5497,23 @@ std::string PipelineParserGen::yysyntax_error_(state_type yystate, const symbol_
one exception: it will still contain any token that will not be
accepted due to an error action in a later state.
*/
- if (!yyla.empty()) {
- symbol_number_type yytoken = yyla.type_get();
- yyarg[yycount++] = yytname_[yytoken];
-
- int yyn = yypact_[+yystate];
- if (!yy_pact_value_is_default_(yyn)) {
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. In other words, skip the first -YYN actions for
- this state because they are default actions. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
- // Stay within bounds of both yycheck and yytname.
- int yychecklim = yylast_ - yyn + 1;
- int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
- for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck_[yyx + yyn] == yyx && yyx != yy_error_token_ &&
- !yy_table_value_is_error_(yytable_[yyx + yyn])) {
- if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) {
- yycount = 1;
- break;
- } else
- yyarg[yycount++] = yytname_[yyx];
- }
- }
+
+ if (!yyctx.lookahead().empty()) {
+ if (yyarg)
+ yyarg[0] = yyctx.token();
+ int yyn = yyctx.expected_tokens(yyarg ? yyarg + 1 : yyarg, yyargn - 1);
+ return yyn + 1;
}
+ return 0;
+}
+
+// Generate an error message.
+std::string PipelineParserGen::yysyntax_error_(const context& yyctx) const {
+ // Its maximum.
+ enum { YYARGS_MAX = 5 };
+ // Arguments of yyformat.
+ symbol_kind_type yyarg[YYARGS_MAX];
+ int yycount = yy_syntax_error_arguments_(yyctx, yyarg, YYARGS_MAX);
char const* yyformat = YY_NULLPTR;
switch (yycount) {
@@ -5139,7 +5536,7 @@ std::string PipelineParserGen::yysyntax_error_(state_type yystate, const symbol_
std::ptrdiff_t yyi = 0;
for (char const* yyp = yyformat; *yyp; ++yyp)
if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) {
- yyres += yytnamerr_(yyarg[yyi++]);
+ yyres += symbol_name(yyarg[yyi++]);
++yyp;
} else
yyres += *yyp;
@@ -5147,295 +5544,344 @@ std::string PipelineParserGen::yysyntax_error_(state_type yystate, const symbol_
}
-const short PipelineParserGen::yypact_ninf_ = -557;
+const short PipelineParserGen::yypact_ninf_ = -550;
const signed char PipelineParserGen::yytable_ninf_ = -1;
const short PipelineParserGen::yypact_[] = {
- -56, -40, -38, 45, -6, -557, -557, -557, -557, 119, 37, 854, -2, -8, 0, 3,
- -8, -557, 47, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557,
- -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, 529, -557, -557,
- -557, -557, 51, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557,
- -557, 73, -557, 88, 24, -6, -557, -557, 529, -557, -557, -557, -557, -557, -557, -557,
- -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557,
- -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557,
- -557, -557, -557, -557, -557, -557, 359, -8, 8, -557, -557, 529, 85, 454, -557, -557,
- -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557,
- 738, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557,
- -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557,
- -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557,
- -557, -557, -557, 738, -557, -557, -557, -557, -557, 72, 113, -557, -557, -557, -557, -557,
- -557, -557, -557, 529, -557, -557, -557, -557, -557, -557, -557, 549, 664, -557, -557, -557,
- -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557,
- -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557,
- -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557,
- -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557,
- -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557,
- -557, -557, -557, -557, -557, -557, -557, -557, -22, -557, -557, 549, -557, 100, 549, 61,
- 61, 62, 549, 62, 63, 64, -557, -557, -557, 67, 62, 549, 549, 62, 62, 68,
- 75, 76, 549, 79, 549, 62, 62, -557, 83, 86, 62, 87, 61, 89, -557, -557,
- -557, -557, -557, 92, -557, 96, 549, 98, 549, 549, 99, 103, 105, 107, 549, 549,
- 549, 549, 549, 549, 549, 549, 549, 549, -557, 108, 549, 785, 124, -557, -557, 158,
- 159, 160, 549, 161, 162, 164, 549, 529, 189, 193, 195, 549, 168, 169, 170, 171,
- 172, 549, 549, 529, 175, 549, 176, 177, 179, 210, 549, 549, 181, 549, 182, 549,
- 183, 208, 185, 186, 214, 215, 549, 210, 549, 196, 549, 197, 198, 549, 549, 549,
- 549, 200, 202, 203, 204, 206, 207, 209, 211, 212, 213, 210, 549, 216, -557, 549,
- -557, -557, -557, -557, -557, -557, -557, -557, -557, 549, -557, -557, -557, 220, 221, 549,
- 549, 549, 549, -557, -557, -557, -557, -557, 549, 549, 222, -557, 549, -557, -557, -557,
- 549, 219, 549, 549, -557, 223, -557, 549, -557, 549, -557, -557, 549, 549, 549, 232,
- 549, -557, 549, -557, -557, 549, 549, 549, 549, -557, -557, -557, -557, -557, -557, -557,
- -557, -557, -557, 234, 549, -557, -557, 224, 225, 227, 237, 249, 249, 230, 549, 549,
- 235, 233, -557, 549, 238, 549, 236, 239, 260, 264, 265, 243, 549, 244, 245, 549,
- 549, 549, 246, 549, 248, -557, -557, -557, 549, 270, 549, 266, 266, 251, 549, 250,
- 253, -557, 254, 255, 256, 258, -557, 259, 549, 272, 549, 549, 261, 262, 263, 268,
- 267, 273, 277, 271, 278, 279, -557, 549, 280, -557, 549, 237, 270, -557, -557, 281,
- 282, -557, 283, -557, 284, -557, -557, 549, 276, 295, -557, 285, -557, -557, 286, 287,
- 288, -557, 289, -557, -557, 549, -557, 270, 291, -557, -557, -557, -557, 292, 549, 549,
- -557, -557, -557, -557, -557, 293, 294, 296, -557, 297, 298, 299, 302, -557, 304, 305,
- -557, -557, -557, -557};
+ -108, -65, -69, -61, 57, -27, -550, -550, -550, -550, -550, -550, 56, 53, 135, 23,
+ -24, 136, 81, 85, 136, -550, 142, -550, -550, -550, -550, -550, -550, -550, -550, -550,
+ -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550,
+ -550, 760, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550,
+ -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550,
+ -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550,
+ -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550,
+ -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550,
+ 127, -550, 169, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550,
+ -550, -550, -550, -550, -550, -550, -550, -550, -550, 196, -550, 237, 166, -27, -550, -550,
+ -550, 760, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550,
+ -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550,
+ -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550,
+ -550, -550, -550, -550, -550, -550, -550, 207, -550, -550, -550, 220, 136, -48, -550, -550,
+ 760, 238, 674, 40, -550, 1077, 1077, -550, -550, -550, -550, -550, 236, 262, -550, -550,
+ -550, 760, -550, -550, -550, 249, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550,
+ -550, -550, -550, -550, 866, 992, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550,
+ -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550,
+ -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550,
+ -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550,
+ -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550,
+ -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550,
+ -550, 36, -550, -550, -550, 866, -550, 266, 866, 221, 221, 229, 866, 229, 244, 246,
+ -550, -550, -550, 247, 229, 866, 866, 229, 229, 248, 250, 251, 866, 253, 866, 229,
+ 229, -550, 254, 257, 229, 259, 221, 260, -550, -550, -550, -550, -550, 261, -550, 269,
+ 866, 270, 866, 866, 271, 272, 273, 274, 866, 866, 866, 866, 866, 866, 866, 866,
+ 866, 866, -550, 275, 866, 1198, 294, -550, -550, 307, 321, 322, 866, 323, 324, 325,
+ 866, 760, 354, 359, 361, 866, 330, 332, 333, 334, 336, 866, 866, 760, 339, 866,
+ 341, 342, 343, 380, 866, 866, 347, 866, 348, 866, 352, 382, 355, 356, 387, 388,
+ 866, 380, 866, 363, 866, 364, 365, 866, 866, 866, 866, 366, 370, 372, 375, 376,
+ 377, 378, 389, 390, 392, 380, 866, 393, -550, 866, -550, -550, -550, -550, -550, -550,
+ -550, -550, -550, 866, -550, -550, -550, 360, 395, 866, 866, 866, 866, -550, -550, -550,
+ -550, -550, 866, 866, 396, -550, 866, -550, -550, -550, 866, 424, 866, 866, -550, 398,
+ -550, 866, -550, 866, -550, -550, 866, 866, 866, 426, 866, -550, 866, -550, -550, 866,
+ 866, 866, 866, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, 428, 866, -550,
+ -550, 402, 403, 404, 429, 434, 434, 407, 866, 866, 409, 408, -550, 866, 411, 866,
+ 412, 414, 436, 444, 445, 420, 866, 421, 422, 866, 866, 866, 423, 866, 430, -550,
+ -550, -550, 866, 451, 866, 447, 447, 431, 866, 433, 435, -550, 438, 440, 441, 437,
+ -550, 446, 866, 453, 866, 866, 448, 449, 450, 452, 454, 455, 456, 458, 459, 461,
+ -550, 866, 466, -550, 866, 429, 451, -550, -550, 462, 463, -550, 464, -550, 465, -550,
+ -550, 866, 473, 478, -550, 467, -550, -550, 468, 469, 471, -550, 472, -550, -550, 866,
+ -550, 451, 474, -550, -550, -550, -550, 475, 866, 866, -550, -550, -550, -550, -550, 480,
+ 481, 482, -550, 483, 484, 487, 488, -550, 490, 491, -550, -550, -550, -550};
const short PipelineParserGen::yydefact_[] = {
- 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, 84, 73, 83, 80, 87, 81, 76, 78, 79, 86, 74, 85,
- 88, 75, 82, 77, 58, 219, 66, 0, 65, 64, 63, 60, 0, 173, 171, 167, 169, 166, 168,
- 170, 172, 18, 19, 20, 21, 23, 25, 0, 22, 0, 0, 5, 175, 174, 325, 328, 150, 153,
- 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 151, 152, 185, 186, 187, 188, 189,
- 194, 190, 191, 192, 195, 196, 62, 176, 177, 179, 180, 181, 193, 182, 183, 184, 320, 321, 322,
- 323, 178, 61, 16, 0, 0, 0, 8, 6, 325, 0, 0, 113, 89, 91, 90, 114, 96, 128,
- 92, 103, 129, 130, 115, 24, 97, 116, 117, 98, 99, 0, 131, 132, 93, 118, 119, 120, 100,
- 101, 133, 121, 122, 102, 95, 94, 123, 134, 135, 136, 138, 137, 124, 139, 140, 125, 67, 70,
- 71, 72, 69, 68, 143, 141, 142, 144, 145, 146, 126, 104, 105, 106, 107, 108, 109, 147, 110,
- 111, 149, 148, 127, 112, 0, 55, 56, 57, 54, 26, 0, 0, 326, 324, 327, 332, 333, 334,
- 331, 335, 0, 329, 49, 48, 47, 45, 41, 43, 197, 212, 40, 42, 44, 46, 36, 37, 38,
- 39, 50, 51, 52, 29, 30, 31, 32, 33, 34, 35, 27, 53, 202, 203, 204, 220, 221, 205,
- 254, 255, 256, 206, 316, 317, 209, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271,
- 272, 273, 274, 275, 276, 277, 278, 279, 281, 280, 207, 336, 337, 338, 339, 340, 341, 342, 208,
- 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 222, 223, 224, 225, 226, 227, 228, 229, 230,
- 231, 232, 233, 234, 235, 236, 28, 15, 0, 330, 199, 197, 200, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 7, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 0, 7, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0,
- 0, 198, 210, 0, 0, 0, 0, 0, 0, 0, 197, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 294, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 294, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 294, 0, 0, 211, 0, 216, 217, 215, 218, 213, 17, 239, 237,
- 257, 0, 238, 240, 343, 0, 0, 0, 0, 0, 0, 344, 242, 243, 345, 346, 0, 0, 0,
- 244, 0, 246, 347, 348, 0, 0, 0, 0, 349, 0, 258, 0, 302, 0, 303, 304, 0, 0,
- 0, 0, 0, 251, 0, 308, 309, 0, 0, 0, 0, 365, 366, 367, 368, 369, 370, 314, 371,
- 372, 315, 0, 0, 373, 214, 0, 0, 0, 360, 283, 283, 0, 289, 289, 0, 0, 295, 0,
- 0, 197, 0, 0, 299, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 201, 282,
- 318, 0, 362, 0, 285, 285, 0, 290, 0, 0, 319, 0, 0, 0, 0, 259, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 361, 0, 0, 284, 0, 360, 362,
- 241, 291, 0, 0, 245, 0, 247, 0, 249, 300, 0, 0, 0, 250, 0, 307, 310, 0, 0,
- 0, 252, 0, 253, 363, 0, 286, 362, 0, 292, 293, 296, 248, 0, 0, 0, 297, 311, 312,
- 313, 298, 0, 0, 0, 301, 0, 0, 0, 0, 288, 0, 0, 364, 287, 306, 305};
+ 0, 0, 0, 0, 0, 6, 2, 68, 3, 340, 4, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 8, 0, 10, 11, 12, 13, 14, 15, 5, 93, 82, 92, 89, 96, 90, 85, 87,
+ 88, 95, 83, 94, 97, 84, 91, 86, 67, 239, 75, 0, 74, 73, 72, 69, 122, 98, 100,
+ 99, 123, 105, 137, 101, 112, 138, 139, 124, 339, 106, 125, 126, 107, 108, 140, 141, 102, 127,
+ 128, 129, 109, 110, 142, 143, 130, 131, 111, 104, 103, 132, 144, 145, 146, 148, 147, 133, 149,
+ 150, 134, 76, 79, 80, 81, 78, 77, 153, 151, 152, 154, 155, 156, 135, 113, 114, 115, 116,
+ 117, 118, 157, 119, 120, 159, 158, 136, 121, 368, 369, 370, 367, 371, 0, 341, 0, 193, 192,
+ 191, 189, 188, 187, 181, 180, 179, 185, 184, 183, 178, 182, 186, 190, 19, 20, 21, 22, 24,
+ 26, 0, 23, 0, 0, 6, 195, 194, 161, 361, 364, 162, 160, 165, 166, 167, 168, 169, 170,
+ 171, 172, 173, 174, 175, 176, 177, 163, 164, 205, 206, 207, 208, 209, 214, 210, 211, 212, 215,
+ 216, 71, 196, 197, 199, 200, 201, 213, 202, 203, 204, 356, 357, 358, 359, 198, 70, 349, 348,
+ 347, 346, 343, 342, 345, 344, 0, 350, 351, 17, 0, 0, 0, 9, 7, 361, 0, 0, 0,
+ 25, 0, 0, 64, 65, 66, 63, 27, 0, 0, 362, 360, 363, 0, 365, 336, 337, 0, 58,
+ 57, 54, 53, 56, 50, 49, 52, 42, 41, 44, 46, 45, 48, 217, 232, 43, 47, 51, 55,
+ 37, 38, 39, 40, 59, 60, 61, 30, 31, 32, 33, 34, 35, 36, 28, 62, 222, 223, 224,
+ 240, 241, 225, 274, 275, 276, 226, 352, 353, 229, 280, 281, 282, 283, 284, 285, 286, 287, 288,
+ 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 301, 300, 227, 372, 373, 374, 375, 376,
+ 377, 378, 228, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 242, 243, 244, 245, 246, 247,
+ 248, 249, 250, 251, 252, 253, 254, 255, 256, 29, 16, 0, 366, 338, 219, 217, 220, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 0, 8,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 8, 0, 0, 0, 0, 218, 230, 0, 0, 0, 0, 0, 0, 0, 217, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 314, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 314, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 314, 0, 0, 231, 0, 236, 237, 235, 238,
+ 233, 18, 259, 257, 277, 0, 258, 260, 379, 0, 0, 0, 0, 0, 0, 380, 262, 263, 381,
+ 382, 0, 0, 0, 264, 0, 266, 383, 384, 0, 0, 0, 0, 385, 0, 278, 0, 322, 0,
+ 323, 324, 0, 0, 0, 0, 0, 271, 0, 328, 329, 0, 0, 0, 0, 401, 402, 403, 404,
+ 405, 406, 334, 407, 408, 335, 0, 0, 409, 234, 0, 0, 0, 396, 303, 303, 0, 309, 309,
+ 0, 0, 315, 0, 0, 217, 0, 0, 319, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 221, 302, 354, 0, 398, 0, 305, 305, 0, 310, 0, 0, 355, 0, 0, 0, 0,
+ 279, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 397, 0, 0,
+ 304, 0, 396, 398, 261, 311, 0, 0, 265, 0, 267, 0, 269, 320, 0, 0, 0, 270, 0,
+ 327, 330, 0, 0, 0, 272, 0, 273, 399, 0, 306, 398, 0, 312, 313, 316, 268, 0, 0,
+ 0, 317, 331, 332, 333, 318, 0, 0, 0, 321, 0, 0, 0, 0, 308, 0, 0, 400, 307,
+ 326, 325};
const short PipelineParserGen::yypgoto_[] = {
- -557, -557, -557, -117, -557, -112, 191, -109, -115, -557, -557, -557, -557, -557, -114, -113,
- -105, -104, 4, -98, 6, -9, 12, -96, -79, -42, -84, -557, -78, -77, -76, -557,
- -73, -71, -69, -43, -557, -557, -557, -557, -557, -557, 231, -557, -557, -557, -557, -557,
- -557, -557, -557, 136, 2, -317, -67, -189, -286, -557, -557, -557, -557, -557, -557, -557,
- -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -219,
- -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557,
- -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557,
- -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -557, -245,
- -556, -181, -212, -396, -557, -304, 228, -182, -557, -557, -557, -557, -17, -557};
+ -550, -550, -550, -204, -550, -14, 287, -13, -12, 306, -550, -550, -550, -550, -174,
+ -97, -68, -51, -9, -41, -8, -10, -4, -39, -34, -43, -64, -550, -30, -28,
+ -26, -550, -22, -11, 24, -44, -550, -550, -550, -550, -550, -550, 316, -550, -550,
+ -550, -550, -550, -550, -550, -550, 283, -6, 11, 41, -35, -343, -550, -550, -550,
+ -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550,
+ -550, -550, -550, -550, -173, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550,
+ -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550,
+ -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550,
+ -550, -550, -550, -550, -550, -550, -550, -95, -549, -29, -60, -405, -550, -353, 315,
+ -25, -550, -550, -550, -550, -550, -550, -550, -550, -550, -550, -18, -550};
const short PipelineParserGen::yydefgoto_[] = {
- -1, 195, 447, 196, 45, 46, 198, 47, 48, 211, 200, 452, 212, 49, 90, 91, 92, 93,
- 94, 95, 96, 97, 98, 99, 100, 123, 102, 103, 104, 105, 106, 107, 108, 109, 110, 314,
- 112, 113, 114, 125, 115, 5, 10, 18, 19, 20, 21, 22, 23, 24, 118, 239, 63, 315,
- 316, 387, 241, 242, 379, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255,
- 256, 257, 258, 259, 260, 261, 262, 416, 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, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308,
- 309, 553, 584, 555, 587, 481, 569, 317, 124, 559, 7, 11, 116, 3, 417, 68};
+ -1, 230, 489, 123, 49, 124, 125, 126, 127, 128, 235, 494, 242, 53, 180, 181, 182, 183, 184,
+ 185, 186, 187, 188, 189, 190, 224, 192, 193, 194, 195, 196, 197, 198, 199, 200, 356, 202, 203,
+ 204, 226, 205, 6, 13, 22, 23, 24, 25, 26, 27, 28, 219, 280, 151, 357, 358, 429, 282,
+ 283, 421, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300,
+ 301, 302, 303, 458, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318,
+ 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337,
+ 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 595, 626, 597, 629, 523, 611,
+ 359, 225, 601, 8, 14, 206, 10, 15, 216, 217, 245, 129, 4, 459, 156};
const short PipelineParserGen::yytable_[] = {
- 67, 383, 111, 101, 61, 388, 197, 61, 206, 199, 210, 381, 52, 207, 397, 398, 209, 59, 66,
- 60, 59, 404, 60, 406, 51, 62, 52, 495, 62, 111, 225, 226, 616, 384, 385, 4, 202, 53,
- 6, 227, 228, 425, 54, 427, 428, 8, 229, 515, 230, 433, 434, 435, 436, 437, 438, 439, 440,
- 441, 442, 630, 232, 445, 414, 1, 2, 231, 233, 234, 235, 457, 9, 236, 25, 237, 50, 238,
- 64, 240, 466, 65, 111, 225, 226, 69, 472, 473, 461, 117, 476, 57, 227, 228, 119, 482, 483,
- 120, 485, 229, 487, 230, 121, 55, 56, 57, 58, 494, 74, 496, 311, 498, 61, 232, 501, 502,
- 503, 504, 231, 233, 234, 235, 204, 201, 236, 59, 237, 60, 238, 516, 240, 312, 518, 62, 418,
- 419, 389, 382, 219, 386, 390, 391, 519, 396, 395, 401, 399, 400, 522, 523, 524, 525, 402, 403,
- 407, 408, 405, 526, 527, 412, 410, 529, 453, 411, 413, 530, 415, 532, 533, 422, 111, 313, 535,
- 424, 536, 426, 429, 537, 538, 539, 430, 541, 431, 542, 432, 444, 543, 544, 545, 546, 12, 13,
- 14, 15, 16, 17, 454, 455, 456, 458, 459, 548, 460, 463, 464, 465, 467, 468, 469, 470, 471,
- 558, 558, 475, 477, 478, 563, 479, 480, 484, 486, 488, 489, 490, 491, 573, 492, 493, 576, 577,
- 578, 565, 580, 531, 497, 499, 500, 582, 505, 585, 506, 507, 508, 590, 509, 510, 540, 511, 547,
- 512, 513, 514, 552, 598, 517, 600, 601, 520, 521, 528, 534, 549, 554, 550, 448, 551, 451, 557,
- 612, 449, 562, 614, 450, 561, 566, 564, 567, 568, 570, 571, 572, 574, 575, 579, 621, 581, 583,
- 591, 586, 589, 592, 599, 593, 594, 595, 596, 622, 597, 629, 602, 603, 604, 122, 613, 606, 380,
- 605, 633, 634, 609, 607, 392, 393, 394, 608, 623, 610, 611, 208, 617, 618, 619, 620, 624, 625,
- 626, 627, 628, 409, 631, 632, 635, 636, 310, 637, 638, 639, 640, 420, 421, 641, 423, 642, 643,
- 615, 556, 588, 560, 0, 0, 111, 462, 0, 203, 0, 0, 0, 0, 0, 0, 0, 443, 111,
- 474, 126, 127, 128, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 129, 0, 0, 130, 131, 132, 133, 134, 135, 136, 0, 137, 0, 0, 138, 139, 140, 141,
- 142, 143, 144, 145, 146, 0, 147, 148, 149, 150, 0, 151, 152, 153, 154, 155, 156, 157, 158,
- 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 0, 0, 175,
- 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
- 44, 126, 127, 128, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 129, 0, 0, 130, 131, 132, 133, 134, 135, 136, 0, 137, 0, 0, 205, 139, 140, 141,
- 142, 143, 43, 145, 146, 0, 147, 148, 149, 150, 0, 151, 152, 153, 154, 155, 156, 157, 158,
- 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 0, 0, 175,
- 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
- 44, 70, 71, 0, 0, 0, 0, 0, 0, 0, 51, 0, 52, 0, 0, 0, 0, 0, 0,
- 0, 0, 70, 71, 53, 0, 0, 0, 0, 54, 0, 51, 0, 52, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 53, 0, 0, 0, 0, 54, 0, 0, 0, 0, 72, 73, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 219, 220, 0,
- 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 55, 56, 57, 58, 85, 86, 87, 88,
- 89, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 55, 56, 57, 58, 85, 86, 87,
- 88, 89, 318, 319, 320, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 321, 0, 0, 322, 323, 324, 325, 326, 327, 328, 0, 329, 0, 0, 0, 330, 331,
- 332, 333, 334, 0, 335, 336, 0, 337, 338, 339, 340, 0, 341, 342, 343, 344, 345, 346, 347,
- 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 0, 0, 0, 0, 0, 0, 0, 0,
- 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377,
- 378, 213, 214, 0, 0, 0, 0, 0, 0, 0, 215, 0, 216, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 217, 0, 0, 0, 0, 218, 0, 0, 26, 27, 28, 29, 30, 31, 32,
- 33, 34, 35, 36, 37, 38, 39, 40, 41, 0, 0, 0, 0, 0, 0, 219, 220, 0, 0,
- 0, 0, 0, 0, 446, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0,
- 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 221, 222, 223, 224, 85, 86, 87, 169,
- 170, 171, 172, 173, 174, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
- 40, 41, 0, 0, 0, 0, 0, 0, 44, 0, 0, 0, 0, 0, 0, 0, 42, 0, 0,
- 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 50, 51, 52, 155, 423, 201, 191, 149, 147, 148, 149, 147, 148, 150, 154, 231, 150, 7, 426,
+ 427, 5, 160, 1, 2, 3, 9, 54, 55, 56, 30, 31, 32, 33, 34, 35, 36, 37, 38,
+ 39, 40, 41, 42, 43, 44, 45, 57, 163, 456, 58, 59, 60, 61, 62, 63, 64, 266, 266,
+ 11, 65, 12, 537, 164, 130, 66, 67, 68, 69, 70, 71, 47, 72, 73, 134, 135, 136, 74,
+ 75, 76, 77, 503, 557, 658, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 29, 88, 89,
+ 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 672, 243, 103, 104, 105, 106,
+ 107, 108, 109, 201, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 267,
+ 267, 244, 16, 17, 18, 19, 20, 21, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+ 41, 42, 43, 44, 45, 237, 145, 207, 208, 268, 268, 209, 210, 273, 273, 152, 131, 132, 133,
+ 153, 134, 135, 136, 46, 211, 212, 269, 269, 201, 47, 157, 213, 214, 137, 138, 139, 270, 270,
+ 271, 271, 140, 141, 142, 272, 272, 201, 354, 274, 274, 275, 275, 276, 276, 232, 234, 277, 277,
+ 218, 149, 147, 148, 215, 236, 220, 150, 490, 278, 278, 460, 461, 607, 54, 55, 56, 30, 31,
+ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 57, 48, 221, 58, 59,
+ 60, 61, 62, 63, 64, 222, 279, 279, 65, 143, 144, 145, 146, 228, 67, 68, 69, 70, 71,
+ 229, 72, 73, 227, 281, 281, 74, 75, 76, 77, 352, 239, 353, 78, 79, 80, 81, 82, 83,
+ 84, 85, 86, 87, 355, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101,
+ 102, 424, 260, 103, 104, 105, 106, 107, 108, 109, 428, 110, 111, 112, 113, 114, 115, 116, 117,
+ 118, 119, 120, 121, 122, 48, 432, 431, 433, 437, 443, 495, 444, 445, 438, 447, 452, 441, 442,
+ 453, 422, 455, 457, 464, 496, 449, 450, 434, 435, 436, 454, 466, 468, 471, 472, 473, 474, 486,
+ 497, 498, 500, 501, 502, 505, 451, 506, 507, 509, 425, 510, 511, 512, 430, 513, 462, 463, 517,
+ 465, 519, 520, 521, 439, 440, 522, 526, 528, 201, 504, 446, 530, 448, 531, 532, 533, 534, 535,
+ 562, 485, 201, 516, 539, 541, 542, 547, 491, 492, 493, 548, 467, 549, 469, 470, 550, 551, 552,
+ 553, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 554, 555, 487, 556, 559, 563, 570, 573,
+ 576, 582, 499, 589, 591, 594, 592, 593, 596, 599, 604, 508, 603, 606, 610, 608, 609, 514, 515,
+ 612, 613, 518, 614, 616, 617, 621, 524, 525, 625, 527, 628, 529, 623, 641, 631, 633, 223, 634,
+ 536, 638, 538, 635, 540, 636, 637, 543, 544, 545, 546, 639, 655, 644, 645, 646, 664, 647, 648,
+ 649, 650, 665, 558, 651, 652, 560, 653, 659, 660, 661, 662, 233, 666, 667, 668, 561, 669, 670,
+ 351, 673, 674, 564, 565, 566, 567, 677, 678, 679, 680, 681, 568, 569, 682, 683, 571, 684, 685,
+ 241, 572, 657, 574, 575, 598, 630, 238, 577, 0, 578, 0, 602, 579, 580, 581, 0, 583, 0,
+ 584, 0, 0, 585, 586, 587, 588, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 600, 600, 0, 0, 0, 605, 0, 0, 0, 0,
+ 0, 0, 0, 0, 615, 0, 0, 618, 619, 620, 0, 622, 0, 0, 0, 0, 624, 0, 627,
+ 0, 0, 0, 632, 0, 0, 0, 0, 0, 0, 0, 0, 0, 640, 0, 642, 643, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 654, 0, 0, 656, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 663, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 671, 0, 0, 0, 0, 0, 0, 0, 0, 675, 676, 54, 55, 56, 30, 31, 32, 33,
+ 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 57, 0, 0, 58, 59, 60, 61,
+ 62, 63, 64, 0, 0, 0, 65, 0, 0, 0, 0, 240, 67, 68, 69, 70, 71, 47, 72,
+ 73, 0, 0, 0, 74, 75, 76, 77, 0, 0, 0, 78, 79, 80, 81, 82, 83, 84, 85,
+ 86, 87, 0, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 0,
+ 0, 103, 104, 105, 106, 107, 108, 109, 0, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
+ 120, 121, 122, 48, 158, 159, 0, 0, 0, 0, 0, 0, 0, 131, 132, 133, 0, 134, 135,
+ 136, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 137, 138, 139, 0, 0, 0, 0, 140,
+ 141, 142, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 161, 162, 0, 0, 0, 0, 0, 0, 0, 163,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 164, 165, 166, 167, 168,
+ 169, 170, 171, 172, 173, 174, 143, 144, 145, 146, 175, 176, 177, 178, 179, 158, 159, 0, 0,
+ 0, 0, 0, 0, 0, 131, 132, 133, 0, 134, 135, 136, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 137, 138, 139, 0, 0, 0, 0, 140, 141, 142, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 260, 261, 0, 0, 0, 0, 0, 0, 0, 163, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 143, 144,
+ 145, 146, 175, 176, 177, 178, 179, 360, 361, 362, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 363, 0, 0, 364, 365, 366, 367, 368, 369, 370, 0, 0,
+ 0, 371, 0, 0, 0, 0, 0, 372, 373, 374, 375, 376, 0, 377, 378, 0, 0, 0, 379,
+ 380, 381, 382, 0, 0, 0, 383, 384, 385, 0, 386, 387, 388, 389, 390, 391, 0, 392, 393,
+ 394, 395, 396, 397, 398, 399, 400, 0, 0, 0, 0, 0, 0, 0, 0, 401, 402, 403, 404,
+ 405, 406, 407, 0, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 246, 247,
+ 0, 0, 0, 0, 0, 0, 0, 248, 249, 250, 0, 251, 252, 253, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 254, 255, 256, 0, 0, 0, 0, 257, 258, 259, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 260, 261, 0, 0, 0, 0, 0, 0, 0, 163, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174,
+ 262, 263, 264, 265, 175, 176, 177, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
+ 42, 43, 44, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 488, 0, 0, 0, 0, 0, 47, 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, 0, 0, 0, 0, 0,
- 0, 44};
+ 0, 0, 0, 0, 97, 98, 99, 100, 101, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48};
const short PipelineParserGen::yycheck_[] = {
- 17, 318, 45, 45, 13, 322, 118, 16, 125, 118, 125, 315, 34, 125, 331, 332, 125, 13, 16,
- 13, 16, 338, 16, 340, 32, 13, 34, 423, 16, 72, 144, 144, 588, 319, 320, 75, 120, 45,
- 76, 144, 144, 358, 50, 360, 361, 0, 144, 443, 144, 366, 367, 368, 369, 370, 371, 372, 373,
- 374, 375, 615, 144, 378, 348, 119, 120, 144, 144, 144, 144, 386, 76, 144, 35, 144, 76, 144,
- 76, 144, 395, 76, 123, 195, 195, 36, 401, 402, 390, 36, 405, 111, 195, 195, 19, 410, 411,
- 7, 413, 195, 415, 195, 76, 109, 110, 111, 112, 422, 98, 424, 36, 426, 119, 195, 429, 430,
- 431, 432, 195, 195, 195, 195, 35, 119, 195, 119, 195, 119, 195, 444, 195, 16, 447, 119, 351,
- 352, 323, 35, 75, 75, 75, 75, 457, 330, 75, 75, 333, 334, 463, 464, 465, 466, 75, 75,
- 341, 342, 75, 472, 473, 346, 75, 476, 36, 75, 75, 480, 75, 482, 483, 75, 211, 211, 487,
- 75, 489, 75, 75, 492, 493, 494, 75, 496, 75, 498, 75, 75, 501, 502, 503, 504, 69, 70,
- 71, 72, 73, 74, 36, 36, 36, 36, 36, 516, 36, 12, 9, 8, 36, 36, 36, 36, 36,
- 526, 527, 36, 36, 36, 531, 36, 6, 36, 36, 36, 12, 36, 36, 540, 10, 10, 543, 544,
- 545, 533, 547, 12, 36, 36, 36, 552, 36, 554, 36, 36, 36, 558, 36, 36, 12, 36, 12,
- 36, 36, 36, 13, 568, 36, 570, 571, 35, 35, 35, 35, 35, 11, 36, 379, 36, 379, 35,
- 583, 379, 35, 586, 379, 36, 36, 35, 35, 15, 12, 12, 35, 35, 35, 35, 599, 35, 14,
- 35, 20, 36, 35, 17, 36, 36, 36, 35, 18, 36, 613, 36, 36, 36, 69, 21, 35, 312,
- 36, 622, 623, 36, 35, 326, 327, 328, 35, 18, 36, 36, 125, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, 343, 36, 36, 36, 36, 195, 36, 36, 36, 36, 353, 354, 36, 356, 36, 36,
- 587, 524, 556, 527, -1, -1, 391, 391, -1, 123, -1, -1, -1, -1, -1, -1, -1, 376, 403,
- 403, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
- 21, 22, -1, -1, 25, 26, 27, 28, 29, 30, 31, -1, 33, -1, -1, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, -1, 46, 47, 48, 49, -1, 51, 52, 53, 54, 55, 56, 57, 58,
- 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, -1, -1, 77,
- 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
- 97, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
- 21, 22, -1, -1, 25, 26, 27, 28, 29, 30, 31, -1, 33, -1, -1, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, -1, 46, 47, 48, 49, -1, 51, 52, 53, 54, 55, 56, 57, 58,
- 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, -1, -1, 77,
- 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
- 97, 23, 24, -1, -1, -1, -1, -1, -1, -1, 32, -1, 34, -1, -1, -1, -1, -1, -1,
- -1, -1, 23, 24, 45, -1, -1, -1, -1, 50, -1, 32, -1, 34, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, 50, -1, -1, -1, -1, 75, 76, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 75, 76, -1,
- 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
- 117, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115,
- 116, 117, 3, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 22, -1, -1, 25, 26, 27, 28, 29, 30, 31, -1, 33, -1, -1, -1, 37, 38,
- 39, 40, 41, -1, 43, 44, -1, 46, 47, 48, 49, -1, 51, 52, 53, 54, 55, 56, 57,
- 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, -1, -1, -1, -1, -1, -1, -1, -1,
- 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
- 96, 23, 24, -1, -1, -1, -1, -1, -1, -1, 32, -1, 34, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 45, -1, -1, -1, -1, 50, -1, -1, 6, 7, 8, 9, 10, 11, 12,
- 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, 75, 76, -1, -1,
- -1, -1, -1, -1, 36, -1, -1, -1, -1, -1, 42, -1, -1, -1, -1, -1, -1, -1, -1,
- 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 69,
- 70, 71, 72, 73, 74, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
- 20, 21, -1, -1, -1, -1, -1, -1, 97, -1, -1, -1, -1, -1, -1, -1, 36, -1, -1,
- -1, -1, -1, 42, -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,
+ 14, 14, 14, 21, 357, 49, 49, 17, 17, 17, 20, 20, 20, 17, 20, 219, 20, 86, 361,
+ 362, 85, 69, 130, 131, 132, 86, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ 15, 16, 17, 18, 19, 20, 21, 22, 94, 390, 25, 26, 27, 28, 29, 30, 31, 229, 230,
+ 0, 35, 86, 465, 109, 86, 40, 41, 42, 43, 44, 45, 46, 47, 48, 36, 37, 38, 52,
+ 53, 54, 55, 432, 485, 630, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 39, 70, 71,
+ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 657, 69, 87, 88, 89, 90,
+ 91, 92, 93, 161, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 229,
+ 230, 94, 79, 80, 81, 82, 83, 84, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 221, 122, 32, 33, 229, 230, 36, 37, 229, 230, 86, 32, 33, 34,
+ 86, 36, 37, 38, 40, 49, 50, 229, 230, 224, 46, 40, 56, 57, 49, 50, 51, 229, 230,
+ 229, 230, 56, 57, 58, 229, 230, 241, 241, 229, 230, 229, 230, 229, 230, 219, 219, 229, 230,
+ 40, 220, 220, 220, 86, 220, 19, 220, 421, 229, 230, 393, 394, 575, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 108, 7, 25, 26,
+ 27, 28, 29, 30, 31, 86, 229, 230, 35, 120, 121, 122, 123, 40, 41, 42, 43, 44, 45,
+ 46, 47, 48, 62, 229, 230, 52, 53, 54, 55, 40, 39, 16, 59, 60, 61, 62, 63, 64,
+ 65, 66, 67, 68, 40, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
+ 84, 39, 85, 87, 88, 89, 90, 91, 92, 93, 85, 95, 96, 97, 98, 99, 100, 101, 102,
+ 103, 104, 105, 106, 107, 108, 85, 365, 85, 85, 85, 40, 85, 85, 372, 85, 85, 375, 376,
+ 85, 353, 85, 85, 85, 40, 383, 384, 368, 369, 370, 388, 85, 85, 85, 85, 85, 85, 85,
+ 40, 40, 40, 40, 40, 12, 385, 9, 8, 40, 360, 40, 40, 40, 364, 40, 395, 396, 40,
+ 398, 40, 40, 40, 373, 374, 6, 40, 40, 433, 433, 380, 40, 382, 12, 40, 40, 10, 10,
+ 39, 418, 445, 445, 40, 40, 40, 40, 421, 421, 421, 40, 400, 40, 402, 403, 40, 40, 40,
+ 40, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 40, 40, 420, 40, 40, 39, 39, 12,
+ 39, 12, 428, 12, 39, 13, 40, 40, 11, 39, 39, 437, 40, 39, 15, 40, 39, 443, 444,
+ 12, 12, 447, 39, 39, 39, 39, 452, 453, 14, 455, 20, 457, 39, 17, 40, 39, 157, 39,
+ 464, 39, 466, 40, 468, 40, 40, 471, 472, 473, 474, 40, 21, 40, 40, 40, 18, 40, 39,
+ 39, 39, 18, 486, 40, 40, 489, 40, 40, 40, 40, 40, 219, 40, 40, 40, 499, 40, 40,
+ 230, 40, 40, 505, 506, 507, 508, 40, 40, 40, 40, 40, 514, 515, 40, 40, 518, 40, 40,
+ 226, 522, 629, 524, 525, 566, 598, 224, 529, -1, 531, -1, 569, 534, 535, 536, -1, 538, -1,
+ 540, -1, -1, 543, 544, 545, 546, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 558,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 568, 569, -1, -1, -1, 573, -1, -1, -1, -1,
+ -1, -1, -1, -1, 582, -1, -1, 585, 586, 587, -1, 589, -1, -1, -1, -1, 594, -1, 596,
+ -1, -1, -1, 600, -1, -1, -1, -1, -1, -1, -1, -1, -1, 610, -1, 612, 613, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 625, -1, -1, 628, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 641, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 655, -1, -1, -1, -1, -1, -1, -1, -1, 664, 665, 3, 4, 5, 6, 7, 8, 9,
+ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, 25, 26, 27, 28,
+ 29, 30, 31, -1, -1, -1, 35, -1, -1, -1, -1, 40, 41, 42, 43, 44, 45, 46, 47,
+ 48, -1, -1, -1, 52, 53, 54, 55, -1, -1, -1, 59, 60, 61, 62, 63, 64, 65, 66,
+ 67, 68, -1, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, -1,
+ -1, 87, 88, 89, 90, 91, 92, 93, -1, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
+ 105, 106, 107, 108, 23, 24, -1, -1, -1, -1, -1, -1, -1, 32, 33, 34, -1, 36, 37,
+ 38, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, -1, -1, -1, -1, 56,
+ 57, 58, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 69, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 109, 110, 111, 112, 113,
+ 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 23, 24, -1, -1,
+ -1, -1, -1, -1, -1, 32, 33, 34, -1, 36, 37, 38, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 49, 50, 51, -1, -1, -1, -1, 56, 57, 58, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 69, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
+ 122, 123, 124, 125, 126, 127, 128, 3, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, 25, 26, 27, 28, 29, 30, 31, -1, -1,
+ -1, 35, -1, -1, -1, -1, -1, 41, 42, 43, 44, 45, -1, 47, 48, -1, -1, -1, 52,
+ 53, 54, 55, -1, -1, -1, 59, 60, 61, -1, 63, 64, 65, 66, 67, 68, -1, 70, 71,
+ 72, 73, 74, 75, 76, 77, 78, -1, -1, -1, -1, -1, -1, -1, -1, 87, 88, 89, 90,
+ 91, 92, 93, -1, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 23, 24,
+ -1, -1, -1, -1, -1, -1, -1, 32, 33, 34, -1, 36, 37, 38, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 49, 50, 51, -1, -1, -1, -1, 56, 57, 58, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 69, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
+ 120, 121, 122, 123, 124, 125, 126, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
+ 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 40, -1, -1, -1, -1, -1, 46, -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, 97};
+ -1, -1, -1, -1, 79, 80, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 108};
const short PipelineParserGen::yystos_[] = {
- 0, 119, 120, 260, 75, 162, 76, 257, 0, 76, 163, 258, 69, 70, 71, 72, 73, 74, 164,
- 165, 166, 167, 168, 169, 170, 35, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
- 18, 19, 20, 21, 36, 42, 97, 125, 126, 128, 129, 134, 76, 32, 34, 45, 50, 109, 110,
- 111, 112, 139, 141, 142, 143, 173, 76, 76, 173, 261, 262, 36, 23, 24, 75, 76, 98, 99,
- 100, 101, 102, 103, 104, 105, 106, 107, 108, 113, 114, 115, 116, 117, 135, 136, 137, 138, 139,
- 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158,
- 159, 161, 259, 36, 171, 19, 7, 76, 163, 146, 255, 160, 3, 4, 5, 22, 25, 26, 27,
- 28, 29, 30, 31, 33, 36, 37, 38, 39, 40, 41, 42, 43, 44, 46, 47, 48, 49, 51,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
- 71, 72, 73, 74, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
- 92, 93, 94, 95, 96, 122, 124, 126, 127, 128, 131, 173, 147, 255, 35, 36, 124, 126, 127,
- 128, 129, 130, 133, 23, 24, 32, 34, 45, 50, 75, 76, 109, 110, 111, 112, 135, 136, 137,
- 138, 140, 144, 145, 147, 149, 150, 151, 153, 154, 155, 172, 175, 177, 178, 180, 181, 182, 183,
- 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 201, 202, 203,
- 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 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,
- 242, 243, 244, 245, 246, 247, 172, 36, 16, 146, 156, 174, 175, 254, 3, 4, 5, 22, 25,
- 26, 27, 28, 29, 30, 31, 33, 37, 38, 39, 40, 41, 43, 44, 46, 47, 48, 49, 51,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 77, 78,
- 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 179,
- 142, 254, 35, 174, 177, 177, 75, 176, 174, 176, 75, 75, 261, 261, 261, 75, 176, 174, 174,
- 176, 176, 75, 75, 75, 174, 75, 174, 176, 176, 261, 75, 75, 176, 75, 177, 75, 200, 261,
- 200, 200, 261, 261, 75, 261, 75, 174, 75, 174, 174, 75, 75, 75, 75, 174, 174, 174, 174,
- 174, 174, 174, 174, 174, 174, 261, 75, 174, 36, 123, 124, 126, 128, 129, 132, 36, 36, 36,
- 36, 174, 36, 36, 36, 254, 146, 12, 9, 8, 174, 36, 36, 36, 36, 36, 174, 174, 146,
- 36, 174, 36, 36, 36, 6, 252, 174, 174, 36, 174, 36, 174, 36, 12, 36, 36, 10, 10,
- 174, 252, 174, 36, 174, 36, 36, 174, 174, 174, 174, 36, 36, 36, 36, 36, 36, 36, 36,
- 36, 36, 252, 174, 36, 174, 174, 35, 35, 174, 174, 174, 174, 174, 174, 35, 174, 174, 12,
- 174, 174, 35, 174, 174, 174, 174, 174, 12, 174, 174, 174, 174, 174, 174, 12, 174, 35, 36,
- 36, 13, 248, 11, 250, 250, 35, 174, 256, 256, 36, 35, 174, 35, 254, 36, 35, 15, 253,
- 12, 12, 35, 174, 35, 35, 174, 174, 174, 35, 174, 35, 174, 14, 249, 174, 20, 251, 251,
- 36, 174, 35, 35, 36, 36, 36, 35, 36, 174, 17, 174, 174, 36, 36, 36, 36, 35, 35,
- 35, 36, 36, 36, 174, 21, 174, 248, 249, 36, 36, 36, 36, 174, 18, 18, 36, 36, 36,
- 36, 36, 174, 249, 36, 36, 174, 174, 36, 36, 36, 36, 36, 36, 36, 36, 36};
+ 0, 130, 131, 132, 278, 85, 174, 86, 269, 86, 272, 0, 86, 175, 270, 273, 79, 80, 81,
+ 82, 83, 84, 176, 177, 178, 179, 180, 181, 182, 39, 6, 7, 8, 9, 10, 11, 12, 13,
+ 14, 15, 16, 17, 18, 19, 20, 21, 40, 46, 108, 137, 138, 140, 141, 146, 3, 4, 5,
+ 22, 25, 26, 27, 28, 29, 30, 31, 35, 40, 41, 42, 43, 44, 45, 47, 48, 52, 53,
+ 54, 55, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 70, 71, 72, 73, 74, 75, 76,
+ 77, 78, 79, 80, 81, 82, 83, 84, 87, 88, 89, 90, 91, 92, 93, 95, 96, 97, 98,
+ 99, 100, 101, 102, 103, 104, 105, 106, 107, 136, 138, 139, 140, 141, 142, 277, 86, 32, 33,
+ 34, 36, 37, 38, 49, 50, 51, 56, 57, 58, 120, 121, 122, 123, 151, 153, 154, 155, 185,
+ 86, 86, 185, 279, 280, 40, 23, 24, 69, 85, 86, 94, 109, 110, 111, 112, 113, 114, 115,
+ 116, 117, 118, 119, 124, 125, 126, 127, 128, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156,
+ 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 173, 271, 32, 33,
+ 36, 37, 49, 50, 56, 57, 86, 274, 275, 40, 183, 19, 7, 86, 175, 158, 267, 172, 62,
+ 40, 46, 134, 136, 138, 139, 140, 143, 185, 159, 267, 39, 40, 142, 145, 69, 94, 276, 23,
+ 24, 32, 33, 34, 36, 37, 38, 49, 50, 51, 56, 57, 58, 85, 86, 120, 121, 122, 123,
+ 147, 148, 149, 150, 152, 156, 157, 159, 161, 162, 163, 165, 166, 167, 184, 187, 189, 190, 192,
+ 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211,
+ 213, 214, 215, 216, 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, 242, 243, 244, 245, 246, 247, 248, 249, 250,
+ 251, 252, 253, 254, 255, 256, 257, 258, 259, 184, 40, 16, 158, 40, 168, 186, 187, 266, 3,
+ 4, 5, 22, 25, 26, 27, 28, 29, 30, 31, 35, 41, 42, 43, 44, 45, 47, 48, 52,
+ 53, 54, 55, 59, 60, 61, 63, 64, 65, 66, 67, 68, 70, 71, 72, 73, 74, 75, 76,
+ 77, 78, 87, 88, 89, 90, 91, 92, 93, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
+ 105, 106, 107, 191, 154, 266, 39, 186, 189, 189, 85, 188, 186, 188, 85, 85, 279, 279, 279,
+ 85, 188, 186, 186, 188, 188, 85, 85, 85, 186, 85, 186, 188, 188, 279, 85, 85, 188, 85,
+ 189, 85, 212, 279, 212, 212, 279, 279, 85, 279, 85, 186, 85, 186, 186, 85, 85, 85, 85,
+ 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 279, 85, 186, 40, 135, 136, 138, 140, 141,
+ 144, 40, 40, 40, 40, 186, 40, 40, 40, 266, 158, 12, 9, 8, 186, 40, 40, 40, 40,
+ 40, 186, 186, 158, 40, 186, 40, 40, 40, 6, 264, 186, 186, 40, 186, 40, 186, 40, 12,
+ 40, 40, 10, 10, 186, 264, 186, 40, 186, 40, 40, 186, 186, 186, 186, 40, 40, 40, 40,
+ 40, 40, 40, 40, 40, 40, 264, 186, 40, 186, 186, 39, 39, 186, 186, 186, 186, 186, 186,
+ 39, 186, 186, 12, 186, 186, 39, 186, 186, 186, 186, 186, 12, 186, 186, 186, 186, 186, 186,
+ 12, 186, 39, 40, 40, 13, 260, 11, 262, 262, 39, 186, 268, 268, 40, 39, 186, 39, 266,
+ 40, 39, 15, 265, 12, 12, 39, 186, 39, 39, 186, 186, 186, 39, 186, 39, 186, 14, 261,
+ 186, 20, 263, 263, 40, 186, 39, 39, 40, 40, 40, 39, 40, 186, 17, 186, 186, 40, 40,
+ 40, 40, 39, 39, 39, 40, 40, 40, 186, 21, 186, 260, 261, 40, 40, 40, 40, 186, 18,
+ 18, 40, 40, 40, 40, 40, 186, 261, 40, 40, 186, 186, 40, 40, 40, 40, 40, 40, 40,
+ 40, 40};
const short PipelineParserGen::yyr1_[] = {
- 0, 121, 260, 260, 162, 163, 163, 262, 261, 164, 164, 164, 164, 164, 164, 170, 165, 166, 173,
- 173, 173, 173, 167, 168, 169, 171, 171, 131, 131, 172, 172, 172, 172, 172, 172, 172, 172, 172,
- 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 122, 122, 122,
- 122, 257, 258, 258, 134, 259, 125, 125, 125, 128, 124, 124, 124, 124, 124, 124, 126, 126, 126,
- 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 127, 127, 127, 127, 127, 127,
- 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127,
- 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127,
- 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 147, 148,
- 161, 149, 150, 151, 153, 154, 155, 135, 136, 137, 138, 140, 144, 145, 139, 139, 141, 141, 142,
- 142, 143, 143, 152, 152, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
- 156, 156, 156, 156, 156, 156, 156, 254, 254, 174, 174, 176, 175, 175, 175, 175, 175, 175, 175,
- 175, 177, 178, 179, 179, 132, 123, 123, 123, 123, 129, 180, 180, 180, 180, 180, 180, 180, 180,
- 180, 180, 180, 180, 180, 180, 180, 180, 180, 181, 182, 233, 234, 235, 236, 237, 238, 239, 240,
- 241, 242, 243, 244, 245, 246, 247, 183, 183, 183, 184, 185, 186, 190, 190, 190, 190, 190, 190,
- 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 191, 250, 250,
- 251, 251, 192, 193, 256, 256, 256, 194, 195, 252, 252, 196, 203, 213, 253, 253, 200, 197, 198,
- 199, 201, 202, 204, 205, 206, 207, 208, 209, 210, 211, 212, 187, 187, 188, 189, 146, 146, 157,
- 157, 158, 255, 255, 159, 160, 160, 133, 130, 130, 130, 130, 130, 214, 214, 214, 214, 214, 214,
- 214, 215, 216, 217, 218, 219, 220, 221, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 248,
- 248, 249, 249, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232};
+ 0, 133, 278, 278, 278, 174, 175, 175, 280, 279, 176, 176, 176, 176, 176, 176, 182, 177, 178,
+ 185, 185, 185, 185, 179, 180, 181, 183, 183, 143, 143, 184, 184, 184, 184, 184, 184, 184, 184,
+ 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184,
+ 184, 184, 184, 184, 184, 184, 134, 134, 134, 134, 269, 270, 270, 146, 271, 137, 137, 137, 140,
+ 136, 136, 136, 136, 136, 136, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138,
+ 138, 138, 138, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
+ 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
+ 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
+ 139, 139, 139, 139, 139, 139, 139, 139, 159, 159, 159, 160, 173, 161, 162, 163, 165, 166, 167,
+ 147, 148, 149, 150, 152, 156, 157, 151, 151, 151, 151, 153, 153, 153, 153, 154, 154, 154, 154,
+ 155, 155, 155, 155, 164, 164, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168,
+ 168, 168, 168, 168, 168, 168, 168, 168, 266, 266, 186, 186, 188, 187, 187, 187, 187, 187, 187,
+ 187, 187, 189, 190, 191, 191, 144, 135, 135, 135, 135, 141, 192, 192, 192, 192, 192, 192, 192,
+ 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 193, 194, 245, 246, 247, 248, 249, 250, 251,
+ 252, 253, 254, 255, 256, 257, 258, 259, 195, 195, 195, 196, 197, 198, 202, 202, 202, 202, 202,
+ 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 203, 262,
+ 262, 263, 263, 204, 205, 268, 268, 268, 206, 207, 264, 264, 208, 215, 225, 265, 265, 212, 209,
+ 210, 211, 213, 214, 216, 217, 218, 219, 220, 221, 222, 223, 224, 276, 276, 274, 272, 273, 273,
+ 275, 275, 275, 275, 275, 275, 275, 275, 277, 277, 199, 199, 200, 201, 158, 158, 169, 169, 170,
+ 267, 267, 171, 172, 172, 145, 142, 142, 142, 142, 142, 226, 226, 226, 226, 226, 226, 226, 227,
+ 228, 229, 230, 231, 232, 233, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 260, 260, 261,
+ 261, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244};
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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 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, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 1, 1, 4, 1,
- 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, 4, 4, 4, 4, 7, 4, 4, 4, 7, 4, 7, 8, 7, 7, 4, 7, 7, 1, 1, 1, 4, 4, 6, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 0, 2, 0, 2, 11, 10, 0,
- 1, 2, 8, 8, 0, 2, 8, 8, 8, 0, 2, 7, 4, 4, 4, 11, 11, 7, 4, 4, 7, 8, 8, 8, 4, 4, 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, 0, 2, 0, 2, 11, 4, 4, 4, 4, 4, 4, 4, 4, 4};
-
-
+ 0, 2, 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, 1,
+ 1, 1, 1, 1, 1, 1, 1, 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, 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, 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, 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, 4, 4, 4, 4, 7, 4, 4, 4, 7, 4, 7, 8, 7,
+ 7, 4, 7, 7, 1, 1, 1, 4, 4, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 6, 0, 2, 0, 2, 11, 10, 0, 1, 2, 8, 8, 0, 2, 8, 8, 8, 0, 2, 7, 4, 4, 4, 11, 11, 7, 4, 4,
+ 7, 8, 8, 8, 4, 4, 1, 1, 4, 3, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 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, 0, 2, 0, 2, 11, 4, 4, 4, 4, 4, 4, 4, 4, 4};
+
+
+#if YYDEBUG || 1
// YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
-// First, the terminals, then, starting at \a yyntokens_, nonterminals.
+// First, the terminals, then, starting at \a YYNTOKENS, nonterminals.
const char* const PipelineParserGen::yytname_[] = {"\"EOF\"",
"error",
- "$undefined",
+ "\"invalid token\"",
"ABS",
"ADD",
"AND",
@@ -5465,8 +5911,12 @@ const char* const PipelineParserGen::yytname_[] = {"\"EOF\"",
"CONVERT",
"DATE_FROM_STRING",
"DATE_TO_STRING",
+ "\"-1 (decimal)\"",
+ "\"1 (decimal)\"",
"\"zero (decimal)\"",
"DIVIDE",
+ "\"-1 (double)\"",
+ "\"1 (double)\"",
"\"zero (double)\"",
"\"end of array\"",
"\"end of object\"",
@@ -5478,21 +5928,27 @@ const char* const PipelineParserGen::yytname_[] = {"\"EOF\"",
"ID",
"INDEX_OF_BYTES",
"INDEX_OF_CP",
+ "\"-1 (int)\"",
+ "\"1 (int)\"",
"\"zero (int)\"",
"LITERAL",
"LN",
"LOG",
"LOGTEN",
+ "\"-1 (long)\"",
+ "\"1 (long)\"",
"\"zero (long)\"",
"LT",
"LTE",
"LTRIM",
+ "META",
"MOD",
"MULTIPLY",
"NE",
"NOT",
"OR",
"POW",
+ "\"randVal\"",
"REGEX_FIND",
"REGEX_FIND_ALL",
"REGEX_MATCH",
@@ -5517,6 +5973,7 @@ const char* const PipelineParserGen::yytname_[] = {"\"EOF\"",
"SUBSTR_BYTES",
"SUBSTR_CP",
"SUBTRACT",
+ "\"textScore\"",
"TO_BOOL",
"TO_DATE",
"TO_DECIMAL",
@@ -5542,10 +5999,10 @@ const char* const PipelineParserGen::yytname_[] = {"\"EOF\"",
"\"Code\"",
"\"Symbol\"",
"\"CodeWScope\"",
- "\"non-zero integer\"",
- "\"non-zero long\"",
- "\"non-zero double\"",
- "\"non-zero decimal\"",
+ "\"arbitrary integer\"",
+ "\"arbitrary long\"",
+ "\"arbitrary double\"",
+ "\"arbitrary decimal\"",
"\"Timestamp\"",
"\"minKey\"",
"\"maxKey\"",
@@ -5554,6 +6011,7 @@ const char* const PipelineParserGen::yytname_[] = {"\"EOF\"",
"\"$-prefixed fieldname\"",
"START_PIPELINE",
"START_MATCH",
+ "START_SORT",
"$accept",
"projectionFieldname",
"expressionFieldname",
@@ -5693,48 +6151,56 @@ const char* const PipelineParserGen::yytname_[] = {"\"EOF\"",
"matchExpression",
"filterFields",
"filterVal",
+ "sortSpecs",
+ "specList",
+ "metaSort",
+ "oneOrNegOne",
+ "metaSortKeyword",
+ "sortSpec",
"start",
"START_ORDERED_OBJECT",
"$@1",
YY_NULLPTR};
+#endif
+
#if YYDEBUG
const short PipelineParserGen::yyrline_[] = {
- 0, 282, 282, 286, 294, 300, 301, 309, 309, 312, 312, 312, 312, 312, 312, 315,
- 325, 331, 341, 341, 341, 341, 345, 350, 355, 371, 374, 381, 384, 390, 391, 392,
- 393, 394, 395, 396, 397, 398, 399, 400, 401, 404, 407, 410, 413, 416, 419, 422,
- 425, 428, 431, 432, 433, 434, 443, 443, 443, 443, 447, 453, 456, 462, 468, 473,
- 473, 473, 477, 485, 488, 491, 494, 497, 500, 509, 512, 515, 518, 521, 524, 527,
- 530, 533, 536, 539, 542, 545, 548, 551, 554, 562, 565, 568, 571, 574, 577, 580,
- 583, 586, 589, 592, 595, 598, 601, 604, 607, 610, 613, 616, 619, 622, 625, 628,
- 631, 634, 637, 640, 643, 646, 649, 652, 655, 658, 661, 664, 667, 670, 673, 676,
- 679, 682, 685, 688, 691, 694, 697, 700, 703, 706, 709, 712, 715, 718, 721, 724,
- 727, 730, 733, 736, 739, 742, 749, 754, 762, 771, 777, 783, 789, 795, 801, 807,
- 813, 819, 825, 831, 837, 843, 849, 852, 858, 861, 867, 870, 876, 879, 885, 888,
- 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909,
- 910, 911, 912, 913, 914, 921, 922, 929, 929, 933, 938, 938, 938, 938, 938, 938,
- 939, 939, 945, 953, 959, 962, 969, 976, 976, 976, 976, 980, 986, 986, 986, 986,
- 986, 986, 986, 986, 986, 986, 986, 986, 986, 987, 987, 987, 987, 991, 998, 1004,
- 1009, 1014, 1020, 1025, 1030, 1035, 1041, 1046, 1052, 1061, 1067, 1073, 1078, 1084, 1090, 1090,
- 1090, 1094, 1101, 1108, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1116, 1116, 1116, 1116, 1116,
- 1116, 1116, 1116, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1121, 1131, 1134, 1140, 1143, 1149,
- 1158, 1167, 1170, 1173, 1179, 1190, 1201, 1204, 1210, 1218, 1226, 1234, 1237, 1242, 1251, 1257,
- 1263, 1269, 1279, 1289, 1296, 1303, 1310, 1318, 1326, 1334, 1342, 1348, 1354, 1354, 1358, 1365,
- 1372, 1372, 1376, 1376, 1380, 1386, 1387, 1394, 1400, 1403, 1410, 1417, 1418, 1419, 1420, 1421,
- 1424, 1424, 1424, 1424, 1424, 1424, 1424, 1426, 1431, 1436, 1441, 1446, 1451, 1456, 1462, 1463,
- 1464, 1465, 1466, 1467, 1468, 1469, 1470, 1471, 1476, 1479, 1486, 1489, 1495, 1505, 1510, 1515,
- 1520, 1525, 1530, 1535, 1540, 1545};
-
-// Print the state stack on the debug stream.
-void PipelineParserGen::yystack_print_() {
+ 0, 297, 297, 301, 305, 312, 318, 319, 327, 327, 330, 330, 330, 330, 330, 330,
+ 333, 343, 349, 359, 359, 359, 359, 363, 368, 373, 389, 392, 399, 402, 408, 409,
+ 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 422, 425, 428, 431, 434, 437,
+ 440, 443, 446, 449, 452, 455, 458, 461, 464, 467, 470, 473, 474, 475, 476, 485,
+ 485, 485, 485, 489, 495, 498, 504, 510, 515, 515, 515, 519, 527, 530, 533, 536,
+ 539, 542, 551, 554, 557, 560, 563, 566, 569, 572, 575, 578, 581, 584, 587, 590,
+ 593, 596, 604, 607, 610, 613, 616, 619, 622, 625, 628, 631, 634, 637, 640, 643,
+ 646, 649, 652, 655, 658, 661, 664, 667, 670, 673, 676, 679, 682, 685, 688, 691,
+ 694, 697, 700, 703, 706, 709, 712, 715, 718, 721, 724, 727, 730, 733, 736, 739,
+ 742, 745, 748, 751, 754, 757, 760, 763, 766, 769, 772, 775, 778, 781, 784, 787,
+ 794, 799, 802, 808, 816, 825, 831, 837, 843, 849, 855, 861, 867, 873, 879, 885,
+ 891, 897, 903, 906, 909, 912, 918, 921, 924, 927, 933, 936, 939, 942, 948, 951,
+ 954, 957, 963, 966, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983,
+ 984, 985, 986, 987, 988, 989, 990, 991, 992, 999, 1000, 1007, 1007, 1011, 1016, 1016,
+ 1016, 1016, 1016, 1016, 1017, 1017, 1023, 1031, 1037, 1040, 1047, 1054, 1054, 1054, 1054, 1058,
+ 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1065, 1065, 1065,
+ 1065, 1069, 1076, 1082, 1087, 1092, 1098, 1103, 1108, 1113, 1119, 1124, 1130, 1139, 1145, 1151,
+ 1156, 1162, 1168, 1168, 1168, 1172, 1179, 1186, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1194,
+ 1194, 1194, 1194, 1194, 1194, 1194, 1194, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1199, 1209,
+ 1212, 1218, 1221, 1227, 1236, 1245, 1248, 1251, 1257, 1268, 1279, 1282, 1288, 1296, 1304, 1312,
+ 1315, 1320, 1329, 1335, 1341, 1347, 1357, 1367, 1374, 1381, 1388, 1396, 1404, 1412, 1420, 1426,
+ 1432, 1435, 1441, 1447, 1452, 1455, 1462, 1465, 1468, 1471, 1474, 1477, 1480, 1483, 1488, 1490,
+ 1496, 1496, 1500, 1507, 1514, 1514, 1518, 1518, 1522, 1528, 1529, 1536, 1542, 1545, 1552, 1559,
+ 1560, 1561, 1562, 1563, 1566, 1566, 1566, 1566, 1566, 1566, 1566, 1568, 1573, 1578, 1583, 1588,
+ 1593, 1598, 1604, 1605, 1606, 1607, 1608, 1609, 1610, 1611, 1612, 1613, 1618, 1621, 1628, 1631,
+ 1637, 1647, 1652, 1657, 1662, 1667, 1672, 1677, 1682, 1687};
+
+void PipelineParserGen::yy_stack_print_() const {
*yycdebug_ << "Stack now";
for (stack_type::const_iterator i = yystack_.begin(), i_end = yystack_.end(); i != i_end; ++i)
*yycdebug_ << ' ' << int(i->state);
*yycdebug_ << '\n';
}
-// Report on the debug stream that the rule \a yyrule is going to be reduced.
-void PipelineParserGen::yy_reduce_print_(int yyrule) {
+void PipelineParserGen::yy_reduce_print_(int yyrule) const {
int yylno = yyrline_[yyrule];
int yynrhs = yyr2_[yyrule];
// Print the symbols being reduced, and their result.
@@ -5746,8 +6212,8 @@ void PipelineParserGen::yy_reduce_print_(int yyrule) {
#endif // YYDEBUG
-#line 58 "src/mongo/db/cst/pipeline_grammar.yy"
+#line 58 "pipeline_grammar.yy"
} // namespace mongo
-#line 5457 "src/mongo/db/cst/pipeline_parser_gen.cpp"
+#line 5920 "pipeline_parser_gen.cpp"
-#line 1549 "src/mongo/db/cst/pipeline_grammar.yy"
+#line 1691 "pipeline_grammar.yy"
diff --git a/src/mongo/db/cst/pipeline_parser_gen.hpp b/src/mongo/db/cst/pipeline_parser_gen.hpp
index 3e9f17bb5c0..9c9296172ee 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.5.4.
+// A Bison parser, made by GNU Bison 3.7.
// Skeleton interface for Bison LALR(1) parsers in C++
@@ -32,19 +32,20 @@
/**
- ** \file src/mongo/db/cst/pipeline_parser_gen.hpp
+ ** \file pipeline_parser_gen.hpp
** Define the mongo::parser class.
*/
// C++ LALR(1) parser skeleton written by Akim Demaille.
-// Undocumented macros, especially those whose name start with YY_,
-// are private implementation details. Do not rely on them.
+// DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
+// 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 67 "src/mongo/db/cst/pipeline_grammar.yy"
+#line 67 "pipeline_grammar.yy"
#include "mongo/db/cst/bson_location.h"
#include "mongo/db/cst/c_node.h"
@@ -59,7 +60,7 @@ class BSONLexer;
#pragma warning(disable : 4065)
#endif
-#line 63 "src/mongo/db/cst/pipeline_parser_gen.hpp"
+#line 64 "pipeline_parser_gen.hpp"
#include <cassert>
#include <cstdlib> // std::abort
@@ -188,9 +189,9 @@ class BSONLexer;
#define YYDEBUG 0
#endif
-#line 58 "src/mongo/db/cst/pipeline_grammar.yy"
+#line 58 "pipeline_grammar.yy"
namespace mongo {
-#line 198 "src/mongo/db/cst/pipeline_parser_gen.hpp"
+#line 199 "pipeline_parser_gen.hpp"
/// A Bison parser.
@@ -217,6 +218,13 @@ public:
new (yyas_<T>()) T(YY_MOVE(t));
}
+#if 201103L <= YY_CPLUSPLUS
+ /// Non copyable.
+ semantic_type(const self_type&) = delete;
+ /// Non copyable.
+ self_type& operator=(const self_type&) = delete;
+#endif
+
/// Destruction, allowed only if empty.
~semantic_type() YY_NOEXCEPT {
YY_ASSERT(!yytypeid_);
@@ -335,9 +343,12 @@ public:
}
private:
- /// Prohibit blind copies.
- self_type& operator=(const self_type&);
+#if YY_CPLUSPLUS < 201103L
+ /// Non copyable.
semantic_type(const self_type&);
+ /// Non copyable.
+ self_type& operator=(const self_type&);
+#endif
/// Accessor to raw memory as \a T.
template <typename T>
@@ -489,6 +500,11 @@ public:
// matchExpression
// filterFields
// filterVal
+ // sortSpecs
+ // specList
+ // metaSort
+ // oneOrNegOne
+ // metaSortKeyword
char dummy7[sizeof(CNode)];
// projectionFieldname
@@ -505,7 +521,7 @@ public:
// "Date"
char dummy9[sizeof(Date_t)];
- // "non-zero decimal"
+ // "arbitrary decimal"
char dummy10[sizeof(Decimal128)];
// "ObjectID"
@@ -526,13 +542,13 @@ public:
// "undefined"
char dummy16[sizeof(UserUndefined)];
- // "non-zero double"
+ // "arbitrary double"
char dummy17[sizeof(double)];
- // "non-zero integer"
+ // "arbitrary integer"
char dummy18[sizeof(int)];
- // "non-zero long"
+ // "arbitrary long"
char dummy19[sizeof(long long)];
// projectField
@@ -545,6 +561,7 @@ public:
// timezoneArg
// charsArg
// optionsArg
+ // sortSpec
char dummy20[sizeof(std::pair<CNode::Fieldname, CNode>)];
// "fieldname"
@@ -593,147 +610,453 @@ public:
location_type location;
};
- /// Tokens.
+ /// Token kinds.
struct token {
- enum yytokentype {
- END_OF_FILE = 0,
- ABS = 3,
- ADD = 4,
- AND = 5,
- ARG_CHARS = 6,
- ARG_COLL = 7,
- ARG_DATE = 8,
- ARG_DATE_STRING = 9,
- ARG_FIND = 10,
- ARG_FORMAT = 11,
- ARG_INPUT = 12,
- ARG_ON_ERROR = 13,
- ARG_ON_NULL = 14,
- ARG_OPTIONS = 15,
- ARG_PIPELINE = 16,
- ARG_REGEX = 17,
- ARG_REPLACEMENT = 18,
- ARG_SIZE = 19,
- ARG_TIMEZONE = 20,
- ARG_TO = 21,
- ATAN2 = 22,
- BOOL_FALSE = 23,
- BOOL_TRUE = 24,
- CEIL = 25,
- CMP = 26,
- CONCAT = 27,
- CONST_EXPR = 28,
- CONVERT = 29,
- DATE_FROM_STRING = 30,
- DATE_TO_STRING = 31,
- DECIMAL_ZERO = 32,
- DIVIDE = 33,
- DOUBLE_ZERO = 34,
- END_ARRAY = 35,
- END_OBJECT = 36,
- EQ = 37,
- EXPONENT = 38,
- FLOOR = 39,
- GT = 40,
- GTE = 41,
- ID = 42,
- INDEX_OF_BYTES = 43,
- INDEX_OF_CP = 44,
- INT_ZERO = 45,
- LITERAL = 46,
- LN = 47,
- LOG = 48,
- LOGTEN = 49,
- LONG_ZERO = 50,
- LT = 51,
- LTE = 52,
- LTRIM = 53,
- MOD = 54,
- MULTIPLY = 55,
- NE = 56,
- NOT = 57,
- OR = 58,
- POW = 59,
- REGEX_FIND = 60,
- REGEX_FIND_ALL = 61,
- REGEX_MATCH = 62,
- REPLACE_ALL = 63,
- REPLACE_ONE = 64,
- ROUND = 65,
- RTRIM = 66,
- SPLIT = 67,
- SQRT = 68,
- STAGE_INHIBIT_OPTIMIZATION = 69,
- STAGE_LIMIT = 70,
- STAGE_PROJECT = 71,
- STAGE_SAMPLE = 72,
- STAGE_SKIP = 73,
- STAGE_UNION_WITH = 74,
- START_ARRAY = 75,
- START_OBJECT = 76,
- STR_CASE_CMP = 77,
- STR_LEN_BYTES = 78,
- STR_LEN_CP = 79,
- SUBSTR = 80,
- SUBSTR_BYTES = 81,
- SUBSTR_CP = 82,
- SUBTRACT = 83,
- TO_BOOL = 84,
- TO_DATE = 85,
- TO_DECIMAL = 86,
- TO_DOUBLE = 87,
- TO_INT = 88,
- TO_LONG = 89,
- TO_LOWER = 90,
- TO_OBJECT_ID = 91,
- TO_STRING = 92,
- TO_UPPER = 93,
- TRIM = 94,
- TRUNC = 95,
- TYPE = 96,
- FIELDNAME = 97,
- STRING = 98,
- BINARY = 99,
- UNDEFINED = 100,
- OBJECT_ID = 101,
- DATE_LITERAL = 102,
- JSNULL = 103,
- REGEX = 104,
- DB_POINTER = 105,
- JAVASCRIPT = 106,
- SYMBOL = 107,
- JAVASCRIPT_W_SCOPE = 108,
- INT_NON_ZERO = 109,
- LONG_NON_ZERO = 110,
- DOUBLE_NON_ZERO = 111,
- DECIMAL_NON_ZERO = 112,
- TIMESTAMP = 113,
- MIN_KEY = 114,
- MAX_KEY = 115,
- DOLLAR_STRING = 116,
- DOLLAR_DOLLAR_STRING = 117,
- DOLLAR_PREF_FIELDNAME = 118,
- START_PIPELINE = 119,
- START_MATCH = 120
+ enum token_kind_type {
+ YYEMPTY = -2,
+ END_OF_FILE = 0, // "EOF"
+ YYerror = 1, // error
+ YYUNDEF = 2, // "invalid token"
+ ABS = 3, // ABS
+ ADD = 4, // ADD
+ AND = 5, // AND
+ ARG_CHARS = 6, // "chars argument"
+ ARG_COLL = 7, // "coll argument"
+ ARG_DATE = 8, // "date argument"
+ ARG_DATE_STRING = 9, // "dateString argument"
+ ARG_FIND = 10, // "find argument"
+ ARG_FORMAT = 11, // "format argument"
+ ARG_INPUT = 12, // "input argument"
+ ARG_ON_ERROR = 13, // "onError argument"
+ ARG_ON_NULL = 14, // "onNull argument"
+ ARG_OPTIONS = 15, // "options argument"
+ ARG_PIPELINE = 16, // "pipeline argument"
+ ARG_REGEX = 17, // "regex argument"
+ ARG_REPLACEMENT = 18, // "replacement argument"
+ ARG_SIZE = 19, // "size argument"
+ ARG_TIMEZONE = 20, // "timezone argument"
+ ARG_TO = 21, // "to argument"
+ ATAN2 = 22, // ATAN2
+ BOOL_FALSE = 23, // "false"
+ BOOL_TRUE = 24, // "true"
+ CEIL = 25, // CEIL
+ CMP = 26, // CMP
+ CONCAT = 27, // CONCAT
+ CONST_EXPR = 28, // CONST_EXPR
+ CONVERT = 29, // CONVERT
+ DATE_FROM_STRING = 30, // DATE_FROM_STRING
+ DATE_TO_STRING = 31, // DATE_TO_STRING
+ DECIMAL_NEGATIVE_ONE = 32, // "-1 (decimal)"
+ DECIMAL_ONE = 33, // "1 (decimal)"
+ DECIMAL_ZERO = 34, // "zero (decimal)"
+ DIVIDE = 35, // DIVIDE
+ DOUBLE_NEGATIVE_ONE = 36, // "-1 (double)"
+ DOUBLE_ONE = 37, // "1 (double)"
+ DOUBLE_ZERO = 38, // "zero (double)"
+ END_ARRAY = 39, // "end of array"
+ END_OBJECT = 40, // "end of object"
+ EQ = 41, // EQ
+ EXPONENT = 42, // EXPONENT
+ FLOOR = 43, // FLOOR
+ GT = 44, // GT
+ GTE = 45, // GTE
+ ID = 46, // ID
+ INDEX_OF_BYTES = 47, // INDEX_OF_BYTES
+ INDEX_OF_CP = 48, // INDEX_OF_CP
+ INT_NEGATIVE_ONE = 49, // "-1 (int)"
+ INT_ONE = 50, // "1 (int)"
+ INT_ZERO = 51, // "zero (int)"
+ LITERAL = 52, // LITERAL
+ LN = 53, // LN
+ LOG = 54, // LOG
+ LOGTEN = 55, // LOGTEN
+ LONG_NEGATIVE_ONE = 56, // "-1 (long)"
+ LONG_ONE = 57, // "1 (long)"
+ LONG_ZERO = 58, // "zero (long)"
+ LT = 59, // LT
+ LTE = 60, // LTE
+ LTRIM = 61, // LTRIM
+ META = 62, // META
+ MOD = 63, // MOD
+ MULTIPLY = 64, // MULTIPLY
+ NE = 65, // NE
+ NOT = 66, // NOT
+ OR = 67, // OR
+ POW = 68, // POW
+ RAND_VAL = 69, // "randVal"
+ REGEX_FIND = 70, // REGEX_FIND
+ REGEX_FIND_ALL = 71, // REGEX_FIND_ALL
+ REGEX_MATCH = 72, // REGEX_MATCH
+ REPLACE_ALL = 73, // REPLACE_ALL
+ REPLACE_ONE = 74, // REPLACE_ONE
+ ROUND = 75, // ROUND
+ RTRIM = 76, // RTRIM
+ SPLIT = 77, // SPLIT
+ SQRT = 78, // SQRT
+ STAGE_INHIBIT_OPTIMIZATION = 79, // STAGE_INHIBIT_OPTIMIZATION
+ STAGE_LIMIT = 80, // STAGE_LIMIT
+ STAGE_PROJECT = 81, // STAGE_PROJECT
+ STAGE_SAMPLE = 82, // STAGE_SAMPLE
+ STAGE_SKIP = 83, // STAGE_SKIP
+ STAGE_UNION_WITH = 84, // STAGE_UNION_WITH
+ START_ARRAY = 85, // "array"
+ START_OBJECT = 86, // "object"
+ STR_CASE_CMP = 87, // STR_CASE_CMP
+ STR_LEN_BYTES = 88, // STR_LEN_BYTES
+ STR_LEN_CP = 89, // STR_LEN_CP
+ SUBSTR = 90, // SUBSTR
+ SUBSTR_BYTES = 91, // SUBSTR_BYTES
+ SUBSTR_CP = 92, // SUBSTR_CP
+ SUBTRACT = 93, // SUBTRACT
+ TEXT_SCORE = 94, // "textScore"
+ TO_BOOL = 95, // TO_BOOL
+ TO_DATE = 96, // TO_DATE
+ TO_DECIMAL = 97, // TO_DECIMAL
+ TO_DOUBLE = 98, // TO_DOUBLE
+ TO_INT = 99, // TO_INT
+ TO_LONG = 100, // TO_LONG
+ TO_LOWER = 101, // TO_LOWER
+ TO_OBJECT_ID = 102, // TO_OBJECT_ID
+ TO_STRING = 103, // TO_STRING
+ TO_UPPER = 104, // TO_UPPER
+ TRIM = 105, // TRIM
+ TRUNC = 106, // TRUNC
+ TYPE = 107, // TYPE
+ FIELDNAME = 108, // "fieldname"
+ STRING = 109, // "string"
+ BINARY = 110, // "BinData"
+ UNDEFINED = 111, // "undefined"
+ OBJECT_ID = 112, // "ObjectID"
+ DATE_LITERAL = 113, // "Date"
+ JSNULL = 114, // "null"
+ REGEX = 115, // "regex"
+ DB_POINTER = 116, // "dbPointer"
+ JAVASCRIPT = 117, // "Code"
+ SYMBOL = 118, // "Symbol"
+ JAVASCRIPT_W_SCOPE = 119, // "CodeWScope"
+ INT_OTHER = 120, // "arbitrary integer"
+ LONG_OTHER = 121, // "arbitrary long"
+ DOUBLE_OTHER = 122, // "arbitrary double"
+ DECIMAL_OTHER = 123, // "arbitrary decimal"
+ TIMESTAMP = 124, // "Timestamp"
+ MIN_KEY = 125, // "minKey"
+ MAX_KEY = 126, // "maxKey"
+ DOLLAR_STRING = 127, // "$-prefixed string"
+ DOLLAR_DOLLAR_STRING = 128, // "$$-prefixed string"
+ DOLLAR_PREF_FIELDNAME = 129, // "$-prefixed fieldname"
+ START_PIPELINE = 130, // START_PIPELINE
+ START_MATCH = 131, // START_MATCH
+ START_SORT = 132 // START_SORT
};
+ /// Backward compatibility alias (Bison 3.6).
+ typedef token_kind_type yytokentype;
};
- /// (External) token type, as returned by yylex.
- typedef token::yytokentype token_type;
-
- /// Symbol type: an internal symbol number.
- typedef int symbol_number_type;
+ /// Token kind, as returned by yylex.
+ typedef token::yytokentype token_kind_type;
+
+ /// Backward compatibility alias (Bison 3.6).
+ typedef token_kind_type token_type;
+
+ /// Symbol kinds.
+ struct symbol_kind {
+ enum symbol_kind_type {
+ YYNTOKENS = 133, ///< Number of tokens.
+ S_YYEMPTY = -2,
+ S_YYEOF = 0, // "EOF"
+ S_YYerror = 1, // error
+ S_YYUNDEF = 2, // "invalid token"
+ S_ABS = 3, // ABS
+ S_ADD = 4, // ADD
+ S_AND = 5, // AND
+ S_ARG_CHARS = 6, // "chars argument"
+ S_ARG_COLL = 7, // "coll argument"
+ S_ARG_DATE = 8, // "date argument"
+ S_ARG_DATE_STRING = 9, // "dateString argument"
+ S_ARG_FIND = 10, // "find argument"
+ S_ARG_FORMAT = 11, // "format argument"
+ S_ARG_INPUT = 12, // "input argument"
+ S_ARG_ON_ERROR = 13, // "onError argument"
+ S_ARG_ON_NULL = 14, // "onNull argument"
+ S_ARG_OPTIONS = 15, // "options argument"
+ S_ARG_PIPELINE = 16, // "pipeline argument"
+ S_ARG_REGEX = 17, // "regex argument"
+ S_ARG_REPLACEMENT = 18, // "replacement argument"
+ S_ARG_SIZE = 19, // "size argument"
+ S_ARG_TIMEZONE = 20, // "timezone argument"
+ S_ARG_TO = 21, // "to argument"
+ S_ATAN2 = 22, // ATAN2
+ S_BOOL_FALSE = 23, // "false"
+ S_BOOL_TRUE = 24, // "true"
+ S_CEIL = 25, // CEIL
+ S_CMP = 26, // CMP
+ S_CONCAT = 27, // CONCAT
+ S_CONST_EXPR = 28, // CONST_EXPR
+ S_CONVERT = 29, // CONVERT
+ S_DATE_FROM_STRING = 30, // DATE_FROM_STRING
+ S_DATE_TO_STRING = 31, // DATE_TO_STRING
+ S_DECIMAL_NEGATIVE_ONE = 32, // "-1 (decimal)"
+ S_DECIMAL_ONE = 33, // "1 (decimal)"
+ S_DECIMAL_ZERO = 34, // "zero (decimal)"
+ S_DIVIDE = 35, // DIVIDE
+ S_DOUBLE_NEGATIVE_ONE = 36, // "-1 (double)"
+ S_DOUBLE_ONE = 37, // "1 (double)"
+ S_DOUBLE_ZERO = 38, // "zero (double)"
+ S_END_ARRAY = 39, // "end of array"
+ S_END_OBJECT = 40, // "end of object"
+ S_EQ = 41, // EQ
+ S_EXPONENT = 42, // EXPONENT
+ S_FLOOR = 43, // FLOOR
+ S_GT = 44, // GT
+ S_GTE = 45, // GTE
+ S_ID = 46, // ID
+ S_INDEX_OF_BYTES = 47, // INDEX_OF_BYTES
+ S_INDEX_OF_CP = 48, // INDEX_OF_CP
+ S_INT_NEGATIVE_ONE = 49, // "-1 (int)"
+ S_INT_ONE = 50, // "1 (int)"
+ S_INT_ZERO = 51, // "zero (int)"
+ S_LITERAL = 52, // LITERAL
+ S_LN = 53, // LN
+ S_LOG = 54, // LOG
+ S_LOGTEN = 55, // LOGTEN
+ S_LONG_NEGATIVE_ONE = 56, // "-1 (long)"
+ S_LONG_ONE = 57, // "1 (long)"
+ S_LONG_ZERO = 58, // "zero (long)"
+ S_LT = 59, // LT
+ S_LTE = 60, // LTE
+ S_LTRIM = 61, // LTRIM
+ S_META = 62, // META
+ S_MOD = 63, // MOD
+ S_MULTIPLY = 64, // MULTIPLY
+ S_NE = 65, // NE
+ S_NOT = 66, // NOT
+ S_OR = 67, // OR
+ S_POW = 68, // POW
+ S_RAND_VAL = 69, // "randVal"
+ S_REGEX_FIND = 70, // REGEX_FIND
+ S_REGEX_FIND_ALL = 71, // REGEX_FIND_ALL
+ S_REGEX_MATCH = 72, // REGEX_MATCH
+ S_REPLACE_ALL = 73, // REPLACE_ALL
+ S_REPLACE_ONE = 74, // REPLACE_ONE
+ S_ROUND = 75, // ROUND
+ S_RTRIM = 76, // RTRIM
+ S_SPLIT = 77, // SPLIT
+ S_SQRT = 78, // SQRT
+ S_STAGE_INHIBIT_OPTIMIZATION = 79, // STAGE_INHIBIT_OPTIMIZATION
+ S_STAGE_LIMIT = 80, // STAGE_LIMIT
+ S_STAGE_PROJECT = 81, // STAGE_PROJECT
+ S_STAGE_SAMPLE = 82, // STAGE_SAMPLE
+ S_STAGE_SKIP = 83, // STAGE_SKIP
+ S_STAGE_UNION_WITH = 84, // STAGE_UNION_WITH
+ S_START_ARRAY = 85, // "array"
+ S_START_OBJECT = 86, // "object"
+ S_STR_CASE_CMP = 87, // STR_CASE_CMP
+ S_STR_LEN_BYTES = 88, // STR_LEN_BYTES
+ S_STR_LEN_CP = 89, // STR_LEN_CP
+ S_SUBSTR = 90, // SUBSTR
+ S_SUBSTR_BYTES = 91, // SUBSTR_BYTES
+ S_SUBSTR_CP = 92, // SUBSTR_CP
+ S_SUBTRACT = 93, // SUBTRACT
+ S_TEXT_SCORE = 94, // "textScore"
+ S_TO_BOOL = 95, // TO_BOOL
+ S_TO_DATE = 96, // TO_DATE
+ S_TO_DECIMAL = 97, // TO_DECIMAL
+ S_TO_DOUBLE = 98, // TO_DOUBLE
+ S_TO_INT = 99, // TO_INT
+ S_TO_LONG = 100, // TO_LONG
+ S_TO_LOWER = 101, // TO_LOWER
+ S_TO_OBJECT_ID = 102, // TO_OBJECT_ID
+ S_TO_STRING = 103, // TO_STRING
+ S_TO_UPPER = 104, // TO_UPPER
+ S_TRIM = 105, // TRIM
+ S_TRUNC = 106, // TRUNC
+ S_TYPE = 107, // TYPE
+ S_FIELDNAME = 108, // "fieldname"
+ S_STRING = 109, // "string"
+ S_BINARY = 110, // "BinData"
+ S_UNDEFINED = 111, // "undefined"
+ S_OBJECT_ID = 112, // "ObjectID"
+ S_DATE_LITERAL = 113, // "Date"
+ S_JSNULL = 114, // "null"
+ S_REGEX = 115, // "regex"
+ S_DB_POINTER = 116, // "dbPointer"
+ S_JAVASCRIPT = 117, // "Code"
+ S_SYMBOL = 118, // "Symbol"
+ S_JAVASCRIPT_W_SCOPE = 119, // "CodeWScope"
+ S_INT_OTHER = 120, // "arbitrary integer"
+ S_LONG_OTHER = 121, // "arbitrary long"
+ S_DOUBLE_OTHER = 122, // "arbitrary double"
+ S_DECIMAL_OTHER = 123, // "arbitrary decimal"
+ S_TIMESTAMP = 124, // "Timestamp"
+ S_MIN_KEY = 125, // "minKey"
+ S_MAX_KEY = 126, // "maxKey"
+ S_DOLLAR_STRING = 127, // "$-prefixed string"
+ S_DOLLAR_DOLLAR_STRING = 128, // "$$-prefixed string"
+ S_DOLLAR_PREF_FIELDNAME = 129, // "$-prefixed fieldname"
+ S_START_PIPELINE = 130, // START_PIPELINE
+ S_START_MATCH = 131, // START_MATCH
+ S_START_SORT = 132, // START_SORT
+ S_YYACCEPT = 133, // $accept
+ S_projectionFieldname = 134, // projectionFieldname
+ S_expressionFieldname = 135, // expressionFieldname
+ S_stageAsUserFieldname = 136, // stageAsUserFieldname
+ S_filterFieldname = 137, // filterFieldname
+ S_argAsUserFieldname = 138, // argAsUserFieldname
+ S_aggExprAsUserFieldname = 139, // aggExprAsUserFieldname
+ S_invariableUserFieldname = 140, // invariableUserFieldname
+ S_idAsUserFieldname = 141, // idAsUserFieldname
+ S_valueFieldname = 142, // valueFieldname
+ S_projectField = 143, // projectField
+ S_expressionField = 144, // expressionField
+ S_valueField = 145, // valueField
+ S_filterField = 146, // filterField
+ S_dbPointer = 147, // dbPointer
+ S_javascript = 148, // javascript
+ S_symbol = 149, // symbol
+ S_javascriptWScope = 150, // javascriptWScope
+ S_int = 151, // int
+ S_timestamp = 152, // timestamp
+ S_long = 153, // long
+ S_double = 154, // double
+ S_decimal = 155, // decimal
+ S_minKey = 156, // minKey
+ S_maxKey = 157, // maxKey
+ S_value = 158, // value
+ S_string = 159, // string
+ S_fieldPath = 160, // fieldPath
+ S_binary = 161, // binary
+ S_undefined = 162, // undefined
+ S_objectId = 163, // objectId
+ S_bool = 164, // bool
+ S_date = 165, // date
+ S_null = 166, // null
+ S_regex = 167, // regex
+ S_simpleValue = 168, // simpleValue
+ S_compoundValue = 169, // compoundValue
+ S_valueArray = 170, // valueArray
+ S_valueObject = 171, // valueObject
+ S_valueFields = 172, // valueFields
+ S_variable = 173, // variable
+ S_pipeline = 174, // pipeline
+ S_stageList = 175, // stageList
+ S_stage = 176, // stage
+ S_inhibitOptimization = 177, // inhibitOptimization
+ S_unionWith = 178, // unionWith
+ S_skip = 179, // skip
+ S_limit = 180, // limit
+ S_project = 181, // project
+ S_sample = 182, // sample
+ S_projectFields = 183, // projectFields
+ S_projection = 184, // projection
+ S_num = 185, // num
+ S_expression = 186, // expression
+ S_compoundExpression = 187, // compoundExpression
+ S_exprFixedTwoArg = 188, // exprFixedTwoArg
+ S_expressionArray = 189, // expressionArray
+ S_expressionObject = 190, // expressionObject
+ S_expressionFields = 191, // expressionFields
+ S_maths = 192, // maths
+ S_add = 193, // add
+ S_atan2 = 194, // atan2
+ S_boolExps = 195, // boolExps
+ S_and = 196, // and
+ S_or = 197, // or
+ S_not = 198, // not
+ S_literalEscapes = 199, // literalEscapes
+ S_const = 200, // const
+ S_literal = 201, // literal
+ S_stringExps = 202, // stringExps
+ S_concat = 203, // concat
+ S_dateFromString = 204, // dateFromString
+ S_dateToString = 205, // dateToString
+ S_indexOfBytes = 206, // indexOfBytes
+ S_indexOfCP = 207, // indexOfCP
+ S_ltrim = 208, // ltrim
+ S_regexFind = 209, // regexFind
+ S_regexFindAll = 210, // regexFindAll
+ S_regexMatch = 211, // regexMatch
+ S_regexArgs = 212, // regexArgs
+ S_replaceOne = 213, // replaceOne
+ S_replaceAll = 214, // replaceAll
+ S_rtrim = 215, // rtrim
+ S_split = 216, // split
+ S_strLenBytes = 217, // strLenBytes
+ S_strLenCP = 218, // strLenCP
+ S_strcasecmp = 219, // strcasecmp
+ S_substr = 220, // substr
+ S_substrBytes = 221, // substrBytes
+ S_substrCP = 222, // substrCP
+ S_toLower = 223, // toLower
+ S_toUpper = 224, // toUpper
+ S_trim = 225, // trim
+ S_compExprs = 226, // compExprs
+ S_cmp = 227, // cmp
+ S_eq = 228, // eq
+ S_gt = 229, // gt
+ S_gte = 230, // gte
+ S_lt = 231, // lt
+ S_lte = 232, // lte
+ S_ne = 233, // ne
+ S_typeExpression = 234, // typeExpression
+ S_convert = 235, // convert
+ S_toBool = 236, // toBool
+ S_toDate = 237, // toDate
+ S_toDecimal = 238, // toDecimal
+ S_toDouble = 239, // toDouble
+ S_toInt = 240, // toInt
+ S_toLong = 241, // toLong
+ S_toObjectId = 242, // toObjectId
+ S_toString = 243, // toString
+ S_type = 244, // type
+ S_abs = 245, // abs
+ S_ceil = 246, // ceil
+ S_divide = 247, // divide
+ S_exponent = 248, // exponent
+ S_floor = 249, // floor
+ S_ln = 250, // ln
+ S_log = 251, // log
+ S_logten = 252, // logten
+ S_mod = 253, // mod
+ S_multiply = 254, // multiply
+ S_pow = 255, // pow
+ S_round = 256, // round
+ S_sqrt = 257, // sqrt
+ S_subtract = 258, // subtract
+ S_trunc = 259, // trunc
+ S_onErrorArg = 260, // onErrorArg
+ S_onNullArg = 261, // onNullArg
+ S_formatArg = 262, // formatArg
+ S_timezoneArg = 263, // timezoneArg
+ S_charsArg = 264, // charsArg
+ S_optionsArg = 265, // optionsArg
+ S_expressions = 266, // expressions
+ S_values = 267, // values
+ S_exprZeroToTwo = 268, // exprZeroToTwo
+ S_matchExpression = 269, // matchExpression
+ S_filterFields = 270, // filterFields
+ S_filterVal = 271, // filterVal
+ S_sortSpecs = 272, // sortSpecs
+ S_specList = 273, // specList
+ S_metaSort = 274, // metaSort
+ S_oneOrNegOne = 275, // oneOrNegOne
+ S_metaSortKeyword = 276, // metaSortKeyword
+ S_sortSpec = 277, // sortSpec
+ S_start = 278, // start
+ S_START_ORDERED_OBJECT = 279, // START_ORDERED_OBJECT
+ S_280_1 = 280 // $@1
+ };
+ };
- /// The symbol type number to denote an empty symbol.
- enum { empty_symbol = -2 };
+ /// (Internal) symbol kind.
+ typedef symbol_kind::symbol_kind_type symbol_kind_type;
- /// Internal symbol number for tokens (subsumed by symbol_number_type).
- typedef signed char token_number_type;
+ /// The number of tokens.
+ static const symbol_kind_type YYNTOKENS = symbol_kind::YYNTOKENS;
/// A complete symbol.
///
- /// Expects its Base type to provide access to the symbol type
- /// via type_get ().
+ /// Expects its Base type to provide access to the symbol kind
+ /// via kind ().
///
/// Provide access to semantic value and location.
template <typename Base>
@@ -746,7 +1069,245 @@ public:
#if 201103L <= YY_CPLUSPLUS
/// Move constructor.
- basic_symbol(basic_symbol&& that);
+ basic_symbol(basic_symbol&& that)
+ : Base(std::move(that)), value(), location(std::move(that.location)) {
+ switch (this->kind()) {
+ case symbol_kind::S_BINARY: // "BinData"
+ value.move<BSONBinData>(std::move(that.value));
+ break;
+
+ case symbol_kind::S_JAVASCRIPT: // "Code"
+ value.move<BSONCode>(std::move(that.value));
+ break;
+
+ case symbol_kind::S_JAVASCRIPT_W_SCOPE: // "CodeWScope"
+ value.move<BSONCodeWScope>(std::move(that.value));
+ break;
+
+ case symbol_kind::S_DB_POINTER: // "dbPointer"
+ value.move<BSONDBRef>(std::move(that.value));
+ break;
+
+ case symbol_kind::S_REGEX: // "regex"
+ value.move<BSONRegEx>(std::move(that.value));
+ break;
+
+ case symbol_kind::S_SYMBOL: // "Symbol"
+ value.move<BSONSymbol>(std::move(that.value));
+ break;
+
+ case symbol_kind::S_dbPointer: // dbPointer
+ case symbol_kind::S_javascript: // javascript
+ case symbol_kind::S_symbol: // symbol
+ case symbol_kind::S_javascriptWScope: // javascriptWScope
+ case symbol_kind::S_int: // int
+ case symbol_kind::S_timestamp: // timestamp
+ case symbol_kind::S_long: // long
+ case symbol_kind::S_double: // double
+ case symbol_kind::S_decimal: // decimal
+ case symbol_kind::S_minKey: // minKey
+ case symbol_kind::S_maxKey: // maxKey
+ case symbol_kind::S_value: // value
+ case symbol_kind::S_string: // string
+ case symbol_kind::S_fieldPath: // fieldPath
+ case symbol_kind::S_binary: // binary
+ case symbol_kind::S_undefined: // undefined
+ case symbol_kind::S_objectId: // objectId
+ case symbol_kind::S_bool: // bool
+ case symbol_kind::S_date: // date
+ case symbol_kind::S_null: // null
+ case symbol_kind::S_regex: // regex
+ case symbol_kind::S_simpleValue: // simpleValue
+ case symbol_kind::S_compoundValue: // compoundValue
+ case symbol_kind::S_valueArray: // valueArray
+ case symbol_kind::S_valueObject: // valueObject
+ case symbol_kind::S_valueFields: // valueFields
+ case symbol_kind::S_variable: // variable
+ case symbol_kind::S_pipeline: // pipeline
+ case symbol_kind::S_stageList: // stageList
+ case symbol_kind::S_stage: // stage
+ case symbol_kind::S_inhibitOptimization: // inhibitOptimization
+ case symbol_kind::S_unionWith: // unionWith
+ case symbol_kind::S_skip: // skip
+ case symbol_kind::S_limit: // limit
+ case symbol_kind::S_project: // project
+ case symbol_kind::S_sample: // sample
+ case symbol_kind::S_projectFields: // projectFields
+ case symbol_kind::S_projection: // projection
+ case symbol_kind::S_num: // num
+ case symbol_kind::S_expression: // expression
+ case symbol_kind::S_compoundExpression: // compoundExpression
+ case symbol_kind::S_exprFixedTwoArg: // exprFixedTwoArg
+ case symbol_kind::S_expressionArray: // expressionArray
+ case symbol_kind::S_expressionObject: // expressionObject
+ case symbol_kind::S_expressionFields: // expressionFields
+ case symbol_kind::S_maths: // maths
+ case symbol_kind::S_add: // add
+ case symbol_kind::S_atan2: // atan2
+ case symbol_kind::S_boolExps: // boolExps
+ case symbol_kind::S_and: // and
+ case symbol_kind::S_or: // or
+ case symbol_kind::S_not: // not
+ case symbol_kind::S_literalEscapes: // literalEscapes
+ case symbol_kind::S_const: // const
+ case symbol_kind::S_literal: // literal
+ case symbol_kind::S_stringExps: // stringExps
+ case symbol_kind::S_concat: // concat
+ case symbol_kind::S_dateFromString: // dateFromString
+ case symbol_kind::S_dateToString: // dateToString
+ case symbol_kind::S_indexOfBytes: // indexOfBytes
+ case symbol_kind::S_indexOfCP: // indexOfCP
+ case symbol_kind::S_ltrim: // ltrim
+ case symbol_kind::S_regexFind: // regexFind
+ case symbol_kind::S_regexFindAll: // regexFindAll
+ case symbol_kind::S_regexMatch: // regexMatch
+ case symbol_kind::S_regexArgs: // regexArgs
+ case symbol_kind::S_replaceOne: // replaceOne
+ case symbol_kind::S_replaceAll: // replaceAll
+ case symbol_kind::S_rtrim: // rtrim
+ case symbol_kind::S_split: // split
+ case symbol_kind::S_strLenBytes: // strLenBytes
+ case symbol_kind::S_strLenCP: // strLenCP
+ case symbol_kind::S_strcasecmp: // strcasecmp
+ case symbol_kind::S_substr: // substr
+ case symbol_kind::S_substrBytes: // substrBytes
+ case symbol_kind::S_substrCP: // substrCP
+ case symbol_kind::S_toLower: // toLower
+ case symbol_kind::S_toUpper: // toUpper
+ case symbol_kind::S_trim: // trim
+ case symbol_kind::S_compExprs: // compExprs
+ case symbol_kind::S_cmp: // cmp
+ case symbol_kind::S_eq: // eq
+ case symbol_kind::S_gt: // gt
+ case symbol_kind::S_gte: // gte
+ case symbol_kind::S_lt: // lt
+ case symbol_kind::S_lte: // lte
+ case symbol_kind::S_ne: // ne
+ case symbol_kind::S_typeExpression: // typeExpression
+ case symbol_kind::S_convert: // convert
+ case symbol_kind::S_toBool: // toBool
+ case symbol_kind::S_toDate: // toDate
+ case symbol_kind::S_toDecimal: // toDecimal
+ case symbol_kind::S_toDouble: // toDouble
+ case symbol_kind::S_toInt: // toInt
+ case symbol_kind::S_toLong: // toLong
+ case symbol_kind::S_toObjectId: // toObjectId
+ case symbol_kind::S_toString: // toString
+ case symbol_kind::S_type: // type
+ case symbol_kind::S_abs: // abs
+ case symbol_kind::S_ceil: // ceil
+ case symbol_kind::S_divide: // divide
+ case symbol_kind::S_exponent: // exponent
+ case symbol_kind::S_floor: // floor
+ case symbol_kind::S_ln: // ln
+ case symbol_kind::S_log: // log
+ case symbol_kind::S_logten: // logten
+ case symbol_kind::S_mod: // mod
+ case symbol_kind::S_multiply: // multiply
+ case symbol_kind::S_pow: // pow
+ case symbol_kind::S_round: // round
+ case symbol_kind::S_sqrt: // sqrt
+ case symbol_kind::S_subtract: // subtract
+ case symbol_kind::S_trunc: // trunc
+ case symbol_kind::S_matchExpression: // matchExpression
+ case symbol_kind::S_filterFields: // filterFields
+ case symbol_kind::S_filterVal: // filterVal
+ case symbol_kind::S_sortSpecs: // sortSpecs
+ case symbol_kind::S_specList: // specList
+ case symbol_kind::S_metaSort: // metaSort
+ case symbol_kind::S_oneOrNegOne: // oneOrNegOne
+ case symbol_kind::S_metaSortKeyword: // metaSortKeyword
+ value.move<CNode>(std::move(that.value));
+ break;
+
+ case symbol_kind::S_projectionFieldname: // projectionFieldname
+ case symbol_kind::S_expressionFieldname: // expressionFieldname
+ case symbol_kind::S_stageAsUserFieldname: // stageAsUserFieldname
+ case symbol_kind::S_filterFieldname: // filterFieldname
+ case symbol_kind::S_argAsUserFieldname: // argAsUserFieldname
+ case symbol_kind::S_aggExprAsUserFieldname: // aggExprAsUserFieldname
+ case symbol_kind::S_invariableUserFieldname: // invariableUserFieldname
+ case symbol_kind::S_idAsUserFieldname: // idAsUserFieldname
+ case symbol_kind::S_valueFieldname: // valueFieldname
+ value.move<CNode::Fieldname>(std::move(that.value));
+ break;
+
+ case symbol_kind::S_DATE_LITERAL: // "Date"
+ value.move<Date_t>(std::move(that.value));
+ break;
+
+ case symbol_kind::S_DECIMAL_OTHER: // "arbitrary decimal"
+ value.move<Decimal128>(std::move(that.value));
+ break;
+
+ case symbol_kind::S_OBJECT_ID: // "ObjectID"
+ value.move<OID>(std::move(that.value));
+ break;
+
+ case symbol_kind::S_TIMESTAMP: // "Timestamp"
+ value.move<Timestamp>(std::move(that.value));
+ break;
+
+ case symbol_kind::S_MAX_KEY: // "maxKey"
+ value.move<UserMaxKey>(std::move(that.value));
+ break;
+
+ case symbol_kind::S_MIN_KEY: // "minKey"
+ value.move<UserMinKey>(std::move(that.value));
+ break;
+
+ case symbol_kind::S_JSNULL: // "null"
+ value.move<UserNull>(std::move(that.value));
+ break;
+
+ case symbol_kind::S_UNDEFINED: // "undefined"
+ value.move<UserUndefined>(std::move(that.value));
+ break;
+
+ case symbol_kind::S_DOUBLE_OTHER: // "arbitrary double"
+ value.move<double>(std::move(that.value));
+ break;
+
+ case symbol_kind::S_INT_OTHER: // "arbitrary integer"
+ value.move<int>(std::move(that.value));
+ break;
+
+ case symbol_kind::S_LONG_OTHER: // "arbitrary long"
+ value.move<long long>(std::move(that.value));
+ break;
+
+ case symbol_kind::S_projectField: // projectField
+ case symbol_kind::S_expressionField: // expressionField
+ case symbol_kind::S_valueField: // valueField
+ case symbol_kind::S_filterField: // filterField
+ case symbol_kind::S_onErrorArg: // onErrorArg
+ case symbol_kind::S_onNullArg: // onNullArg
+ case symbol_kind::S_formatArg: // formatArg
+ case symbol_kind::S_timezoneArg: // timezoneArg
+ case symbol_kind::S_charsArg: // charsArg
+ case symbol_kind::S_optionsArg: // optionsArg
+ case symbol_kind::S_sortSpec: // sortSpec
+ value.move<std::pair<CNode::Fieldname, CNode>>(std::move(that.value));
+ break;
+
+ case symbol_kind::S_FIELDNAME: // "fieldname"
+ case symbol_kind::S_STRING: // "string"
+ case symbol_kind::S_DOLLAR_STRING: // "$-prefixed string"
+ case symbol_kind::S_DOLLAR_DOLLAR_STRING: // "$$-prefixed string"
+ case symbol_kind::S_DOLLAR_PREF_FIELDNAME: // "$-prefixed fieldname"
+ value.move<std::string>(std::move(that.value));
+ break;
+
+ case symbol_kind::S_expressions: // expressions
+ case symbol_kind::S_values: // values
+ case symbol_kind::S_exprZeroToTwo: // exprZeroToTwo
+ value.move<std::vector<CNode>>(std::move(that.value));
+ break;
+
+ default:
+ break;
+ }
+ }
#endif
/// Copy constructor.
@@ -928,239 +1489,245 @@ public:
/// Destroy contents, and record that is empty.
void clear() {
// User destructor.
- symbol_number_type yytype = this->type_get();
+ symbol_kind_type yykind = this->kind();
basic_symbol<Base>& yysym = *this;
(void)yysym;
- switch (yytype) {
+ switch (yykind) {
default:
break;
}
- // Type destructor.
- switch (yytype) {
- case 99: // "BinData"
+ // Value type destructor.
+ switch (yykind) {
+ case symbol_kind::S_BINARY: // "BinData"
value.template destroy<BSONBinData>();
break;
- case 106: // "Code"
+ case symbol_kind::S_JAVASCRIPT: // "Code"
value.template destroy<BSONCode>();
break;
- case 108: // "CodeWScope"
+ case symbol_kind::S_JAVASCRIPT_W_SCOPE: // "CodeWScope"
value.template destroy<BSONCodeWScope>();
break;
- case 105: // "dbPointer"
+ case symbol_kind::S_DB_POINTER: // "dbPointer"
value.template destroy<BSONDBRef>();
break;
- case 104: // "regex"
+ case symbol_kind::S_REGEX: // "regex"
value.template destroy<BSONRegEx>();
break;
- case 107: // "Symbol"
+ case symbol_kind::S_SYMBOL: // "Symbol"
value.template destroy<BSONSymbol>();
break;
- case 135: // dbPointer
- case 136: // javascript
- case 137: // symbol
- case 138: // javascriptWScope
- case 139: // int
- case 140: // timestamp
- case 141: // long
- case 142: // double
- case 143: // decimal
- case 144: // minKey
- case 145: // maxKey
- case 146: // value
- case 147: // string
- case 148: // fieldPath
- case 149: // binary
- case 150: // undefined
- case 151: // objectId
- case 152: // bool
- case 153: // date
- case 154: // null
- case 155: // regex
- case 156: // simpleValue
- case 157: // compoundValue
- case 158: // valueArray
- case 159: // valueObject
- case 160: // valueFields
- case 161: // variable
- case 162: // pipeline
- case 163: // stageList
- case 164: // stage
- case 165: // inhibitOptimization
- case 166: // unionWith
- case 167: // skip
- case 168: // limit
- case 169: // project
- case 170: // sample
- case 171: // projectFields
- case 172: // projection
- case 173: // num
- case 174: // expression
- case 175: // compoundExpression
- case 176: // exprFixedTwoArg
- case 177: // expressionArray
- case 178: // expressionObject
- case 179: // expressionFields
- case 180: // maths
- case 181: // add
- case 182: // atan2
- case 183: // boolExps
- case 184: // and
- case 185: // or
- case 186: // not
- case 187: // literalEscapes
- case 188: // const
- case 189: // literal
- case 190: // stringExps
- case 191: // concat
- case 192: // dateFromString
- case 193: // dateToString
- case 194: // indexOfBytes
- case 195: // indexOfCP
- case 196: // ltrim
- case 197: // regexFind
- case 198: // regexFindAll
- case 199: // regexMatch
- case 200: // regexArgs
- case 201: // replaceOne
- case 202: // replaceAll
- case 203: // rtrim
- case 204: // split
- case 205: // strLenBytes
- case 206: // strLenCP
- case 207: // strcasecmp
- case 208: // substr
- case 209: // substrBytes
- case 210: // substrCP
- case 211: // toLower
- case 212: // toUpper
- case 213: // trim
- case 214: // compExprs
- case 215: // cmp
- case 216: // eq
- case 217: // gt
- case 218: // gte
- case 219: // lt
- case 220: // lte
- case 221: // ne
- case 222: // typeExpression
- case 223: // convert
- case 224: // toBool
- case 225: // toDate
- case 226: // toDecimal
- case 227: // toDouble
- case 228: // toInt
- case 229: // toLong
- case 230: // toObjectId
- case 231: // toString
- case 232: // type
- case 233: // abs
- case 234: // ceil
- case 235: // divide
- case 236: // exponent
- case 237: // floor
- case 238: // ln
- case 239: // log
- case 240: // logten
- case 241: // mod
- case 242: // multiply
- case 243: // pow
- case 244: // round
- case 245: // sqrt
- case 246: // subtract
- case 247: // trunc
- case 257: // matchExpression
- case 258: // filterFields
- case 259: // filterVal
+ case symbol_kind::S_dbPointer: // dbPointer
+ case symbol_kind::S_javascript: // javascript
+ case symbol_kind::S_symbol: // symbol
+ case symbol_kind::S_javascriptWScope: // javascriptWScope
+ case symbol_kind::S_int: // int
+ case symbol_kind::S_timestamp: // timestamp
+ case symbol_kind::S_long: // long
+ case symbol_kind::S_double: // double
+ case symbol_kind::S_decimal: // decimal
+ case symbol_kind::S_minKey: // minKey
+ case symbol_kind::S_maxKey: // maxKey
+ case symbol_kind::S_value: // value
+ case symbol_kind::S_string: // string
+ case symbol_kind::S_fieldPath: // fieldPath
+ case symbol_kind::S_binary: // binary
+ case symbol_kind::S_undefined: // undefined
+ case symbol_kind::S_objectId: // objectId
+ case symbol_kind::S_bool: // bool
+ case symbol_kind::S_date: // date
+ case symbol_kind::S_null: // null
+ case symbol_kind::S_regex: // regex
+ case symbol_kind::S_simpleValue: // simpleValue
+ case symbol_kind::S_compoundValue: // compoundValue
+ case symbol_kind::S_valueArray: // valueArray
+ case symbol_kind::S_valueObject: // valueObject
+ case symbol_kind::S_valueFields: // valueFields
+ case symbol_kind::S_variable: // variable
+ case symbol_kind::S_pipeline: // pipeline
+ case symbol_kind::S_stageList: // stageList
+ case symbol_kind::S_stage: // stage
+ case symbol_kind::S_inhibitOptimization: // inhibitOptimization
+ case symbol_kind::S_unionWith: // unionWith
+ case symbol_kind::S_skip: // skip
+ case symbol_kind::S_limit: // limit
+ case symbol_kind::S_project: // project
+ case symbol_kind::S_sample: // sample
+ case symbol_kind::S_projectFields: // projectFields
+ case symbol_kind::S_projection: // projection
+ case symbol_kind::S_num: // num
+ case symbol_kind::S_expression: // expression
+ case symbol_kind::S_compoundExpression: // compoundExpression
+ case symbol_kind::S_exprFixedTwoArg: // exprFixedTwoArg
+ case symbol_kind::S_expressionArray: // expressionArray
+ case symbol_kind::S_expressionObject: // expressionObject
+ case symbol_kind::S_expressionFields: // expressionFields
+ case symbol_kind::S_maths: // maths
+ case symbol_kind::S_add: // add
+ case symbol_kind::S_atan2: // atan2
+ case symbol_kind::S_boolExps: // boolExps
+ case symbol_kind::S_and: // and
+ case symbol_kind::S_or: // or
+ case symbol_kind::S_not: // not
+ case symbol_kind::S_literalEscapes: // literalEscapes
+ case symbol_kind::S_const: // const
+ case symbol_kind::S_literal: // literal
+ case symbol_kind::S_stringExps: // stringExps
+ case symbol_kind::S_concat: // concat
+ case symbol_kind::S_dateFromString: // dateFromString
+ case symbol_kind::S_dateToString: // dateToString
+ case symbol_kind::S_indexOfBytes: // indexOfBytes
+ case symbol_kind::S_indexOfCP: // indexOfCP
+ case symbol_kind::S_ltrim: // ltrim
+ case symbol_kind::S_regexFind: // regexFind
+ case symbol_kind::S_regexFindAll: // regexFindAll
+ case symbol_kind::S_regexMatch: // regexMatch
+ case symbol_kind::S_regexArgs: // regexArgs
+ case symbol_kind::S_replaceOne: // replaceOne
+ case symbol_kind::S_replaceAll: // replaceAll
+ case symbol_kind::S_rtrim: // rtrim
+ case symbol_kind::S_split: // split
+ case symbol_kind::S_strLenBytes: // strLenBytes
+ case symbol_kind::S_strLenCP: // strLenCP
+ case symbol_kind::S_strcasecmp: // strcasecmp
+ case symbol_kind::S_substr: // substr
+ case symbol_kind::S_substrBytes: // substrBytes
+ case symbol_kind::S_substrCP: // substrCP
+ case symbol_kind::S_toLower: // toLower
+ case symbol_kind::S_toUpper: // toUpper
+ case symbol_kind::S_trim: // trim
+ case symbol_kind::S_compExprs: // compExprs
+ case symbol_kind::S_cmp: // cmp
+ case symbol_kind::S_eq: // eq
+ case symbol_kind::S_gt: // gt
+ case symbol_kind::S_gte: // gte
+ case symbol_kind::S_lt: // lt
+ case symbol_kind::S_lte: // lte
+ case symbol_kind::S_ne: // ne
+ case symbol_kind::S_typeExpression: // typeExpression
+ case symbol_kind::S_convert: // convert
+ case symbol_kind::S_toBool: // toBool
+ case symbol_kind::S_toDate: // toDate
+ case symbol_kind::S_toDecimal: // toDecimal
+ case symbol_kind::S_toDouble: // toDouble
+ case symbol_kind::S_toInt: // toInt
+ case symbol_kind::S_toLong: // toLong
+ case symbol_kind::S_toObjectId: // toObjectId
+ case symbol_kind::S_toString: // toString
+ case symbol_kind::S_type: // type
+ case symbol_kind::S_abs: // abs
+ case symbol_kind::S_ceil: // ceil
+ case symbol_kind::S_divide: // divide
+ case symbol_kind::S_exponent: // exponent
+ case symbol_kind::S_floor: // floor
+ case symbol_kind::S_ln: // ln
+ case symbol_kind::S_log: // log
+ case symbol_kind::S_logten: // logten
+ case symbol_kind::S_mod: // mod
+ case symbol_kind::S_multiply: // multiply
+ case symbol_kind::S_pow: // pow
+ case symbol_kind::S_round: // round
+ case symbol_kind::S_sqrt: // sqrt
+ case symbol_kind::S_subtract: // subtract
+ case symbol_kind::S_trunc: // trunc
+ case symbol_kind::S_matchExpression: // matchExpression
+ case symbol_kind::S_filterFields: // filterFields
+ case symbol_kind::S_filterVal: // filterVal
+ case symbol_kind::S_sortSpecs: // sortSpecs
+ case symbol_kind::S_specList: // specList
+ case symbol_kind::S_metaSort: // metaSort
+ case symbol_kind::S_oneOrNegOne: // oneOrNegOne
+ case symbol_kind::S_metaSortKeyword: // metaSortKeyword
value.template destroy<CNode>();
break;
- case 122: // projectionFieldname
- case 123: // expressionFieldname
- case 124: // stageAsUserFieldname
- case 125: // filterFieldname
- case 126: // argAsUserFieldname
- case 127: // aggExprAsUserFieldname
- case 128: // invariableUserFieldname
- case 129: // idAsUserFieldname
- case 130: // valueFieldname
+ case symbol_kind::S_projectionFieldname: // projectionFieldname
+ case symbol_kind::S_expressionFieldname: // expressionFieldname
+ case symbol_kind::S_stageAsUserFieldname: // stageAsUserFieldname
+ case symbol_kind::S_filterFieldname: // filterFieldname
+ case symbol_kind::S_argAsUserFieldname: // argAsUserFieldname
+ case symbol_kind::S_aggExprAsUserFieldname: // aggExprAsUserFieldname
+ case symbol_kind::S_invariableUserFieldname: // invariableUserFieldname
+ case symbol_kind::S_idAsUserFieldname: // idAsUserFieldname
+ case symbol_kind::S_valueFieldname: // valueFieldname
value.template destroy<CNode::Fieldname>();
break;
- case 102: // "Date"
+ case symbol_kind::S_DATE_LITERAL: // "Date"
value.template destroy<Date_t>();
break;
- case 112: // "non-zero decimal"
+ case symbol_kind::S_DECIMAL_OTHER: // "arbitrary decimal"
value.template destroy<Decimal128>();
break;
- case 101: // "ObjectID"
+ case symbol_kind::S_OBJECT_ID: // "ObjectID"
value.template destroy<OID>();
break;
- case 113: // "Timestamp"
+ case symbol_kind::S_TIMESTAMP: // "Timestamp"
value.template destroy<Timestamp>();
break;
- case 115: // "maxKey"
+ case symbol_kind::S_MAX_KEY: // "maxKey"
value.template destroy<UserMaxKey>();
break;
- case 114: // "minKey"
+ case symbol_kind::S_MIN_KEY: // "minKey"
value.template destroy<UserMinKey>();
break;
- case 103: // "null"
+ case symbol_kind::S_JSNULL: // "null"
value.template destroy<UserNull>();
break;
- case 100: // "undefined"
+ case symbol_kind::S_UNDEFINED: // "undefined"
value.template destroy<UserUndefined>();
break;
- case 111: // "non-zero double"
+ case symbol_kind::S_DOUBLE_OTHER: // "arbitrary double"
value.template destroy<double>();
break;
- case 109: // "non-zero integer"
+ case symbol_kind::S_INT_OTHER: // "arbitrary integer"
value.template destroy<int>();
break;
- case 110: // "non-zero long"
+ case symbol_kind::S_LONG_OTHER: // "arbitrary long"
value.template destroy<long long>();
break;
- case 131: // projectField
- case 132: // expressionField
- case 133: // valueField
- case 134: // filterField
- case 248: // onErrorArg
- case 249: // onNullArg
- case 250: // formatArg
- case 251: // timezoneArg
- case 252: // charsArg
- case 253: // optionsArg
+ case symbol_kind::S_projectField: // projectField
+ case symbol_kind::S_expressionField: // expressionField
+ case symbol_kind::S_valueField: // valueField
+ case symbol_kind::S_filterField: // filterField
+ case symbol_kind::S_onErrorArg: // onErrorArg
+ case symbol_kind::S_onNullArg: // onNullArg
+ case symbol_kind::S_formatArg: // formatArg
+ case symbol_kind::S_timezoneArg: // timezoneArg
+ case symbol_kind::S_charsArg: // charsArg
+ case symbol_kind::S_optionsArg: // optionsArg
+ case symbol_kind::S_sortSpec: // sortSpec
value.template destroy<std::pair<CNode::Fieldname, CNode>>();
break;
- case 97: // "fieldname"
- case 98: // "string"
- case 116: // "$-prefixed string"
- case 117: // "$$-prefixed string"
- case 118: // "$-prefixed fieldname"
+ case symbol_kind::S_FIELDNAME: // "fieldname"
+ case symbol_kind::S_STRING: // "string"
+ case symbol_kind::S_DOLLAR_STRING: // "$-prefixed string"
+ case symbol_kind::S_DOLLAR_DOLLAR_STRING: // "$$-prefixed string"
+ case symbol_kind::S_DOLLAR_PREF_FIELDNAME: // "$-prefixed fieldname"
value.template destroy<std::string>();
break;
- case 254: // expressions
- case 255: // values
- case 256: // exprZeroToTwo
+ case symbol_kind::S_expressions: // expressions
+ case symbol_kind::S_values: // values
+ case symbol_kind::S_exprZeroToTwo: // exprZeroToTwo
value.template destroy<std::vector<CNode>>();
break;
@@ -1171,6 +1738,14 @@ public:
Base::clear();
}
+ /// The user-facing name of this symbol.
+ std::string name() const YY_NOEXCEPT {
+ return PipelineParserGen::symbol_name(this->kind());
+ }
+
+ /// Backward compatibility (Bison 3.6).
+ symbol_kind_type type_get() const YY_NOEXCEPT;
+
/// Whether empty.
bool empty() const YY_NOEXCEPT;
@@ -1191,44 +1766,49 @@ public:
};
/// Type access provider for token (enum) based symbols.
- struct by_type {
+ struct by_kind {
/// Default constructor.
- by_type();
+ by_kind();
#if 201103L <= YY_CPLUSPLUS
/// Move constructor.
- by_type(by_type&& that);
+ by_kind(by_kind&& that);
#endif
/// Copy constructor.
- by_type(const by_type& that);
+ by_kind(const by_kind& that);
- /// The symbol type as needed by the constructor.
- typedef token_type kind_type;
+ /// The symbol kind as needed by the constructor.
+ typedef token_kind_type kind_type;
/// Constructor from (external) token numbers.
- by_type(kind_type t);
+ by_kind(kind_type t);
/// Record that this symbol is empty.
void clear();
- /// Steal the symbol type from \a that.
- void move(by_type& that);
+ /// Steal the symbol kind from \a that.
+ void move(by_kind& that);
/// The (internal) type number (corresponding to \a type).
/// \a empty when empty.
- symbol_number_type type_get() const YY_NOEXCEPT;
+ symbol_kind_type kind() const YY_NOEXCEPT;
- /// The symbol type.
- /// \a empty_symbol when empty.
- /// An int, not token_number_type, to be able to store empty_symbol.
- int type;
+ /// Backward compatibility (Bison 3.6).
+ symbol_kind_type type_get() const YY_NOEXCEPT;
+
+ /// The symbol kind.
+ /// \a S_YYEMPTY when empty.
+ symbol_kind_type kind_;
};
+ /// Backward compatibility for a private implementation detail (Bison 3.6).
+ typedef by_kind by_type;
+
/// "External" symbols: returned by the scanner.
- struct symbol_type : basic_symbol<by_type> {
+ struct symbol_type : basic_symbol<by_kind> {
/// Superclass.
- typedef basic_symbol<by_type> super_type;
+ typedef basic_symbol<by_kind> super_type;
/// Empty symbol.
symbol_type() {}
@@ -1237,9 +1817,10 @@ public:
#if 201103L <= YY_CPLUSPLUS
symbol_type(int tok, location_type l) : super_type(token_type(tok), std::move(l)) {
YY_ASSERT(
- tok == token::END_OF_FILE || tok == token::ABS || tok == token::ADD ||
- tok == token::AND || tok == token::ARG_CHARS || tok == token::ARG_COLL ||
- tok == token::ARG_DATE || tok == token::ARG_DATE_STRING || tok == token::ARG_FIND ||
+ tok == token::END_OF_FILE || tok == token::YYerror || tok == token::YYUNDEF ||
+ tok == token::ABS || tok == token::ADD || tok == token::AND ||
+ tok == token::ARG_CHARS || tok == token::ARG_COLL || tok == token::ARG_DATE ||
+ tok == token::ARG_DATE_STRING || tok == token::ARG_FIND ||
tok == token::ARG_FORMAT || tok == token::ARG_INPUT || tok == token::ARG_ON_ERROR ||
tok == token::ARG_ON_NULL || tok == token::ARG_OPTIONS ||
tok == token::ARG_PIPELINE || tok == token::ARG_REGEX ||
@@ -1248,38 +1829,45 @@ public:
tok == token::BOOL_FALSE || tok == token::BOOL_TRUE || tok == token::CEIL ||
tok == token::CMP || tok == token::CONCAT || tok == token::CONST_EXPR ||
tok == token::CONVERT || tok == token::DATE_FROM_STRING ||
- tok == token::DATE_TO_STRING || tok == token::DECIMAL_ZERO ||
- tok == token::DIVIDE || tok == token::DOUBLE_ZERO || tok == token::END_ARRAY ||
- tok == token::END_OBJECT || tok == token::EQ || tok == token::EXPONENT ||
- tok == token::FLOOR || tok == token::GT || tok == token::GTE || tok == token::ID ||
+ tok == token::DATE_TO_STRING || tok == token::DECIMAL_NEGATIVE_ONE ||
+ tok == token::DECIMAL_ONE || tok == token::DECIMAL_ZERO || tok == token::DIVIDE ||
+ tok == token::DOUBLE_NEGATIVE_ONE || tok == token::DOUBLE_ONE ||
+ tok == token::DOUBLE_ZERO || tok == token::END_ARRAY || tok == token::END_OBJECT ||
+ tok == token::EQ || tok == token::EXPONENT || tok == token::FLOOR ||
+ tok == token::GT || tok == token::GTE || tok == token::ID ||
tok == token::INDEX_OF_BYTES || tok == token::INDEX_OF_CP ||
- tok == token::INT_ZERO || tok == token::LITERAL || tok == token::LN ||
- tok == token::LOG || tok == token::LOGTEN || tok == token::LONG_ZERO ||
- tok == token::LT || tok == token::LTE || tok == token::LTRIM || tok == token::MOD ||
+ tok == token::INT_NEGATIVE_ONE || tok == token::INT_ONE || tok == token::INT_ZERO ||
+ tok == token::LITERAL || tok == token::LN || tok == token::LOG ||
+ tok == token::LOGTEN || tok == token::LONG_NEGATIVE_ONE || tok == token::LONG_ONE ||
+ tok == token::LONG_ZERO || tok == token::LT || tok == token::LTE ||
+ tok == token::LTRIM || tok == token::META || tok == token::MOD ||
tok == token::MULTIPLY || tok == token::NE || tok == token::NOT ||
- tok == token::OR || tok == token::POW || tok == token::REGEX_FIND ||
- tok == token::REGEX_FIND_ALL || tok == token::REGEX_MATCH ||
- tok == token::REPLACE_ALL || tok == token::REPLACE_ONE || tok == token::ROUND ||
- tok == token::RTRIM || tok == token::SPLIT || tok == token::SQRT ||
+ tok == token::OR || tok == token::POW || tok == token::RAND_VAL ||
+ tok == token::REGEX_FIND || tok == token::REGEX_FIND_ALL ||
+ tok == token::REGEX_MATCH || tok == token::REPLACE_ALL ||
+ tok == token::REPLACE_ONE || tok == token::ROUND || tok == token::RTRIM ||
+ tok == token::SPLIT || tok == token::SQRT ||
tok == token::STAGE_INHIBIT_OPTIMIZATION || tok == token::STAGE_LIMIT ||
tok == token::STAGE_PROJECT || tok == token::STAGE_SAMPLE ||
tok == token::STAGE_SKIP || tok == token::STAGE_UNION_WITH ||
tok == token::START_ARRAY || tok == token::START_OBJECT ||
tok == token::STR_CASE_CMP || tok == token::STR_LEN_BYTES ||
tok == token::STR_LEN_CP || tok == token::SUBSTR || tok == token::SUBSTR_BYTES ||
- tok == token::SUBSTR_CP || tok == token::SUBTRACT || tok == token::TO_BOOL ||
- tok == token::TO_DATE || tok == token::TO_DECIMAL || tok == token::TO_DOUBLE ||
- tok == token::TO_INT || tok == token::TO_LONG || tok == token::TO_LOWER ||
- tok == token::TO_OBJECT_ID || tok == token::TO_STRING || tok == token::TO_UPPER ||
- tok == token::TRIM || tok == token::TRUNC || tok == token::TYPE ||
- tok == token::START_PIPELINE || tok == token::START_MATCH);
+ tok == token::SUBSTR_CP || tok == token::SUBTRACT || tok == token::TEXT_SCORE ||
+ tok == token::TO_BOOL || tok == token::TO_DATE || tok == token::TO_DECIMAL ||
+ tok == token::TO_DOUBLE || tok == token::TO_INT || tok == token::TO_LONG ||
+ tok == token::TO_LOWER || tok == token::TO_OBJECT_ID || tok == token::TO_STRING ||
+ tok == token::TO_UPPER || tok == token::TRIM || tok == token::TRUNC ||
+ tok == token::TYPE || tok == token::START_PIPELINE || tok == token::START_MATCH ||
+ tok == token::START_SORT);
}
#else
symbol_type(int tok, const location_type& l) : super_type(token_type(tok), l) {
YY_ASSERT(
- tok == token::END_OF_FILE || tok == token::ABS || tok == token::ADD ||
- tok == token::AND || tok == token::ARG_CHARS || tok == token::ARG_COLL ||
- tok == token::ARG_DATE || tok == token::ARG_DATE_STRING || tok == token::ARG_FIND ||
+ tok == token::END_OF_FILE || tok == token::YYerror || tok == token::YYUNDEF ||
+ tok == token::ABS || tok == token::ADD || tok == token::AND ||
+ tok == token::ARG_CHARS || tok == token::ARG_COLL || tok == token::ARG_DATE ||
+ tok == token::ARG_DATE_STRING || tok == token::ARG_FIND ||
tok == token::ARG_FORMAT || tok == token::ARG_INPUT || tok == token::ARG_ON_ERROR ||
tok == token::ARG_ON_NULL || tok == token::ARG_OPTIONS ||
tok == token::ARG_PIPELINE || tok == token::ARG_REGEX ||
@@ -1288,31 +1876,37 @@ public:
tok == token::BOOL_FALSE || tok == token::BOOL_TRUE || tok == token::CEIL ||
tok == token::CMP || tok == token::CONCAT || tok == token::CONST_EXPR ||
tok == token::CONVERT || tok == token::DATE_FROM_STRING ||
- tok == token::DATE_TO_STRING || tok == token::DECIMAL_ZERO ||
- tok == token::DIVIDE || tok == token::DOUBLE_ZERO || tok == token::END_ARRAY ||
- tok == token::END_OBJECT || tok == token::EQ || tok == token::EXPONENT ||
- tok == token::FLOOR || tok == token::GT || tok == token::GTE || tok == token::ID ||
+ tok == token::DATE_TO_STRING || tok == token::DECIMAL_NEGATIVE_ONE ||
+ tok == token::DECIMAL_ONE || tok == token::DECIMAL_ZERO || tok == token::DIVIDE ||
+ tok == token::DOUBLE_NEGATIVE_ONE || tok == token::DOUBLE_ONE ||
+ tok == token::DOUBLE_ZERO || tok == token::END_ARRAY || tok == token::END_OBJECT ||
+ tok == token::EQ || tok == token::EXPONENT || tok == token::FLOOR ||
+ tok == token::GT || tok == token::GTE || tok == token::ID ||
tok == token::INDEX_OF_BYTES || tok == token::INDEX_OF_CP ||
- tok == token::INT_ZERO || tok == token::LITERAL || tok == token::LN ||
- tok == token::LOG || tok == token::LOGTEN || tok == token::LONG_ZERO ||
- tok == token::LT || tok == token::LTE || tok == token::LTRIM || tok == token::MOD ||
+ tok == token::INT_NEGATIVE_ONE || tok == token::INT_ONE || tok == token::INT_ZERO ||
+ tok == token::LITERAL || tok == token::LN || tok == token::LOG ||
+ tok == token::LOGTEN || tok == token::LONG_NEGATIVE_ONE || tok == token::LONG_ONE ||
+ tok == token::LONG_ZERO || tok == token::LT || tok == token::LTE ||
+ tok == token::LTRIM || tok == token::META || tok == token::MOD ||
tok == token::MULTIPLY || tok == token::NE || tok == token::NOT ||
- tok == token::OR || tok == token::POW || tok == token::REGEX_FIND ||
- tok == token::REGEX_FIND_ALL || tok == token::REGEX_MATCH ||
- tok == token::REPLACE_ALL || tok == token::REPLACE_ONE || tok == token::ROUND ||
- tok == token::RTRIM || tok == token::SPLIT || tok == token::SQRT ||
+ tok == token::OR || tok == token::POW || tok == token::RAND_VAL ||
+ tok == token::REGEX_FIND || tok == token::REGEX_FIND_ALL ||
+ tok == token::REGEX_MATCH || tok == token::REPLACE_ALL ||
+ tok == token::REPLACE_ONE || tok == token::ROUND || tok == token::RTRIM ||
+ tok == token::SPLIT || tok == token::SQRT ||
tok == token::STAGE_INHIBIT_OPTIMIZATION || tok == token::STAGE_LIMIT ||
tok == token::STAGE_PROJECT || tok == token::STAGE_SAMPLE ||
tok == token::STAGE_SKIP || tok == token::STAGE_UNION_WITH ||
tok == token::START_ARRAY || tok == token::START_OBJECT ||
tok == token::STR_CASE_CMP || tok == token::STR_LEN_BYTES ||
tok == token::STR_LEN_CP || tok == token::SUBSTR || tok == token::SUBSTR_BYTES ||
- tok == token::SUBSTR_CP || tok == token::SUBTRACT || tok == token::TO_BOOL ||
- tok == token::TO_DATE || tok == token::TO_DECIMAL || tok == token::TO_DOUBLE ||
- tok == token::TO_INT || tok == token::TO_LONG || tok == token::TO_LOWER ||
- tok == token::TO_OBJECT_ID || tok == token::TO_STRING || tok == token::TO_UPPER ||
- tok == token::TRIM || tok == token::TRUNC || tok == token::TYPE ||
- tok == token::START_PIPELINE || tok == token::START_MATCH);
+ tok == token::SUBSTR_CP || tok == token::SUBTRACT || tok == token::TEXT_SCORE ||
+ tok == token::TO_BOOL || tok == token::TO_DATE || tok == token::TO_DECIMAL ||
+ tok == token::TO_DOUBLE || tok == token::TO_INT || tok == token::TO_LONG ||
+ tok == token::TO_LOWER || tok == token::TO_OBJECT_ID || tok == token::TO_STRING ||
+ tok == token::TO_UPPER || tok == token::TRIM || tok == token::TRUNC ||
+ tok == token::TYPE || tok == token::START_PIPELINE || tok == token::START_MATCH ||
+ tok == token::START_SORT);
}
#endif
#if 201103L <= YY_CPLUSPLUS
@@ -1395,12 +1989,12 @@ public:
#if 201103L <= YY_CPLUSPLUS
symbol_type(int tok, Decimal128 v, location_type l)
: super_type(token_type(tok), std::move(v), std::move(l)) {
- YY_ASSERT(tok == token::DECIMAL_NON_ZERO);
+ YY_ASSERT(tok == token::DECIMAL_OTHER);
}
#else
symbol_type(int tok, const Decimal128& v, const location_type& l)
: super_type(token_type(tok), v, l) {
- YY_ASSERT(tok == token::DECIMAL_NON_ZERO);
+ YY_ASSERT(tok == token::DECIMAL_OTHER);
}
#endif
#if 201103L <= YY_CPLUSPLUS
@@ -1472,34 +2066,34 @@ public:
#if 201103L <= YY_CPLUSPLUS
symbol_type(int tok, double v, location_type l)
: super_type(token_type(tok), std::move(v), std::move(l)) {
- YY_ASSERT(tok == token::DOUBLE_NON_ZERO);
+ YY_ASSERT(tok == token::DOUBLE_OTHER);
}
#else
symbol_type(int tok, const double& v, const location_type& l)
: super_type(token_type(tok), v, l) {
- YY_ASSERT(tok == token::DOUBLE_NON_ZERO);
+ YY_ASSERT(tok == token::DOUBLE_OTHER);
}
#endif
#if 201103L <= YY_CPLUSPLUS
symbol_type(int tok, int v, location_type l)
: super_type(token_type(tok), std::move(v), std::move(l)) {
- YY_ASSERT(tok == token::INT_NON_ZERO);
+ YY_ASSERT(tok == token::INT_OTHER);
}
#else
symbol_type(int tok, const int& v, const location_type& l)
: super_type(token_type(tok), v, l) {
- YY_ASSERT(tok == token::INT_NON_ZERO);
+ YY_ASSERT(tok == token::INT_OTHER);
}
#endif
#if 201103L <= YY_CPLUSPLUS
symbol_type(int tok, long long v, location_type l)
: super_type(token_type(tok), std::move(v), std::move(l)) {
- YY_ASSERT(tok == token::LONG_NON_ZERO);
+ YY_ASSERT(tok == token::LONG_OTHER);
}
#else
symbol_type(int tok, const long long& v, const location_type& l)
: super_type(token_type(tok), v, l) {
- YY_ASSERT(tok == token::LONG_NON_ZERO);
+ YY_ASSERT(tok == token::LONG_OTHER);
}
#endif
#if 201103L <= YY_CPLUSPLUS
@@ -1523,6 +2117,13 @@ public:
PipelineParserGen(BSONLexer& lexer_yyarg, CNode* cst_yyarg);
virtual ~PipelineParserGen();
+#if 201103L <= YY_CPLUSPLUS
+ /// Non copyable.
+ PipelineParserGen(const PipelineParserGen&) = delete;
+ /// Non copyable.
+ PipelineParserGen& operator=(const PipelineParserGen&) = delete;
+#endif
+
/// Parse. An alias for parse ().
/// \returns 0 iff parsing succeeded.
int operator()();
@@ -1553,6 +2154,10 @@ public:
/// Report a syntax error.
void error(const syntax_error& err);
+ /// The user-facing name of the symbol whose (internal) number is
+ /// YYSYMBOL. No bounds checking.
+ static std::string symbol_name(symbol_kind_type yysymbol);
+
// Implementation of make_symbol for each symbol type.
#if 201103L <= YY_CPLUSPLUS
static symbol_type make_END_OF_FILE(location_type l) {
@@ -1564,6 +2169,24 @@ public:
}
#endif
#if 201103L <= YY_CPLUSPLUS
+ static symbol_type make_YYerror(location_type l) {
+ return symbol_type(token::YYerror, std::move(l));
+ }
+#else
+ static symbol_type make_YYerror(const location_type& l) {
+ return symbol_type(token::YYerror, l);
+ }
+#endif
+#if 201103L <= YY_CPLUSPLUS
+ static symbol_type make_YYUNDEF(location_type l) {
+ return symbol_type(token::YYUNDEF, std::move(l));
+ }
+#else
+ static symbol_type make_YYUNDEF(const location_type& l) {
+ return symbol_type(token::YYUNDEF, l);
+ }
+#endif
+#if 201103L <= YY_CPLUSPLUS
static symbol_type make_ABS(location_type l) {
return symbol_type(token::ABS, std::move(l));
}
@@ -1825,6 +2448,24 @@ public:
}
#endif
#if 201103L <= YY_CPLUSPLUS
+ static symbol_type make_DECIMAL_NEGATIVE_ONE(location_type l) {
+ return symbol_type(token::DECIMAL_NEGATIVE_ONE, std::move(l));
+ }
+#else
+ static symbol_type make_DECIMAL_NEGATIVE_ONE(const location_type& l) {
+ return symbol_type(token::DECIMAL_NEGATIVE_ONE, l);
+ }
+#endif
+#if 201103L <= YY_CPLUSPLUS
+ static symbol_type make_DECIMAL_ONE(location_type l) {
+ return symbol_type(token::DECIMAL_ONE, std::move(l));
+ }
+#else
+ static symbol_type make_DECIMAL_ONE(const location_type& l) {
+ return symbol_type(token::DECIMAL_ONE, l);
+ }
+#endif
+#if 201103L <= YY_CPLUSPLUS
static symbol_type make_DECIMAL_ZERO(location_type l) {
return symbol_type(token::DECIMAL_ZERO, std::move(l));
}
@@ -1843,6 +2484,24 @@ public:
}
#endif
#if 201103L <= YY_CPLUSPLUS
+ static symbol_type make_DOUBLE_NEGATIVE_ONE(location_type l) {
+ return symbol_type(token::DOUBLE_NEGATIVE_ONE, std::move(l));
+ }
+#else
+ static symbol_type make_DOUBLE_NEGATIVE_ONE(const location_type& l) {
+ return symbol_type(token::DOUBLE_NEGATIVE_ONE, l);
+ }
+#endif
+#if 201103L <= YY_CPLUSPLUS
+ static symbol_type make_DOUBLE_ONE(location_type l) {
+ return symbol_type(token::DOUBLE_ONE, std::move(l));
+ }
+#else
+ static symbol_type make_DOUBLE_ONE(const location_type& l) {
+ return symbol_type(token::DOUBLE_ONE, l);
+ }
+#endif
+#if 201103L <= YY_CPLUSPLUS
static symbol_type make_DOUBLE_ZERO(location_type l) {
return symbol_type(token::DOUBLE_ZERO, std::move(l));
}
@@ -1942,6 +2601,24 @@ public:
}
#endif
#if 201103L <= YY_CPLUSPLUS
+ static symbol_type make_INT_NEGATIVE_ONE(location_type l) {
+ return symbol_type(token::INT_NEGATIVE_ONE, std::move(l));
+ }
+#else
+ static symbol_type make_INT_NEGATIVE_ONE(const location_type& l) {
+ return symbol_type(token::INT_NEGATIVE_ONE, l);
+ }
+#endif
+#if 201103L <= YY_CPLUSPLUS
+ static symbol_type make_INT_ONE(location_type l) {
+ return symbol_type(token::INT_ONE, std::move(l));
+ }
+#else
+ static symbol_type make_INT_ONE(const location_type& l) {
+ return symbol_type(token::INT_ONE, l);
+ }
+#endif
+#if 201103L <= YY_CPLUSPLUS
static symbol_type make_INT_ZERO(location_type l) {
return symbol_type(token::INT_ZERO, std::move(l));
}
@@ -1987,6 +2664,24 @@ public:
}
#endif
#if 201103L <= YY_CPLUSPLUS
+ static symbol_type make_LONG_NEGATIVE_ONE(location_type l) {
+ return symbol_type(token::LONG_NEGATIVE_ONE, std::move(l));
+ }
+#else
+ static symbol_type make_LONG_NEGATIVE_ONE(const location_type& l) {
+ return symbol_type(token::LONG_NEGATIVE_ONE, l);
+ }
+#endif
+#if 201103L <= YY_CPLUSPLUS
+ static symbol_type make_LONG_ONE(location_type l) {
+ return symbol_type(token::LONG_ONE, std::move(l));
+ }
+#else
+ static symbol_type make_LONG_ONE(const location_type& l) {
+ return symbol_type(token::LONG_ONE, l);
+ }
+#endif
+#if 201103L <= YY_CPLUSPLUS
static symbol_type make_LONG_ZERO(location_type l) {
return symbol_type(token::LONG_ZERO, std::move(l));
}
@@ -2023,6 +2718,15 @@ public:
}
#endif
#if 201103L <= YY_CPLUSPLUS
+ static symbol_type make_META(location_type l) {
+ return symbol_type(token::META, std::move(l));
+ }
+#else
+ static symbol_type make_META(const location_type& l) {
+ return symbol_type(token::META, l);
+ }
+#endif
+#if 201103L <= YY_CPLUSPLUS
static symbol_type make_MOD(location_type l) {
return symbol_type(token::MOD, std::move(l));
}
@@ -2077,6 +2781,15 @@ public:
}
#endif
#if 201103L <= YY_CPLUSPLUS
+ static symbol_type make_RAND_VAL(location_type l) {
+ return symbol_type(token::RAND_VAL, std::move(l));
+ }
+#else
+ static symbol_type make_RAND_VAL(const location_type& l) {
+ return symbol_type(token::RAND_VAL, l);
+ }
+#endif
+#if 201103L <= YY_CPLUSPLUS
static symbol_type make_REGEX_FIND(location_type l) {
return symbol_type(token::REGEX_FIND, std::move(l));
}
@@ -2293,6 +3006,15 @@ public:
}
#endif
#if 201103L <= YY_CPLUSPLUS
+ static symbol_type make_TEXT_SCORE(location_type l) {
+ return symbol_type(token::TEXT_SCORE, std::move(l));
+ }
+#else
+ static symbol_type make_TEXT_SCORE(const location_type& l) {
+ return symbol_type(token::TEXT_SCORE, l);
+ }
+#endif
+#if 201103L <= YY_CPLUSPLUS
static symbol_type make_TO_BOOL(location_type l) {
return symbol_type(token::TO_BOOL, std::move(l));
}
@@ -2518,39 +3240,39 @@ public:
}
#endif
#if 201103L <= YY_CPLUSPLUS
- static symbol_type make_INT_NON_ZERO(int v, location_type l) {
- return symbol_type(token::INT_NON_ZERO, std::move(v), std::move(l));
+ static symbol_type make_INT_OTHER(int v, location_type l) {
+ return symbol_type(token::INT_OTHER, std::move(v), std::move(l));
}
#else
- static symbol_type make_INT_NON_ZERO(const int& v, const location_type& l) {
- return symbol_type(token::INT_NON_ZERO, v, l);
+ static symbol_type make_INT_OTHER(const int& v, const location_type& l) {
+ return symbol_type(token::INT_OTHER, v, l);
}
#endif
#if 201103L <= YY_CPLUSPLUS
- static symbol_type make_LONG_NON_ZERO(long long v, location_type l) {
- return symbol_type(token::LONG_NON_ZERO, std::move(v), std::move(l));
+ static symbol_type make_LONG_OTHER(long long v, location_type l) {
+ return symbol_type(token::LONG_OTHER, std::move(v), std::move(l));
}
#else
- static symbol_type make_LONG_NON_ZERO(const long long& v, const location_type& l) {
- return symbol_type(token::LONG_NON_ZERO, v, l);
+ static symbol_type make_LONG_OTHER(const long long& v, const location_type& l) {
+ return symbol_type(token::LONG_OTHER, v, l);
}
#endif
#if 201103L <= YY_CPLUSPLUS
- static symbol_type make_DOUBLE_NON_ZERO(double v, location_type l) {
- return symbol_type(token::DOUBLE_NON_ZERO, std::move(v), std::move(l));
+ static symbol_type make_DOUBLE_OTHER(double v, location_type l) {
+ return symbol_type(token::DOUBLE_OTHER, std::move(v), std::move(l));
}
#else
- static symbol_type make_DOUBLE_NON_ZERO(const double& v, const location_type& l) {
- return symbol_type(token::DOUBLE_NON_ZERO, v, l);
+ static symbol_type make_DOUBLE_OTHER(const double& v, const location_type& l) {
+ return symbol_type(token::DOUBLE_OTHER, v, l);
}
#endif
#if 201103L <= YY_CPLUSPLUS
- static symbol_type make_DECIMAL_NON_ZERO(Decimal128 v, location_type l) {
- return symbol_type(token::DECIMAL_NON_ZERO, std::move(v), std::move(l));
+ static symbol_type make_DECIMAL_OTHER(Decimal128 v, location_type l) {
+ return symbol_type(token::DECIMAL_OTHER, std::move(v), std::move(l));
}
#else
- static symbol_type make_DECIMAL_NON_ZERO(const Decimal128& v, const location_type& l) {
- return symbol_type(token::DECIMAL_NON_ZERO, v, l);
+ static symbol_type make_DECIMAL_OTHER(const Decimal128& v, const location_type& l) {
+ return symbol_type(token::DECIMAL_OTHER, v, l);
}
#endif
#if 201103L <= YY_CPLUSPLUS
@@ -2625,21 +3347,60 @@ public:
return symbol_type(token::START_MATCH, l);
}
#endif
+#if 201103L <= YY_CPLUSPLUS
+ static symbol_type make_START_SORT(location_type l) {
+ return symbol_type(token::START_SORT, std::move(l));
+ }
+#else
+ static symbol_type make_START_SORT(const location_type& l) {
+ return symbol_type(token::START_SORT, l);
+ }
+#endif
+
+
+ class context {
+ public:
+ context(const PipelineParserGen& yyparser, const symbol_type& yyla);
+ const symbol_type& lookahead() const {
+ return yyla_;
+ }
+ symbol_kind_type token() const {
+ return yyla_.kind();
+ }
+ const location_type& location() const {
+ return yyla_.location;
+ }
+ /// Put in YYARG at most YYARGN of the expected tokens, and return the
+ /// number of tokens stored in YYARG. If YYARG is null, return the
+ /// number of expected tokens (guaranteed to be less than YYNTOKENS).
+ int expected_tokens(symbol_kind_type yyarg[], int yyargn) const;
+
+ private:
+ const PipelineParserGen& yyparser_;
+ const symbol_type& yyla_;
+ };
private:
- /// This class is not copyable.
+#if YY_CPLUSPLUS < 201103L
+ /// Non copyable.
PipelineParserGen(const PipelineParserGen&);
+ /// Non copyable.
PipelineParserGen& operator=(const PipelineParserGen&);
+#endif
+
/// Stored state numbers (used for stacks).
typedef short state_type;
- /// Generate an error message.
- /// \param yystate the state where the error occurred.
- /// \param yyla the lookahead token.
- virtual std::string yysyntax_error_(state_type yystate, const symbol_type& yyla) const;
+ /// The arguments of the error message.
+ int yy_syntax_error_arguments_(const context& yyctx,
+ symbol_kind_type yyarg[],
+ int yyargn) const;
+ /// Generate an error message.
+ /// \param yyctx the context in which the error occurred.
+ virtual std::string yysyntax_error_(const context& yyctx) const;
/// Compute post-reduction state.
/// \param yystate the current state
/// \param yysym the nonterminal to push on the stack
@@ -2656,10 +3417,17 @@ private:
static const short yypact_ninf_;
static const signed char yytable_ninf_;
- /// Convert a scanner token number \a t to a symbol number.
- /// In theory \a t should be a token_type, but character literals
+ /// Convert a scanner token kind \a t to a symbol kind.
+ /// In theory \a t should be a token_kind_type, but character literals
/// are valid, yet not members of the token_type enum.
- static token_number_type yytranslate_(int t);
+ static symbol_kind_type yytranslate_(int t);
+
+ /// Convert the symbol name \a n to a form suitable for a diagnostic.
+ static std::string yytnamerr_(const char* yystr);
+
+ /// For a symbol, its name in clear.
+ static const char* const yytname_[];
+
// Tables.
// YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
@@ -2695,26 +3463,20 @@ private:
static const signed char yyr2_[];
- /// Convert the symbol name \a n to a form suitable for a diagnostic.
- static std::string yytnamerr_(const char* n);
-
-
- /// For a symbol, its name in clear.
- static const char* const yytname_[];
#if YYDEBUG
// YYRLINE[YYN] -- Source line where rule number YYN was defined.
static const short yyrline_[];
/// Report on the debug stream that the rule \a r is going to be reduced.
- virtual void yy_reduce_print_(int r);
+ virtual void yy_reduce_print_(int r) const;
/// Print the state stack on the debug stream.
- virtual void yystack_print_();
+ virtual void yy_stack_print_() const;
/// Debugging level.
int yydebug_;
/// Debug stream.
std::ostream* yycdebug_;
- /// \brief Display a symbol type, value and location.
+ /// \brief Display a symbol kind, value and location.
/// \param yyo The output stream.
/// \param yysym The symbol.
template <typename Base>
@@ -2734,7 +3496,7 @@ private:
/// Default constructor.
by_state() YY_NOEXCEPT;
- /// The symbol type as needed by the constructor.
+ /// The symbol kind as needed by the constructor.
typedef state_type kind_type;
/// Constructor.
@@ -2746,12 +3508,12 @@ private:
/// Record that this symbol is empty.
void clear() YY_NOEXCEPT;
- /// Steal the symbol type from \a that.
+ /// Steal the symbol kind from \a that.
void move(by_state& that);
- /// The (internal) type number (corresponding to \a state).
- /// \a empty_symbol when empty.
- symbol_number_type type_get() const YY_NOEXCEPT;
+ /// The symbol kind (corresponding to \a state).
+ /// \a symbol_kind::S_YYEMPTY when empty.
+ symbol_kind_type kind() const YY_NOEXCEPT;
/// The state number used to denote an empty symbol.
/// We use the initial state, as it does not have a value.
@@ -2788,13 +3550,20 @@ private:
class stack {
public:
// Hide our reversed order.
- typedef typename S::reverse_iterator iterator;
- typedef typename S::const_reverse_iterator const_iterator;
+ typedef typename S::iterator iterator;
+ typedef typename S::const_iterator const_iterator;
typedef typename S::size_type size_type;
typedef typename std::ptrdiff_t index_type;
stack(size_type n = 200) : seq_(n) {}
+#if 201103L <= YY_CPLUSPLUS
+ /// Non copyable.
+ stack(const stack&) = delete;
+ /// Non copyable.
+ stack& operator=(const stack&) = delete;
+#endif
+
/// Random access.
///
/// Index 0 returns the topmost element.
@@ -2833,18 +3602,14 @@ private:
return index_type(seq_.size());
}
- std::ptrdiff_t ssize() const YY_NOEXCEPT {
- return std::ptrdiff_t(size());
- }
-
/// Iterator on top of the stack (going downwards).
const_iterator begin() const YY_NOEXCEPT {
- return seq_.rbegin();
+ return seq_.begin();
}
/// Bottom of the stack.
const_iterator end() const YY_NOEXCEPT {
- return seq_.rend();
+ return seq_.end();
}
/// Present a slice of the top of a stack.
@@ -2862,8 +3627,12 @@ private:
};
private:
+#if YY_CPLUSPLUS < 201103L
+ /// Non copyable.
stack(const stack&);
+ /// Non copyable.
stack& operator=(const stack&);
+#endif
/// The wrapped container.
S seq_;
};
@@ -2893,17 +3662,11 @@ private:
/// Pop \a n symbols from the stack.
void yypop_(int n = 1);
- /// Some specific tokens.
- static const token_number_type yy_error_token_ = 1;
- static const token_number_type yy_undef_token_ = 2;
-
/// Constants.
enum {
- yyeof_ = 0,
- yylast_ = 951, ///< Last index in yytable_.
- yynnts_ = 142, ///< Number of nonterminal symbols.
- yyfinal_ = 8, ///< Termination state number.
- yyntokens_ = 121 ///< Number of tokens.
+ yylast_ = 1306, ///< Last index in yytable_.
+ yynnts_ = 148, ///< Number of nonterminal symbols.
+ yyfinal_ = 11 ///< Termination state number.
};
@@ -2912,475 +3675,244 @@ private:
CNode* cst;
};
-inline PipelineParserGen::token_number_type PipelineParserGen::yytranslate_(int t) {
- return static_cast<token_number_type>(t);
+inline PipelineParserGen::symbol_kind_type PipelineParserGen::yytranslate_(int t) {
+ return static_cast<symbol_kind_type>(t);
}
// basic_symbol.
-#if 201103L <= YY_CPLUSPLUS
-template <typename Base>
-PipelineParserGen::basic_symbol<Base>::basic_symbol(basic_symbol&& that)
- : Base(std::move(that)), value(), location(std::move(that.location)) {
- switch (this->type_get()) {
- case 99: // "BinData"
- value.move<BSONBinData>(std::move(that.value));
- break;
-
- case 106: // "Code"
- value.move<BSONCode>(std::move(that.value));
- break;
-
- case 108: // "CodeWScope"
- value.move<BSONCodeWScope>(std::move(that.value));
- break;
-
- case 105: // "dbPointer"
- value.move<BSONDBRef>(std::move(that.value));
- break;
-
- case 104: // "regex"
- value.move<BSONRegEx>(std::move(that.value));
- break;
-
- case 107: // "Symbol"
- value.move<BSONSymbol>(std::move(that.value));
- break;
-
- case 135: // dbPointer
- case 136: // javascript
- case 137: // symbol
- case 138: // javascriptWScope
- case 139: // int
- case 140: // timestamp
- case 141: // long
- case 142: // double
- case 143: // decimal
- case 144: // minKey
- case 145: // maxKey
- case 146: // value
- case 147: // string
- case 148: // fieldPath
- case 149: // binary
- case 150: // undefined
- case 151: // objectId
- case 152: // bool
- case 153: // date
- case 154: // null
- case 155: // regex
- case 156: // simpleValue
- case 157: // compoundValue
- case 158: // valueArray
- case 159: // valueObject
- case 160: // valueFields
- case 161: // variable
- case 162: // pipeline
- case 163: // stageList
- case 164: // stage
- case 165: // inhibitOptimization
- case 166: // unionWith
- case 167: // skip
- case 168: // limit
- case 169: // project
- case 170: // sample
- case 171: // projectFields
- case 172: // projection
- case 173: // num
- case 174: // expression
- case 175: // compoundExpression
- case 176: // exprFixedTwoArg
- case 177: // expressionArray
- case 178: // expressionObject
- case 179: // expressionFields
- case 180: // maths
- case 181: // add
- case 182: // atan2
- case 183: // boolExps
- case 184: // and
- case 185: // or
- case 186: // not
- case 187: // literalEscapes
- case 188: // const
- case 189: // literal
- case 190: // stringExps
- case 191: // concat
- case 192: // dateFromString
- case 193: // dateToString
- case 194: // indexOfBytes
- case 195: // indexOfCP
- case 196: // ltrim
- case 197: // regexFind
- case 198: // regexFindAll
- case 199: // regexMatch
- case 200: // regexArgs
- case 201: // replaceOne
- case 202: // replaceAll
- case 203: // rtrim
- case 204: // split
- case 205: // strLenBytes
- case 206: // strLenCP
- case 207: // strcasecmp
- case 208: // substr
- case 209: // substrBytes
- case 210: // substrCP
- case 211: // toLower
- case 212: // toUpper
- case 213: // trim
- case 214: // compExprs
- case 215: // cmp
- case 216: // eq
- case 217: // gt
- case 218: // gte
- case 219: // lt
- case 220: // lte
- case 221: // ne
- case 222: // typeExpression
- case 223: // convert
- case 224: // toBool
- case 225: // toDate
- case 226: // toDecimal
- case 227: // toDouble
- case 228: // toInt
- case 229: // toLong
- case 230: // toObjectId
- case 231: // toString
- case 232: // type
- case 233: // abs
- case 234: // ceil
- case 235: // divide
- case 236: // exponent
- case 237: // floor
- case 238: // ln
- case 239: // log
- case 240: // logten
- case 241: // mod
- case 242: // multiply
- case 243: // pow
- case 244: // round
- case 245: // sqrt
- case 246: // subtract
- case 247: // trunc
- case 257: // matchExpression
- case 258: // filterFields
- case 259: // filterVal
- value.move<CNode>(std::move(that.value));
- break;
-
- case 122: // projectionFieldname
- case 123: // expressionFieldname
- case 124: // stageAsUserFieldname
- case 125: // filterFieldname
- case 126: // argAsUserFieldname
- case 127: // aggExprAsUserFieldname
- case 128: // invariableUserFieldname
- case 129: // idAsUserFieldname
- case 130: // valueFieldname
- value.move<CNode::Fieldname>(std::move(that.value));
- break;
-
- case 102: // "Date"
- value.move<Date_t>(std::move(that.value));
- break;
-
- case 112: // "non-zero decimal"
- value.move<Decimal128>(std::move(that.value));
- break;
-
- case 101: // "ObjectID"
- value.move<OID>(std::move(that.value));
- break;
-
- case 113: // "Timestamp"
- value.move<Timestamp>(std::move(that.value));
- break;
-
- case 115: // "maxKey"
- value.move<UserMaxKey>(std::move(that.value));
- break;
-
- case 114: // "minKey"
- value.move<UserMinKey>(std::move(that.value));
- break;
-
- case 103: // "null"
- value.move<UserNull>(std::move(that.value));
- break;
-
- case 100: // "undefined"
- value.move<UserUndefined>(std::move(that.value));
- break;
-
- case 111: // "non-zero double"
- value.move<double>(std::move(that.value));
- break;
-
- case 109: // "non-zero integer"
- value.move<int>(std::move(that.value));
- break;
-
- case 110: // "non-zero long"
- value.move<long long>(std::move(that.value));
- break;
-
- case 131: // projectField
- case 132: // expressionField
- case 133: // valueField
- case 134: // filterField
- case 248: // onErrorArg
- case 249: // onNullArg
- case 250: // formatArg
- case 251: // timezoneArg
- case 252: // charsArg
- case 253: // optionsArg
- value.move<std::pair<CNode::Fieldname, CNode>>(std::move(that.value));
- break;
-
- case 97: // "fieldname"
- case 98: // "string"
- case 116: // "$-prefixed string"
- case 117: // "$$-prefixed string"
- case 118: // "$-prefixed fieldname"
- value.move<std::string>(std::move(that.value));
- break;
-
- case 254: // expressions
- case 255: // values
- case 256: // exprZeroToTwo
- value.move<std::vector<CNode>>(std::move(that.value));
- break;
-
- default:
- break;
- }
-}
-#endif
-
template <typename Base>
PipelineParserGen::basic_symbol<Base>::basic_symbol(const basic_symbol& that)
: Base(that), value(), location(that.location) {
- switch (this->type_get()) {
- case 99: // "BinData"
+ switch (this->kind()) {
+ case symbol_kind::S_BINARY: // "BinData"
value.copy<BSONBinData>(YY_MOVE(that.value));
break;
- case 106: // "Code"
+ case symbol_kind::S_JAVASCRIPT: // "Code"
value.copy<BSONCode>(YY_MOVE(that.value));
break;
- case 108: // "CodeWScope"
+ case symbol_kind::S_JAVASCRIPT_W_SCOPE: // "CodeWScope"
value.copy<BSONCodeWScope>(YY_MOVE(that.value));
break;
- case 105: // "dbPointer"
+ case symbol_kind::S_DB_POINTER: // "dbPointer"
value.copy<BSONDBRef>(YY_MOVE(that.value));
break;
- case 104: // "regex"
+ case symbol_kind::S_REGEX: // "regex"
value.copy<BSONRegEx>(YY_MOVE(that.value));
break;
- case 107: // "Symbol"
+ case symbol_kind::S_SYMBOL: // "Symbol"
value.copy<BSONSymbol>(YY_MOVE(that.value));
break;
- case 135: // dbPointer
- case 136: // javascript
- case 137: // symbol
- case 138: // javascriptWScope
- case 139: // int
- case 140: // timestamp
- case 141: // long
- case 142: // double
- case 143: // decimal
- case 144: // minKey
- case 145: // maxKey
- case 146: // value
- case 147: // string
- case 148: // fieldPath
- case 149: // binary
- case 150: // undefined
- case 151: // objectId
- case 152: // bool
- case 153: // date
- case 154: // null
- case 155: // regex
- case 156: // simpleValue
- case 157: // compoundValue
- case 158: // valueArray
- case 159: // valueObject
- case 160: // valueFields
- case 161: // variable
- case 162: // pipeline
- case 163: // stageList
- case 164: // stage
- case 165: // inhibitOptimization
- case 166: // unionWith
- case 167: // skip
- case 168: // limit
- case 169: // project
- case 170: // sample
- case 171: // projectFields
- case 172: // projection
- case 173: // num
- case 174: // expression
- case 175: // compoundExpression
- case 176: // exprFixedTwoArg
- case 177: // expressionArray
- case 178: // expressionObject
- case 179: // expressionFields
- case 180: // maths
- case 181: // add
- case 182: // atan2
- case 183: // boolExps
- case 184: // and
- case 185: // or
- case 186: // not
- case 187: // literalEscapes
- case 188: // const
- case 189: // literal
- case 190: // stringExps
- case 191: // concat
- case 192: // dateFromString
- case 193: // dateToString
- case 194: // indexOfBytes
- case 195: // indexOfCP
- case 196: // ltrim
- case 197: // regexFind
- case 198: // regexFindAll
- case 199: // regexMatch
- case 200: // regexArgs
- case 201: // replaceOne
- case 202: // replaceAll
- case 203: // rtrim
- case 204: // split
- case 205: // strLenBytes
- case 206: // strLenCP
- case 207: // strcasecmp
- case 208: // substr
- case 209: // substrBytes
- case 210: // substrCP
- case 211: // toLower
- case 212: // toUpper
- case 213: // trim
- case 214: // compExprs
- case 215: // cmp
- case 216: // eq
- case 217: // gt
- case 218: // gte
- case 219: // lt
- case 220: // lte
- case 221: // ne
- case 222: // typeExpression
- case 223: // convert
- case 224: // toBool
- case 225: // toDate
- case 226: // toDecimal
- case 227: // toDouble
- case 228: // toInt
- case 229: // toLong
- case 230: // toObjectId
- case 231: // toString
- case 232: // type
- case 233: // abs
- case 234: // ceil
- case 235: // divide
- case 236: // exponent
- case 237: // floor
- case 238: // ln
- case 239: // log
- case 240: // logten
- case 241: // mod
- case 242: // multiply
- case 243: // pow
- case 244: // round
- case 245: // sqrt
- case 246: // subtract
- case 247: // trunc
- case 257: // matchExpression
- case 258: // filterFields
- case 259: // filterVal
+ case symbol_kind::S_dbPointer: // dbPointer
+ case symbol_kind::S_javascript: // javascript
+ case symbol_kind::S_symbol: // symbol
+ case symbol_kind::S_javascriptWScope: // javascriptWScope
+ case symbol_kind::S_int: // int
+ case symbol_kind::S_timestamp: // timestamp
+ case symbol_kind::S_long: // long
+ case symbol_kind::S_double: // double
+ case symbol_kind::S_decimal: // decimal
+ case symbol_kind::S_minKey: // minKey
+ case symbol_kind::S_maxKey: // maxKey
+ case symbol_kind::S_value: // value
+ case symbol_kind::S_string: // string
+ case symbol_kind::S_fieldPath: // fieldPath
+ case symbol_kind::S_binary: // binary
+ case symbol_kind::S_undefined: // undefined
+ case symbol_kind::S_objectId: // objectId
+ case symbol_kind::S_bool: // bool
+ case symbol_kind::S_date: // date
+ case symbol_kind::S_null: // null
+ case symbol_kind::S_regex: // regex
+ case symbol_kind::S_simpleValue: // simpleValue
+ case symbol_kind::S_compoundValue: // compoundValue
+ case symbol_kind::S_valueArray: // valueArray
+ case symbol_kind::S_valueObject: // valueObject
+ case symbol_kind::S_valueFields: // valueFields
+ case symbol_kind::S_variable: // variable
+ case symbol_kind::S_pipeline: // pipeline
+ case symbol_kind::S_stageList: // stageList
+ case symbol_kind::S_stage: // stage
+ case symbol_kind::S_inhibitOptimization: // inhibitOptimization
+ case symbol_kind::S_unionWith: // unionWith
+ case symbol_kind::S_skip: // skip
+ case symbol_kind::S_limit: // limit
+ case symbol_kind::S_project: // project
+ case symbol_kind::S_sample: // sample
+ case symbol_kind::S_projectFields: // projectFields
+ case symbol_kind::S_projection: // projection
+ case symbol_kind::S_num: // num
+ case symbol_kind::S_expression: // expression
+ case symbol_kind::S_compoundExpression: // compoundExpression
+ case symbol_kind::S_exprFixedTwoArg: // exprFixedTwoArg
+ case symbol_kind::S_expressionArray: // expressionArray
+ case symbol_kind::S_expressionObject: // expressionObject
+ case symbol_kind::S_expressionFields: // expressionFields
+ case symbol_kind::S_maths: // maths
+ case symbol_kind::S_add: // add
+ case symbol_kind::S_atan2: // atan2
+ case symbol_kind::S_boolExps: // boolExps
+ case symbol_kind::S_and: // and
+ case symbol_kind::S_or: // or
+ case symbol_kind::S_not: // not
+ case symbol_kind::S_literalEscapes: // literalEscapes
+ case symbol_kind::S_const: // const
+ case symbol_kind::S_literal: // literal
+ case symbol_kind::S_stringExps: // stringExps
+ case symbol_kind::S_concat: // concat
+ case symbol_kind::S_dateFromString: // dateFromString
+ case symbol_kind::S_dateToString: // dateToString
+ case symbol_kind::S_indexOfBytes: // indexOfBytes
+ case symbol_kind::S_indexOfCP: // indexOfCP
+ case symbol_kind::S_ltrim: // ltrim
+ case symbol_kind::S_regexFind: // regexFind
+ case symbol_kind::S_regexFindAll: // regexFindAll
+ case symbol_kind::S_regexMatch: // regexMatch
+ case symbol_kind::S_regexArgs: // regexArgs
+ case symbol_kind::S_replaceOne: // replaceOne
+ case symbol_kind::S_replaceAll: // replaceAll
+ case symbol_kind::S_rtrim: // rtrim
+ case symbol_kind::S_split: // split
+ case symbol_kind::S_strLenBytes: // strLenBytes
+ case symbol_kind::S_strLenCP: // strLenCP
+ case symbol_kind::S_strcasecmp: // strcasecmp
+ case symbol_kind::S_substr: // substr
+ case symbol_kind::S_substrBytes: // substrBytes
+ case symbol_kind::S_substrCP: // substrCP
+ case symbol_kind::S_toLower: // toLower
+ case symbol_kind::S_toUpper: // toUpper
+ case symbol_kind::S_trim: // trim
+ case symbol_kind::S_compExprs: // compExprs
+ case symbol_kind::S_cmp: // cmp
+ case symbol_kind::S_eq: // eq
+ case symbol_kind::S_gt: // gt
+ case symbol_kind::S_gte: // gte
+ case symbol_kind::S_lt: // lt
+ case symbol_kind::S_lte: // lte
+ case symbol_kind::S_ne: // ne
+ case symbol_kind::S_typeExpression: // typeExpression
+ case symbol_kind::S_convert: // convert
+ case symbol_kind::S_toBool: // toBool
+ case symbol_kind::S_toDate: // toDate
+ case symbol_kind::S_toDecimal: // toDecimal
+ case symbol_kind::S_toDouble: // toDouble
+ case symbol_kind::S_toInt: // toInt
+ case symbol_kind::S_toLong: // toLong
+ case symbol_kind::S_toObjectId: // toObjectId
+ case symbol_kind::S_toString: // toString
+ case symbol_kind::S_type: // type
+ case symbol_kind::S_abs: // abs
+ case symbol_kind::S_ceil: // ceil
+ case symbol_kind::S_divide: // divide
+ case symbol_kind::S_exponent: // exponent
+ case symbol_kind::S_floor: // floor
+ case symbol_kind::S_ln: // ln
+ case symbol_kind::S_log: // log
+ case symbol_kind::S_logten: // logten
+ case symbol_kind::S_mod: // mod
+ case symbol_kind::S_multiply: // multiply
+ case symbol_kind::S_pow: // pow
+ case symbol_kind::S_round: // round
+ case symbol_kind::S_sqrt: // sqrt
+ case symbol_kind::S_subtract: // subtract
+ case symbol_kind::S_trunc: // trunc
+ case symbol_kind::S_matchExpression: // matchExpression
+ case symbol_kind::S_filterFields: // filterFields
+ case symbol_kind::S_filterVal: // filterVal
+ case symbol_kind::S_sortSpecs: // sortSpecs
+ case symbol_kind::S_specList: // specList
+ case symbol_kind::S_metaSort: // metaSort
+ case symbol_kind::S_oneOrNegOne: // oneOrNegOne
+ case symbol_kind::S_metaSortKeyword: // metaSortKeyword
value.copy<CNode>(YY_MOVE(that.value));
break;
- case 122: // projectionFieldname
- case 123: // expressionFieldname
- case 124: // stageAsUserFieldname
- case 125: // filterFieldname
- case 126: // argAsUserFieldname
- case 127: // aggExprAsUserFieldname
- case 128: // invariableUserFieldname
- case 129: // idAsUserFieldname
- case 130: // valueFieldname
+ case symbol_kind::S_projectionFieldname: // projectionFieldname
+ case symbol_kind::S_expressionFieldname: // expressionFieldname
+ case symbol_kind::S_stageAsUserFieldname: // stageAsUserFieldname
+ case symbol_kind::S_filterFieldname: // filterFieldname
+ case symbol_kind::S_argAsUserFieldname: // argAsUserFieldname
+ case symbol_kind::S_aggExprAsUserFieldname: // aggExprAsUserFieldname
+ case symbol_kind::S_invariableUserFieldname: // invariableUserFieldname
+ case symbol_kind::S_idAsUserFieldname: // idAsUserFieldname
+ case symbol_kind::S_valueFieldname: // valueFieldname
value.copy<CNode::Fieldname>(YY_MOVE(that.value));
break;
- case 102: // "Date"
+ case symbol_kind::S_DATE_LITERAL: // "Date"
value.copy<Date_t>(YY_MOVE(that.value));
break;
- case 112: // "non-zero decimal"
+ case symbol_kind::S_DECIMAL_OTHER: // "arbitrary decimal"
value.copy<Decimal128>(YY_MOVE(that.value));
break;
- case 101: // "ObjectID"
+ case symbol_kind::S_OBJECT_ID: // "ObjectID"
value.copy<OID>(YY_MOVE(that.value));
break;
- case 113: // "Timestamp"
+ case symbol_kind::S_TIMESTAMP: // "Timestamp"
value.copy<Timestamp>(YY_MOVE(that.value));
break;
- case 115: // "maxKey"
+ case symbol_kind::S_MAX_KEY: // "maxKey"
value.copy<UserMaxKey>(YY_MOVE(that.value));
break;
- case 114: // "minKey"
+ case symbol_kind::S_MIN_KEY: // "minKey"
value.copy<UserMinKey>(YY_MOVE(that.value));
break;
- case 103: // "null"
+ case symbol_kind::S_JSNULL: // "null"
value.copy<UserNull>(YY_MOVE(that.value));
break;
- case 100: // "undefined"
+ case symbol_kind::S_UNDEFINED: // "undefined"
value.copy<UserUndefined>(YY_MOVE(that.value));
break;
- case 111: // "non-zero double"
+ case symbol_kind::S_DOUBLE_OTHER: // "arbitrary double"
value.copy<double>(YY_MOVE(that.value));
break;
- case 109: // "non-zero integer"
+ case symbol_kind::S_INT_OTHER: // "arbitrary integer"
value.copy<int>(YY_MOVE(that.value));
break;
- case 110: // "non-zero long"
+ case symbol_kind::S_LONG_OTHER: // "arbitrary long"
value.copy<long long>(YY_MOVE(that.value));
break;
- case 131: // projectField
- case 132: // expressionField
- case 133: // valueField
- case 134: // filterField
- case 248: // onErrorArg
- case 249: // onNullArg
- case 250: // formatArg
- case 251: // timezoneArg
- case 252: // charsArg
- case 253: // optionsArg
+ case symbol_kind::S_projectField: // projectField
+ case symbol_kind::S_expressionField: // expressionField
+ case symbol_kind::S_valueField: // valueField
+ case symbol_kind::S_filterField: // filterField
+ case symbol_kind::S_onErrorArg: // onErrorArg
+ case symbol_kind::S_onNullArg: // onNullArg
+ case symbol_kind::S_formatArg: // formatArg
+ case symbol_kind::S_timezoneArg: // timezoneArg
+ case symbol_kind::S_charsArg: // charsArg
+ case symbol_kind::S_optionsArg: // optionsArg
+ case symbol_kind::S_sortSpec: // sortSpec
value.copy<std::pair<CNode::Fieldname, CNode>>(YY_MOVE(that.value));
break;
- case 97: // "fieldname"
- case 98: // "string"
- case 116: // "$-prefixed string"
- case 117: // "$$-prefixed string"
- case 118: // "$-prefixed fieldname"
+ case symbol_kind::S_FIELDNAME: // "fieldname"
+ case symbol_kind::S_STRING: // "string"
+ case symbol_kind::S_DOLLAR_STRING: // "$-prefixed string"
+ case symbol_kind::S_DOLLAR_DOLLAR_STRING: // "$$-prefixed string"
+ case symbol_kind::S_DOLLAR_PREF_FIELDNAME: // "$-prefixed fieldname"
value.copy<std::string>(YY_MOVE(that.value));
break;
- case 254: // expressions
- case 255: // values
- case 256: // exprZeroToTwo
+ case symbol_kind::S_expressions: // expressions
+ case symbol_kind::S_values: // values
+ case symbol_kind::S_exprZeroToTwo: // exprZeroToTwo
value.copy<std::vector<CNode>>(YY_MOVE(that.value));
break;
@@ -3391,237 +3923,249 @@ PipelineParserGen::basic_symbol<Base>::basic_symbol(const basic_symbol& that)
template <typename Base>
+PipelineParserGen::symbol_kind_type PipelineParserGen::basic_symbol<Base>::type_get() const
+ YY_NOEXCEPT {
+ return this->kind();
+}
+
+template <typename Base>
bool PipelineParserGen::basic_symbol<Base>::empty() const YY_NOEXCEPT {
- return Base::type_get() == empty_symbol;
+ return this->kind() == symbol_kind::S_YYEMPTY;
}
template <typename Base>
void PipelineParserGen::basic_symbol<Base>::move(basic_symbol& s) {
super_type::move(s);
- switch (this->type_get()) {
- case 99: // "BinData"
+ switch (this->kind()) {
+ case symbol_kind::S_BINARY: // "BinData"
value.move<BSONBinData>(YY_MOVE(s.value));
break;
- case 106: // "Code"
+ case symbol_kind::S_JAVASCRIPT: // "Code"
value.move<BSONCode>(YY_MOVE(s.value));
break;
- case 108: // "CodeWScope"
+ case symbol_kind::S_JAVASCRIPT_W_SCOPE: // "CodeWScope"
value.move<BSONCodeWScope>(YY_MOVE(s.value));
break;
- case 105: // "dbPointer"
+ case symbol_kind::S_DB_POINTER: // "dbPointer"
value.move<BSONDBRef>(YY_MOVE(s.value));
break;
- case 104: // "regex"
+ case symbol_kind::S_REGEX: // "regex"
value.move<BSONRegEx>(YY_MOVE(s.value));
break;
- case 107: // "Symbol"
+ case symbol_kind::S_SYMBOL: // "Symbol"
value.move<BSONSymbol>(YY_MOVE(s.value));
break;
- case 135: // dbPointer
- case 136: // javascript
- case 137: // symbol
- case 138: // javascriptWScope
- case 139: // int
- case 140: // timestamp
- case 141: // long
- case 142: // double
- case 143: // decimal
- case 144: // minKey
- case 145: // maxKey
- case 146: // value
- case 147: // string
- case 148: // fieldPath
- case 149: // binary
- case 150: // undefined
- case 151: // objectId
- case 152: // bool
- case 153: // date
- case 154: // null
- case 155: // regex
- case 156: // simpleValue
- case 157: // compoundValue
- case 158: // valueArray
- case 159: // valueObject
- case 160: // valueFields
- case 161: // variable
- case 162: // pipeline
- case 163: // stageList
- case 164: // stage
- case 165: // inhibitOptimization
- case 166: // unionWith
- case 167: // skip
- case 168: // limit
- case 169: // project
- case 170: // sample
- case 171: // projectFields
- case 172: // projection
- case 173: // num
- case 174: // expression
- case 175: // compoundExpression
- case 176: // exprFixedTwoArg
- case 177: // expressionArray
- case 178: // expressionObject
- case 179: // expressionFields
- case 180: // maths
- case 181: // add
- case 182: // atan2
- case 183: // boolExps
- case 184: // and
- case 185: // or
- case 186: // not
- case 187: // literalEscapes
- case 188: // const
- case 189: // literal
- case 190: // stringExps
- case 191: // concat
- case 192: // dateFromString
- case 193: // dateToString
- case 194: // indexOfBytes
- case 195: // indexOfCP
- case 196: // ltrim
- case 197: // regexFind
- case 198: // regexFindAll
- case 199: // regexMatch
- case 200: // regexArgs
- case 201: // replaceOne
- case 202: // replaceAll
- case 203: // rtrim
- case 204: // split
- case 205: // strLenBytes
- case 206: // strLenCP
- case 207: // strcasecmp
- case 208: // substr
- case 209: // substrBytes
- case 210: // substrCP
- case 211: // toLower
- case 212: // toUpper
- case 213: // trim
- case 214: // compExprs
- case 215: // cmp
- case 216: // eq
- case 217: // gt
- case 218: // gte
- case 219: // lt
- case 220: // lte
- case 221: // ne
- case 222: // typeExpression
- case 223: // convert
- case 224: // toBool
- case 225: // toDate
- case 226: // toDecimal
- case 227: // toDouble
- case 228: // toInt
- case 229: // toLong
- case 230: // toObjectId
- case 231: // toString
- case 232: // type
- case 233: // abs
- case 234: // ceil
- case 235: // divide
- case 236: // exponent
- case 237: // floor
- case 238: // ln
- case 239: // log
- case 240: // logten
- case 241: // mod
- case 242: // multiply
- case 243: // pow
- case 244: // round
- case 245: // sqrt
- case 246: // subtract
- case 247: // trunc
- case 257: // matchExpression
- case 258: // filterFields
- case 259: // filterVal
+ case symbol_kind::S_dbPointer: // dbPointer
+ case symbol_kind::S_javascript: // javascript
+ case symbol_kind::S_symbol: // symbol
+ case symbol_kind::S_javascriptWScope: // javascriptWScope
+ case symbol_kind::S_int: // int
+ case symbol_kind::S_timestamp: // timestamp
+ case symbol_kind::S_long: // long
+ case symbol_kind::S_double: // double
+ case symbol_kind::S_decimal: // decimal
+ case symbol_kind::S_minKey: // minKey
+ case symbol_kind::S_maxKey: // maxKey
+ case symbol_kind::S_value: // value
+ case symbol_kind::S_string: // string
+ case symbol_kind::S_fieldPath: // fieldPath
+ case symbol_kind::S_binary: // binary
+ case symbol_kind::S_undefined: // undefined
+ case symbol_kind::S_objectId: // objectId
+ case symbol_kind::S_bool: // bool
+ case symbol_kind::S_date: // date
+ case symbol_kind::S_null: // null
+ case symbol_kind::S_regex: // regex
+ case symbol_kind::S_simpleValue: // simpleValue
+ case symbol_kind::S_compoundValue: // compoundValue
+ case symbol_kind::S_valueArray: // valueArray
+ case symbol_kind::S_valueObject: // valueObject
+ case symbol_kind::S_valueFields: // valueFields
+ case symbol_kind::S_variable: // variable
+ case symbol_kind::S_pipeline: // pipeline
+ case symbol_kind::S_stageList: // stageList
+ case symbol_kind::S_stage: // stage
+ case symbol_kind::S_inhibitOptimization: // inhibitOptimization
+ case symbol_kind::S_unionWith: // unionWith
+ case symbol_kind::S_skip: // skip
+ case symbol_kind::S_limit: // limit
+ case symbol_kind::S_project: // project
+ case symbol_kind::S_sample: // sample
+ case symbol_kind::S_projectFields: // projectFields
+ case symbol_kind::S_projection: // projection
+ case symbol_kind::S_num: // num
+ case symbol_kind::S_expression: // expression
+ case symbol_kind::S_compoundExpression: // compoundExpression
+ case symbol_kind::S_exprFixedTwoArg: // exprFixedTwoArg
+ case symbol_kind::S_expressionArray: // expressionArray
+ case symbol_kind::S_expressionObject: // expressionObject
+ case symbol_kind::S_expressionFields: // expressionFields
+ case symbol_kind::S_maths: // maths
+ case symbol_kind::S_add: // add
+ case symbol_kind::S_atan2: // atan2
+ case symbol_kind::S_boolExps: // boolExps
+ case symbol_kind::S_and: // and
+ case symbol_kind::S_or: // or
+ case symbol_kind::S_not: // not
+ case symbol_kind::S_literalEscapes: // literalEscapes
+ case symbol_kind::S_const: // const
+ case symbol_kind::S_literal: // literal
+ case symbol_kind::S_stringExps: // stringExps
+ case symbol_kind::S_concat: // concat
+ case symbol_kind::S_dateFromString: // dateFromString
+ case symbol_kind::S_dateToString: // dateToString
+ case symbol_kind::S_indexOfBytes: // indexOfBytes
+ case symbol_kind::S_indexOfCP: // indexOfCP
+ case symbol_kind::S_ltrim: // ltrim
+ case symbol_kind::S_regexFind: // regexFind
+ case symbol_kind::S_regexFindAll: // regexFindAll
+ case symbol_kind::S_regexMatch: // regexMatch
+ case symbol_kind::S_regexArgs: // regexArgs
+ case symbol_kind::S_replaceOne: // replaceOne
+ case symbol_kind::S_replaceAll: // replaceAll
+ case symbol_kind::S_rtrim: // rtrim
+ case symbol_kind::S_split: // split
+ case symbol_kind::S_strLenBytes: // strLenBytes
+ case symbol_kind::S_strLenCP: // strLenCP
+ case symbol_kind::S_strcasecmp: // strcasecmp
+ case symbol_kind::S_substr: // substr
+ case symbol_kind::S_substrBytes: // substrBytes
+ case symbol_kind::S_substrCP: // substrCP
+ case symbol_kind::S_toLower: // toLower
+ case symbol_kind::S_toUpper: // toUpper
+ case symbol_kind::S_trim: // trim
+ case symbol_kind::S_compExprs: // compExprs
+ case symbol_kind::S_cmp: // cmp
+ case symbol_kind::S_eq: // eq
+ case symbol_kind::S_gt: // gt
+ case symbol_kind::S_gte: // gte
+ case symbol_kind::S_lt: // lt
+ case symbol_kind::S_lte: // lte
+ case symbol_kind::S_ne: // ne
+ case symbol_kind::S_typeExpression: // typeExpression
+ case symbol_kind::S_convert: // convert
+ case symbol_kind::S_toBool: // toBool
+ case symbol_kind::S_toDate: // toDate
+ case symbol_kind::S_toDecimal: // toDecimal
+ case symbol_kind::S_toDouble: // toDouble
+ case symbol_kind::S_toInt: // toInt
+ case symbol_kind::S_toLong: // toLong
+ case symbol_kind::S_toObjectId: // toObjectId
+ case symbol_kind::S_toString: // toString
+ case symbol_kind::S_type: // type
+ case symbol_kind::S_abs: // abs
+ case symbol_kind::S_ceil: // ceil
+ case symbol_kind::S_divide: // divide
+ case symbol_kind::S_exponent: // exponent
+ case symbol_kind::S_floor: // floor
+ case symbol_kind::S_ln: // ln
+ case symbol_kind::S_log: // log
+ case symbol_kind::S_logten: // logten
+ case symbol_kind::S_mod: // mod
+ case symbol_kind::S_multiply: // multiply
+ case symbol_kind::S_pow: // pow
+ case symbol_kind::S_round: // round
+ case symbol_kind::S_sqrt: // sqrt
+ case symbol_kind::S_subtract: // subtract
+ case symbol_kind::S_trunc: // trunc
+ case symbol_kind::S_matchExpression: // matchExpression
+ case symbol_kind::S_filterFields: // filterFields
+ case symbol_kind::S_filterVal: // filterVal
+ case symbol_kind::S_sortSpecs: // sortSpecs
+ case symbol_kind::S_specList: // specList
+ case symbol_kind::S_metaSort: // metaSort
+ case symbol_kind::S_oneOrNegOne: // oneOrNegOne
+ case symbol_kind::S_metaSortKeyword: // metaSortKeyword
value.move<CNode>(YY_MOVE(s.value));
break;
- case 122: // projectionFieldname
- case 123: // expressionFieldname
- case 124: // stageAsUserFieldname
- case 125: // filterFieldname
- case 126: // argAsUserFieldname
- case 127: // aggExprAsUserFieldname
- case 128: // invariableUserFieldname
- case 129: // idAsUserFieldname
- case 130: // valueFieldname
+ case symbol_kind::S_projectionFieldname: // projectionFieldname
+ case symbol_kind::S_expressionFieldname: // expressionFieldname
+ case symbol_kind::S_stageAsUserFieldname: // stageAsUserFieldname
+ case symbol_kind::S_filterFieldname: // filterFieldname
+ case symbol_kind::S_argAsUserFieldname: // argAsUserFieldname
+ case symbol_kind::S_aggExprAsUserFieldname: // aggExprAsUserFieldname
+ case symbol_kind::S_invariableUserFieldname: // invariableUserFieldname
+ case symbol_kind::S_idAsUserFieldname: // idAsUserFieldname
+ case symbol_kind::S_valueFieldname: // valueFieldname
value.move<CNode::Fieldname>(YY_MOVE(s.value));
break;
- case 102: // "Date"
+ case symbol_kind::S_DATE_LITERAL: // "Date"
value.move<Date_t>(YY_MOVE(s.value));
break;
- case 112: // "non-zero decimal"
+ case symbol_kind::S_DECIMAL_OTHER: // "arbitrary decimal"
value.move<Decimal128>(YY_MOVE(s.value));
break;
- case 101: // "ObjectID"
+ case symbol_kind::S_OBJECT_ID: // "ObjectID"
value.move<OID>(YY_MOVE(s.value));
break;
- case 113: // "Timestamp"
+ case symbol_kind::S_TIMESTAMP: // "Timestamp"
value.move<Timestamp>(YY_MOVE(s.value));
break;
- case 115: // "maxKey"
+ case symbol_kind::S_MAX_KEY: // "maxKey"
value.move<UserMaxKey>(YY_MOVE(s.value));
break;
- case 114: // "minKey"
+ case symbol_kind::S_MIN_KEY: // "minKey"
value.move<UserMinKey>(YY_MOVE(s.value));
break;
- case 103: // "null"
+ case symbol_kind::S_JSNULL: // "null"
value.move<UserNull>(YY_MOVE(s.value));
break;
- case 100: // "undefined"
+ case symbol_kind::S_UNDEFINED: // "undefined"
value.move<UserUndefined>(YY_MOVE(s.value));
break;
- case 111: // "non-zero double"
+ case symbol_kind::S_DOUBLE_OTHER: // "arbitrary double"
value.move<double>(YY_MOVE(s.value));
break;
- case 109: // "non-zero integer"
+ case symbol_kind::S_INT_OTHER: // "arbitrary integer"
value.move<int>(YY_MOVE(s.value));
break;
- case 110: // "non-zero long"
+ case symbol_kind::S_LONG_OTHER: // "arbitrary long"
value.move<long long>(YY_MOVE(s.value));
break;
- case 131: // projectField
- case 132: // expressionField
- case 133: // valueField
- case 134: // filterField
- case 248: // onErrorArg
- case 249: // onNullArg
- case 250: // formatArg
- case 251: // timezoneArg
- case 252: // charsArg
- case 253: // optionsArg
+ case symbol_kind::S_projectField: // projectField
+ case symbol_kind::S_expressionField: // expressionField
+ case symbol_kind::S_valueField: // valueField
+ case symbol_kind::S_filterField: // filterField
+ case symbol_kind::S_onErrorArg: // onErrorArg
+ case symbol_kind::S_onNullArg: // onNullArg
+ case symbol_kind::S_formatArg: // formatArg
+ case symbol_kind::S_timezoneArg: // timezoneArg
+ case symbol_kind::S_charsArg: // charsArg
+ case symbol_kind::S_optionsArg: // optionsArg
+ case symbol_kind::S_sortSpec: // sortSpec
value.move<std::pair<CNode::Fieldname, CNode>>(YY_MOVE(s.value));
break;
- case 97: // "fieldname"
- case 98: // "string"
- case 116: // "$-prefixed string"
- case 117: // "$$-prefixed string"
- case 118: // "$-prefixed fieldname"
+ case symbol_kind::S_FIELDNAME: // "fieldname"
+ case symbol_kind::S_STRING: // "string"
+ case symbol_kind::S_DOLLAR_STRING: // "$-prefixed string"
+ case symbol_kind::S_DOLLAR_DOLLAR_STRING: // "$$-prefixed string"
+ case symbol_kind::S_DOLLAR_PREF_FIELDNAME: // "$-prefixed fieldname"
value.move<std::string>(YY_MOVE(s.value));
break;
- case 254: // expressions
- case 255: // values
- case 256: // exprZeroToTwo
+ case symbol_kind::S_expressions: // expressions
+ case symbol_kind::S_values: // values
+ case symbol_kind::S_exprZeroToTwo: // exprZeroToTwo
value.move<std::vector<CNode>>(YY_MOVE(s.value));
break;
@@ -3632,35 +4176,40 @@ void PipelineParserGen::basic_symbol<Base>::move(basic_symbol& s) {
location = YY_MOVE(s.location);
}
-// by_type.
-inline PipelineParserGen::by_type::by_type() : type(empty_symbol) {}
+// by_kind.
+inline PipelineParserGen::by_kind::by_kind() : kind_(symbol_kind::S_YYEMPTY) {}
#if 201103L <= YY_CPLUSPLUS
-inline PipelineParserGen::by_type::by_type(by_type&& that) : type(that.type) {
+inline PipelineParserGen::by_kind::by_kind(by_kind&& that) : kind_(that.kind_) {
that.clear();
}
#endif
-inline PipelineParserGen::by_type::by_type(const by_type& that) : type(that.type) {}
+inline PipelineParserGen::by_kind::by_kind(const by_kind& that) : kind_(that.kind_) {}
-inline PipelineParserGen::by_type::by_type(token_type t) : type(yytranslate_(t)) {}
+inline PipelineParserGen::by_kind::by_kind(token_kind_type t) : kind_(yytranslate_(t)) {}
-inline void PipelineParserGen::by_type::clear() {
- type = empty_symbol;
+inline void PipelineParserGen::by_kind::clear() {
+ kind_ = symbol_kind::S_YYEMPTY;
}
-inline void PipelineParserGen::by_type::move(by_type& that) {
- type = that.type;
+inline void PipelineParserGen::by_kind::move(by_kind& that) {
+ kind_ = that.kind_;
that.clear();
}
-inline int PipelineParserGen::by_type::type_get() const YY_NOEXCEPT {
- return type;
+inline PipelineParserGen::symbol_kind_type PipelineParserGen::by_kind::kind() const YY_NOEXCEPT {
+ return kind_;
+}
+
+inline PipelineParserGen::symbol_kind_type PipelineParserGen::by_kind::type_get() const
+ YY_NOEXCEPT {
+ return this->kind();
}
-#line 58 "src/mongo/db/cst/pipeline_grammar.yy"
+#line 58 "pipeline_grammar.yy"
} // namespace mongo
-#line 4606 "src/mongo/db/cst/pipeline_parser_gen.hpp"
+#line 5223 "pipeline_parser_gen.hpp"
-#endif // !YY_YY_SRC_MONGO_DB_CST_PIPELINE_PARSER_GEN_HPP_INCLUDED
+#endif // !YY_YY_PIPELINE_PARSER_GEN_HPP_INCLUDED
diff --git a/src/mongo/db/pipeline/expression.h b/src/mongo/db/pipeline/expression.h
index fc6f16c0eb8..2dfa80f74f3 100644
--- a/src/mongo/db/pipeline/expression.h
+++ b/src/mongo/db/pipeline/expression.h
@@ -1755,6 +1755,8 @@ private:
class ExpressionMeta final : public Expression {
public:
+ ExpressionMeta(ExpressionContext* const expCtx, DocumentMetadataFields::MetaType metaType);
+
Value serialize(bool explain) const final;
Value evaluate(const Document& root, Variables* variables) const final;
@@ -1774,8 +1776,6 @@ protected:
void _doAddDependencies(DepsTracker* deps) const final;
private:
- ExpressionMeta(ExpressionContext* const expCtx, DocumentMetadataFields::MetaType metaType);
-
DocumentMetadataFields::MetaType _metaType;
};
diff --git a/src/mongo/db/query/sort_pattern.h b/src/mongo/db/query/sort_pattern.h
index 6c7103a5dfd..0be6e347ac9 100644
--- a/src/mongo/db/query/sort_pattern.h
+++ b/src/mongo/db/query/sort_pattern.h
@@ -54,6 +54,9 @@ public:
SortPattern(const BSONObj&, const boost::intrusive_ptr<ExpressionContext>&);
+ SortPattern(std::vector<SortPatternPart> patterns, std::set<std::string> paths)
+ : _sortPattern(std::move(patterns)), _paths(std::move(paths)) {}
+
/**
* Write out a Document whose contents are the sort key pattern.
*/