diff options
author | Ted Tuckman <ted.tuckman@mongodb.com> | 2020-08-19 10:04:10 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-08-26 12:52:51 +0000 |
commit | 199df5ec6c6b8c0fc8e74dfad8a074547b79d3f2 (patch) | |
tree | cd86a8fb93148a0bcc221313681c58e52031661d | |
parent | 4dc5ad1c019849f2084bb9d30419d303679e6afe (diff) | |
download | mongo-199df5ec6c6b8c0fc8e74dfad8a074547b79d3f2.tar.gz |
SERVER-49927 Add $FieldPath to grammar
31 files changed, 3267 insertions, 2870 deletions
diff --git a/src/mongo/db/cst/SConscript b/src/mongo/db/cst/SConscript index 04af3194099..f39cb553646 100644 --- a/src/mongo/db/cst/SConscript +++ b/src/mongo/db/cst/SConscript @@ -18,6 +18,7 @@ env.Library( LIBDEPS=[ "$BUILD_DIR/mongo/base", '$BUILD_DIR/mongo/db/pipeline/pipeline', + '$BUILD_DIR/mongo/db/pipeline/variable_validation', '$BUILD_DIR/mongo/db/query/datetime/date_time_support', ] ) diff --git a/src/mongo/db/cst/bson_lexer.cpp b/src/mongo/db/cst/bson_lexer.cpp index 349430454ac..6a015eeac3b 100644 --- a/src/mongo/db/cst/bson_lexer.cpp +++ b/src/mongo/db/cst/bson_lexer.cpp @@ -246,7 +246,19 @@ void BSONLexer::tokenize(BSONElement elem, bool includeFieldName) { pushToken(elem, PipelineParserGen::token::DOUBLE_NON_ZERO, elem.numberDouble()); break; case BSONType::String: - pushToken(elem.valueStringData(), PipelineParserGen::token::STRING, elem.String()); + if (elem.String()[0] == '$') { + if (elem.String()[1] == '$') { + pushToken(elem.valueStringData(), + PipelineParserGen::token::DOLLAR_DOLLAR_STRING, + elem.String()); + } else { + pushToken(elem.valueStringData(), + PipelineParserGen::token::DOLLAR_STRING, + elem.String()); + } + } else { + pushToken(elem.valueStringData(), PipelineParserGen::token::STRING, elem.String()); + } break; case BSONType::BinData: { int len; diff --git a/src/mongo/db/cst/bson_lexer_test.cpp b/src/mongo/db/cst/bson_lexer_test.cpp index c1a67d3e2f8..039b5dcc911 100644 --- a/src/mongo/db/cst/bson_lexer_test.cpp +++ b/src/mongo/db/cst/bson_lexer_test.cpp @@ -49,7 +49,7 @@ void assertTokensMatch(BSONLexer& lexer, } TEST(BSONLexerTest, TokenizesOpaqueUserObjects) { - auto input = fromjson("{pipeline: [{a: 1, b: '1'}]}"); + auto input = fromjson("{pipeline: [{a: 1, b: '1', c: \"$path\", d: \"$$NOW\"}]}"); BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE); assertTokensMatch(lexer, {PipelineParserGen::token::START_PIPELINE, @@ -59,6 +59,10 @@ TEST(BSONLexerTest, TokenizesOpaqueUserObjects) { PipelineParserGen::token::INT_NON_ZERO, PipelineParserGen::token::FIELDNAME, PipelineParserGen::token::STRING, + PipelineParserGen::token::FIELDNAME, + PipelineParserGen::token::DOLLAR_STRING, + PipelineParserGen::token::FIELDNAME, + PipelineParserGen::token::DOLLAR_DOLLAR_STRING, PipelineParserGen::token::END_OBJECT, PipelineParserGen::token::END_ARRAY}); } @@ -234,5 +238,33 @@ TEST(BSONLexerTest, EmptyMatchExpressionsAreLexedCorrectly) { PipelineParserGen::token::END_OBJECT}); } +TEST(BSONLexerTest, TokenizesObjWithPathCorrectly) { + auto input = fromjson( + "{pipeline: [{$project: { m: { $dateToString: { date: '$date', " + "format: '%Y-%m-%d' } } } } ] }"); + 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::STAGE_PROJECT, + PipelineParserGen::token::START_OBJECT, + PipelineParserGen::token::FIELDNAME, + PipelineParserGen::token::START_OBJECT, + PipelineParserGen::token::DATE_TO_STRING, + PipelineParserGen::token::START_OBJECT, + PipelineParserGen::token::ARG_DATE, + PipelineParserGen::token::DOLLAR_STRING, + PipelineParserGen::token::ARG_FORMAT, + PipelineParserGen::token::STRING, + PipelineParserGen::token::END_OBJECT, + PipelineParserGen::token::END_OBJECT, + PipelineParserGen::token::END_OBJECT, + PipelineParserGen::token::END_OBJECT, + PipelineParserGen::token::END_ARRAY, + }); +} + } // namespace } // namespace mongo diff --git a/src/mongo/db/cst/c_node.cpp b/src/mongo/db/cst/c_node.cpp index 8736efa45da..b1587b5efee 100644 --- a/src/mongo/db/cst/c_node.cpp +++ b/src/mongo/db/cst/c_node.cpp @@ -87,6 +87,13 @@ auto printValue(const T& payload) { return "<UserDouble "s + std::to_string(userDouble) + ">"; }, [](const UserString& userString) { return "<UserString "s + userString + ">"; }, + [](const UserFieldPath& userPath) { + if (userPath.isVariable) { + return "<UserFieldPath "s + "$$" + userPath.rawStr + ">"; + } else { + return "<UserFieldPath "s + "$" + userPath.rawStr + ">"; + } + }, [](const UserBinary& userBinary) { return "<UserBinary "s + typeName(userBinary.type) + ", " + toHex(userBinary.data, userBinary.length) + ">"; diff --git a/src/mongo/db/cst/c_node.h b/src/mongo/db/cst/c_node.h index f7a5099971c..cb1b92b509e 100644 --- a/src/mongo/db/cst/c_node.h +++ b/src/mongo/db/cst/c_node.h @@ -72,6 +72,11 @@ using UserDecimal = Decimal128; struct UserMinKey {}; struct UserMaxKey {}; +struct UserFieldPath { + std::string rawStr; + bool isVariable; +}; + struct CNode { static auto noopLeaf() { return CNode{ObjectChildren{}}; @@ -177,6 +182,7 @@ public: NonZeroKey, UserDouble, UserString, + UserFieldPath, UserBinary, UserUndefined, UserObjectId, diff --git a/src/mongo/db/cst/c_node_validation.cpp b/src/mongo/db/cst/c_node_validation.cpp index f8b31c419fe..b3cb442aad9 100644 --- a/src/mongo/db/cst/c_node_validation.cpp +++ b/src/mongo/db/cst/c_node_validation.cpp @@ -31,6 +31,7 @@ #include "mongo/base/status.h" #include "mongo/db/cst/c_node_validation.h" +#include "mongo/db/pipeline/variable_validation.h" namespace mongo::c_node_validation { namespace { @@ -134,4 +135,15 @@ StatusWith<IsInclusion> validateProjectionAsInclusionOrExclusion(const CNode& pr [&](auto&& iter) { return iter == projects.objectChildren().cend(); }); } +Status validateVariableName(std::string varStr) { + // The grammar removes the first two '$' characters. + const StringData varName = varStr.substr(0, varStr.find('.')); + try { + variableValidation::validateNameForUserRead(varName); + } catch (AssertionException& ae) { + return Status(ae.code(), ae.reason()); + } + return Status::OK(); +} + } // namespace mongo::c_node_validation diff --git a/src/mongo/db/cst/c_node_validation.h b/src/mongo/db/cst/c_node_validation.h index 33861adf83e..ff438cf7c82 100644 --- a/src/mongo/db/cst/c_node_validation.h +++ b/src/mongo/db/cst/c_node_validation.h @@ -44,4 +44,6 @@ enum class IsInclusion : bool { no, yes }; StatusWith<IsInclusion> validateProjectionAsInclusionOrExclusion(const CNode& projects); +Status validateVariableName(std::string varStr); + } // namespace mongo::c_node_validation diff --git a/src/mongo/db/cst/cst_error_test.cpp b/src/mongo/db/cst/cst_error_test.cpp index 301a2046f5e..8498ce0933f 100755 --- a/src/mongo/db/cst/cst_error_test.cpp +++ b/src/mongo/db/cst/cst_error_test.cpp @@ -168,12 +168,12 @@ TEST(CstErrorTest, MissingRequiredArgumentOfMultiArgStage) { TEST(CstErrorTest, InvalidArgumentTypeForProjectionExpression) {
auto input = fromjson("{pipeline: [{$project: {a: {$eq: '$b'}}}]}");
BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE);
- ASSERT_THROWS_CODE_AND_WHAT(
- PipelineParserGen(lexer, nullptr).parse(),
- AssertionException,
- ErrorCodes::FailedToParse,
- "syntax error, unexpected string, expecting array at element '$b' within '$eq' within "
- "'$project' within array at index 0 of input pipeline");
+ ASSERT_THROWS_CODE_AND_WHAT(PipelineParserGen(lexer, nullptr).parse(),
+ AssertionException,
+ ErrorCodes::FailedToParse,
+ "syntax error, unexpected $-prefixed string, expecting array at "
+ "element '$b' within '$eq' within "
+ "'$project' within array at index 0 of input pipeline");
}
TEST(CstErrorTest, MixedProjectionTypes) {
@@ -194,7 +194,8 @@ TEST(CstErrorTest, DeeplyNestedSyntaxError) { PipelineParserGen(lexer, nullptr).parse(),
AssertionException,
ErrorCodes::FailedToParse,
- "syntax error, unexpected string, expecting array at element '$b' within '$eq' within "
+ "syntax error, unexpected $-prefixed string, expecting array at element '$b' within '$eq' "
+ "within "
"array at index 0 within '$or' within array at index 1 within '$and' within '$project' "
"within array at index 0 of input pipeline");
}
diff --git a/src/mongo/db/cst/cst_expression_test.cpp b/src/mongo/db/cst/cst_expression_test.cpp index 3d58d29fb56..c9418e87a5e 100755 --- a/src/mongo/db/cst/cst_expression_test.cpp +++ b/src/mongo/db/cst/cst_expression_test.cpp @@ -178,7 +178,7 @@ TEST(CstExpressionTest, ParsesConvertExpressions) { "{ projectInclusion: { a: { toBool: \"<UserInt 1>\" }, b: { toDate: \"<UserLong "
"1100000000000>\" }, c: { toDecimal: \"<UserInt 5>\" }, d: { toDouble: \"<UserInt "
"-2>\" }, e: { toInt: \"<UserDouble 1.999999>\" }, f: { toLong: \"<UserDouble "
- "1.999999>\" }, g: { toObjectId: \"<UserString $_id>\" }, h: { toString: "
+ "1.999999>\" }, g: { toObjectId: \"<UserFieldPath $_id>\" }, h: { toString: "
"\"<UserBoolean 0>\" } } }");
}
@@ -275,7 +275,7 @@ TEST(CstExpressionTest, ParsesDateToString) { ASSERT(KeyFieldname::projectInclusion == stages[0].firstKeyFieldname());
ASSERT_EQ(
stages[0].toBson().toString(),
- "{ projectInclusion: { m: { dateToString: { dateArg: \"<UserString $date>\", formatArg: "
+ "{ projectInclusion: { m: { dateToString: { dateArg: \"<UserFieldPath $date>\", formatArg: "
"\"<UserString %Y-%m-%d>\", timezoneArg: \"<KeyValue absentKey>\", onNullArg: "
"\"<KeyValue absentKey>\" } } } }");
}
@@ -292,11 +292,12 @@ TEST(CstExpressionTest, ParsesReplaceStringExpressions) { 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: { h: { replaceOne: { inputArg: \"<UserString $name>\", findArg: "
- "\"<UserString Cafe>\", replacementArg: \"<UserString CAFE>\" } }, i: { replaceAll: "
- "{ inputArg: \"<UserString cafeSeattle>\", findArg: \"<UserString cafe>\", "
- "replacementArg: \"<UserString CAFE>\" } } } }");
+ ASSERT_EQ(
+ stages[0].toBson().toString(),
+ "{ projectInclusion: { h: { replaceOne: { inputArg: \"<UserFieldPath $name>\", findArg: "
+ "\"<UserString Cafe>\", replacementArg: \"<UserString CAFE>\" } }, i: { replaceAll: "
+ "{ inputArg: \"<UserString cafeSeattle>\", findArg: \"<UserString cafe>\", "
+ "replacementArg: \"<UserString CAFE>\" } } } }");
}
TEST(CstExpressionTest, ParsesTrim) {
@@ -353,10 +354,11 @@ TEST(CstExpressionTest, ParsesRegexExpressions) { ASSERT(KeyFieldname::projectInclusion == stages[0].firstKeyFieldname());
ASSERT_EQ(
stages[0].toBson().toString(),
- "{ projectInclusion: { j: { regexFind: { inputArg: \"<UserString $details>\", regexArg: "
+ "{ projectInclusion: { j: { regexFind: { inputArg: \"<UserFieldPath $details>\", regexArg: "
"\"<UserRegex /^[a-z0-9_.+-]/>\", optionsArg: \"<UserString i>\" } }, k: { regexFindAll: { "
- "inputArg: \"<UserString $fname>\", regexArg: \"<UserRegex /(C(ar)*)ol/>\", optionsArg: "
- "\"<KeyValue absentKey>\" } }, l: { regexMatch: { inputArg: \"<UserString $description>\", "
+ "inputArg: \"<UserFieldPath $fname>\", regexArg: \"<UserRegex /(C(ar)*)ol/>\", optionsArg: "
+ "\"<KeyValue absentKey>\" } }, l: { regexMatch: { inputArg: \"<UserFieldPath "
+ "$description>\", "
"regexArg: \"<UserRegex /lin(e|k)/>\", optionsArg: \"<KeyValue absentKey>\" } } } }");
}
@@ -375,9 +377,10 @@ TEST(CstExpressionTest, ParsesSubstrExpressions) { ASSERT(KeyFieldname::projectInclusion == stages[0].firstKeyFieldname());
ASSERT_EQ(
stages[0].toBson().toString(),
- "{ projectInclusion: { s: { substr: [ \"<UserString $quarter>\", \"<UserInt 2>\", "
+ "{ projectInclusion: { s: { substr: [ \"<UserFieldPath $quarter>\", \"<UserInt 2>\", "
"\"<UserInt -1>\" "
- "] }, t: { substrBytes: [ \"<UserString $name>\", \"<UserInt 0>\", \"<UserInt 3>\" ] }, u: "
+ "] }, t: { substrBytes: [ \"<UserFieldPath $name>\", \"<UserInt 0>\", \"<UserInt 3>\" ] }, "
+ "u: "
"{ substrCP: [ \"<UserString Hello World!>\", \"<UserInt 6>\", \"<UserInt 5>\" ] } } }");
}
@@ -426,9 +429,10 @@ TEST(CstExpressionTest, ParsesStrCaseCmp) { 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: { r: { strcasecmp: [ \"<UserString $quarter>\", \"<UserString "
- "13q4>\" ] } } }");
+ ASSERT_EQ(
+ stages[0].toBson().toString(),
+ "{ projectInclusion: { r: { strcasecmp: [ \"<UserFieldPath $quarter>\", \"<UserString "
+ "13q4>\" ] } } }");
}
TEST(CstExpressionTest, ParsesConcat) {
@@ -442,11 +446,37 @@ TEST(CstExpressionTest, ParsesConcat) { 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: { concat: [ \"<UserString $description>\", \"<UserString - >\", "
- "\"<UserString item>\" ] } } }");
+ ASSERT_EQ(stages[0].toBson().toString(),
+ "{ projectInclusion: { a: { concat: [ \"<UserFieldPath $description>\", "
+ "\"<UserString - >\", "
+ "\"<UserString item>\" ] } } }");
}
+TEST(CstExpressionTest, FailsToParseTripleDollar) {
+ CNode output;
+ auto input = BSON("pipeline" << BSON_ARRAY(BSON("$project" << BSON("a"
+ << "$$$triple"))));
+ BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE);
+ auto parseTree = PipelineParserGen(lexer, &output);
+ ASSERT_THROWS_CODE(parseTree.parse(), AssertionException, ErrorCodes::FailedToParse);
+}
+
+TEST(CstExpressionTest, FailsToParseLoneDollar) {
+ CNode output;
+ auto input = BSON("pipeline" << BSON_ARRAY(BSON("$project" << BSON("a"
+ << "$"))));
+ BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE);
+ auto parseTree = PipelineParserGen(lexer, &output);
+ ASSERT_THROWS_CODE(parseTree.parse(), AssertionException, ErrorCodes::FailedToParse);
+}
+
+TEST(CstExpressionTest, FailsToParseInvalidVarName) {
+ CNode output;
+ auto input = BSON("pipeline" << BSON_ARRAY(BSON("$project" << BSON("a"
+ << "$$invalid"))));
+ BSONLexer lexer(input["pipeline"].Array(), PipelineParserGen::token::START_PIPELINE);
+ auto parseTree = PipelineParserGen(lexer, &output);
+ ASSERT_THROWS_CODE(parseTree.parse(), AssertionException, ErrorCodes::FailedToParse);
+}
} // namespace
} // namespace mongo
diff --git a/src/mongo/db/cst/cst_pipeline_translation.cpp b/src/mongo/db/cst/cst_pipeline_translation.cpp index bba0a5e10cd..d392343d7fc 100644 --- a/src/mongo/db/cst/cst_pipeline_translation.cpp +++ b/src/mongo/db/cst/cst_pipeline_translation.cpp @@ -426,6 +426,7 @@ Value translateLiteralLeaf(const CNode& cst) { [](const UserNull&) { return Value{BSONNULL}; }, [](const UserMinKey&) { return Value{MINKEY}; }, [](const UserMaxKey&) { return Value{MAXKEY}; }, + [](const UserFieldPath& ufp) { return Value{ufp.rawStr}; }, // The rest convert directly. [](auto&& payload) { return Value{payload}; }}, cst.payload); @@ -662,6 +663,17 @@ boost::intrusive_ptr<Expression> translateExpression( } }, [](const NonZeroKey&) -> boost::intrusive_ptr<Expression> { MONGO_UNREACHABLE; }, + [&](const UserFieldPath& ufp) -> boost::intrusive_ptr<Expression> { + if (ufp.isVariable) { + // Remove two '$' characters. + return ExpressionFieldPath::createVarFromString( + expCtx.get(), ufp.rawStr, expCtx->variablesParseState); + } else { + // Remove one '$' character. + return ExpressionFieldPath::createPathFromString( + expCtx.get(), ufp.rawStr, expCtx->variablesParseState); + } + }, // Everything else is a literal leaf. [&](auto &&) -> boost::intrusive_ptr<Expression> { return ExpressionConstant::create(expCtx.get(), translateLiteralLeaf(cst)); diff --git a/src/mongo/db/cst/cst_pipeline_translation_test.cpp b/src/mongo/db/cst/cst_pipeline_translation_test.cpp index 95abe2d9cb7..429ec779b85 100644 --- a/src/mongo/db/cst/cst_pipeline_translation_test.cpp +++ b/src/mongo/db/cst/cst_pipeline_translation_test.cpp @@ -764,11 +764,11 @@ TEST(CstPipelineTranslationTest, TranslatesToLongExpression) { } TEST(CstPipelineTranslationTest, TranslatesToObjectIdExpression) { - const auto cst = - CNode{CNode::ObjectChildren{{KeyFieldname::toObjectId, CNode{UserString{"$_id"}}}}}; + const auto cst = CNode{ + CNode::ObjectChildren{{KeyFieldname::toObjectId, CNode{UserFieldPath{"_id", false}}}}}; auto expr = cst_pipeline_translation::translateExpression(cst, getExpCtx()); ASSERT_TRUE(ValueComparator().evaluate( - Value(fromjson("{$convert: {input: {$const: '$_id'}, to: {$const: 'objectId'}}}")) == + Value(fromjson("{$convert: {input: '$_id', to: {$const: 'objectId'}}}")) == expr->serialize(false))); } @@ -800,10 +800,10 @@ TEST(CstPipelineTranslationTest, AbsConstantTranslation) { } TEST(CstPipelineTranslationTest, AbsVariableTransation) { - const auto cst = CNode{CNode::ObjectChildren{{KeyFieldname::abs, CNode{UserString{"$foo"}}}}}; + const auto cst = + CNode{CNode::ObjectChildren{{KeyFieldname::abs, CNode{UserFieldPath{"foo", false}}}}}; auto expr = cst_pipeline_translation::translateExpression(cst, getExpCtx()); - // TODO SERVER-49927 This should be a field path. - ASSERT_TRUE(ValueComparator().evaluate(Value(fromjson("{$abs: [{$const: \"$foo\"}]}")) == + ASSERT_TRUE(ValueComparator().evaluate(Value(fromjson("{$abs: [\"$foo\"]}")) == expr->serialize(false))); } @@ -1010,16 +1010,16 @@ TEST(CstPipelineTranslationTest, TranslatesDateToStringExpression) { const auto cst = CNode{CNode::ObjectChildren{ {KeyFieldname::dateToString, CNode{CNode::ObjectChildren{ - {KeyFieldname::dateArg, CNode{UserString{"$date"}}}, + {KeyFieldname::dateArg, CNode{UserFieldPath{"date", false}}}, {KeyFieldname::formatArg, CNode{UserString{"%Y-%m-%d"}}}, {KeyFieldname::timezoneArg, CNode{UserString{"America/New_York"}}}, {KeyFieldname::onNullArg, CNode{UserString{"8/10/20"}}}, }}}}}; auto expr = cst_pipeline_translation::translateExpression(cst, getExpCtx()); ASSERT_TRUE(ValueComparator().evaluate( - Value(fromjson( - "{$dateToString: {date: {$const: \"$date\"}, format: {$const: \"%Y-%m-%d\"}, timezone: " - "{$const: \"America/New_York\"}, onNull: {$const: \"8/10/20\"}}}")) == + Value( + fromjson("{$dateToString: {date: \"$date\", format: {$const: \"%Y-%m-%d\"}, timezone: " + "{$const: \"America/New_York\"}, onNull: {$const: \"8/10/20\"}}}")) == expr->serialize(false))) << expr->serialize(false); } @@ -1202,5 +1202,34 @@ TEST(CstPipelineTranslationTest, TranslatesRegexMatch) { << expr->serialize(false); } +TEST(CstPipelineTranslationTest, RecognizesSingleDollarAsNonConst) { + const auto cst = CNode{CNode::ObjectChildren{ + {KeyFieldname::trunc, + CNode{CNode::ArrayChildren{CNode{UserFieldPath{"val", false}}, + CNode{UserFieldPath{"places", false}}}}}}}; + auto expr = cst_pipeline_translation::translateExpression(cst, getExpCtx()); + ASSERT_TRUE(ValueComparator().evaluate(Value(fromjson("{$trunc: [\"$val\", \"$places\"]}")) == + expr->serialize(false))); +} + +TEST(CstPipelineTranslationTest, RecognizesDoubleDollarAsNonConst) { + const auto cst = + CNode{CNode::ObjectChildren{{KeyFieldname::toDate, CNode{UserFieldPath{"NOW", true}}}}}; + auto expr = cst_pipeline_translation::translateExpression(cst, getExpCtx()); + ASSERT_TRUE(ValueComparator().evaluate( + Value(fromjson("{$convert: {input: \"$$NOW\", to: {$const: 'date'}}}")) == + expr->serialize(false))); +} + +TEST(CstPipelineTranslationTest, InvalidDollarPrefixStringFails) { + { + const auto cst = CNode{ + CNode::ObjectChildren{{KeyFieldname::toDate, CNode{UserFieldPath{"NOWX", true}}}}}; + ASSERT_THROWS_CODE(cst_pipeline_translation::translateExpression(cst, getExpCtx()), + AssertionException, + 17276); + } +} + } // namespace } // namespace mongo diff --git a/src/mongo/db/cst/location_gen.h b/src/mongo/db/cst/location_gen.h index a6b77605137..c6549fdadbf 100644 --- a/src/mongo/db/cst/location_gen.h +++ b/src/mongo/db/cst/location_gen.h @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.5.4. +// A Bison parser, made by GNU Bison 3.6.3. // Locations for Bison parsers in C++ @@ -31,12 +31,12 @@ // version 2.2 of Bison. /** - ** \file src/mongo/db/cst/location_gen.h + ** \file location_gen.h ** Define the mongo::location class. */ -#ifndef YY_YY_SRC_MONGO_DB_CST_LOCATION_GEN_H_INCLUDED -#define YY_YY_SRC_MONGO_DB_CST_LOCATION_GEN_H_INCLUDED +#ifndef YY_YY_LOCATION_GEN_H_INCLUDED +#define YY_YY_LOCATION_GEN_H_INCLUDED #include <iostream> #include <string> @@ -53,9 +53,9 @@ #endif #endif -#line 58 "src/mongo/db/cst/pipeline_grammar.yy" +#line 58 "pipeline_grammar.yy" namespace mongo { -#line 59 "src/mongo/db/cst/location_gen.h" +#line 59 "location_gen.h" /// A point in a source file. class position { @@ -260,8 +260,8 @@ std::basic_ostream<YYChar>& operator<<(std::basic_ostream<YYChar>& ostr, const l return ostr; } -#line 58 "src/mongo/db/cst/pipeline_grammar.yy" +#line 58 "pipeline_grammar.yy" } // namespace mongo -#line 333 "src/mongo/db/cst/location_gen.h" +#line 333 "location_gen.h" -#endif // !YY_YY_SRC_MONGO_DB_CST_LOCATION_GEN_H_INCLUDED +#endif // !YY_YY_LOCATION_GEN_H_INCLUDED diff --git a/src/mongo/db/cst/pipeline_grammar.yy b/src/mongo/db/cst/pipeline_grammar.yy index 69b3b8c436d..39be479beac 100644 --- a/src/mongo/db/cst/pipeline_grammar.yy +++ b/src/mongo/db/cst/pipeline_grammar.yy @@ -232,6 +232,8 @@ %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 START_PIPELINE START_MATCH // @@ -246,8 +248,8 @@ // Literals. %nterm <CNode> dbPointer javascript symbol javascriptWScope int timestamp long double decimal -%nterm <CNode> minKey maxKey value string binary undefined objectId bool date null regex -%nterm <CNode> simpleValue compoundValue valueArray valueObject valueFields +%nterm <CNode> minKey maxKey value string fieldPath binary undefined objectId bool date null regex +%nterm <CNode> simpleValue compoundValue valueArray valueObject valueFields variable // Pipeline stages and related non-terminals. %nterm <CNode> stageList stage inhibitOptimization unionWith skip limit project sample @@ -746,7 +748,23 @@ string: $$ = CNode{UserString{$1}}; } ; - +fieldPath: + DOLLAR_STRING { + std::string str = $1; + if (str.size() == 1) { + error(@1, "'$' by iteslf is not a valid FieldPath"); + } + $$ = CNode{UserFieldPath{str.substr(1), false}}; + } +variable: + DOLLAR_DOLLAR_STRING { + std::string str = $1.substr(2); + auto status = c_node_validation::validateVariableName(str); + if (!status.isOK()) { + error(@1, status.reason()); + } + $$ = CNode{UserFieldPath{str, true}}; + } binary: BINARY { $$ = CNode{UserBinary{$1}}; @@ -872,6 +890,8 @@ bool: simpleValue: string + | fieldPath + | variable | binary | undefined | objectId diff --git a/src/mongo/db/cst/pipeline_parser_gen.cpp b/src/mongo/db/cst/pipeline_parser_gen.cpp index 56860ea56e5..c7508efc41d 100644 --- a/src/mongo/db/cst/pipeline_parser_gen.cpp +++ b/src/mongo/db/cst/pipeline_parser_gen.cpp @@ -228,131 +228,133 @@ PipelineParserGen::stack_symbol_type::stack_symbol_type(YY_RVREF(stack_symbol_ty value.YY_MOVE_OR_COPY<BSONSymbol>(YY_MOVE(that.value)); break; - case 132: // dbPointer - case 133: // javascript - case 134: // symbol - case 135: // javascriptWScope - case 136: // int - case 137: // timestamp - case 138: // long - case 139: // double - case 140: // decimal - case 141: // minKey - case 142: // maxKey - case 143: // value - case 144: // string - case 145: // binary - case 146: // undefined - case 147: // objectId - case 148: // bool - case 149: // date - case 150: // null - case 151: // regex - case 152: // simpleValue - case 153: // compoundValue - case 154: // valueArray - case 155: // valueObject - case 156: // valueFields - case 157: // stageList - case 158: // stage - case 159: // inhibitOptimization - case 160: // unionWith - case 161: // skip - case 162: // limit - case 163: // project - case 164: // sample - case 165: // projectFields - case 166: // projection - case 167: // num - case 168: // expression - case 169: // compoundExpression - case 170: // exprFixedTwoArg - case 171: // expressionArray - case 172: // expressionObject - case 173: // expressionFields - case 174: // maths - case 175: // add - case 176: // atan2 - case 177: // boolExps - case 178: // and - case 179: // or - case 180: // not - case 181: // literalEscapes - case 182: // const - case 183: // literal - case 184: // stringExps - case 185: // concat - case 186: // dateFromString - case 187: // dateToString - case 188: // indexOfBytes - case 189: // indexOfCP - case 190: // ltrim - case 191: // regexFind - case 192: // regexFindAll - case 193: // regexMatch - case 194: // regexArgs - case 195: // replaceOne - case 196: // replaceAll - case 197: // rtrim - case 198: // split - case 199: // strLenBytes - case 200: // strLenCP - case 201: // strcasecmp - case 202: // substr - case 203: // substrBytes - case 204: // substrCP - case 205: // toLower - case 206: // toUpper - case 207: // trim - case 208: // compExprs - case 209: // cmp - case 210: // eq - case 211: // gt - case 212: // gte - case 213: // lt - case 214: // lte - case 215: // ne - case 216: // typeExpression - case 217: // convert - case 218: // toBool - case 219: // toDate - case 220: // toDecimal - case 221: // toDouble - case 222: // toInt - case 223: // toLong - case 224: // toObjectId - case 225: // toString - case 226: // type - case 227: // abs - case 228: // ceil - case 229: // divide - case 230: // exponent - case 231: // floor - case 232: // ln - case 233: // log - case 234: // logten - case 235: // mod - case 236: // multiply - case 237: // pow - case 238: // round - case 239: // sqrt - case 240: // subtract - case 241: // trunc - case 251: // matchExpression - case 252: // filterFields - case 253: // filterVal + case 134: // dbPointer + case 135: // javascript + case 136: // symbol + case 137: // javascriptWScope + case 138: // int + case 139: // timestamp + case 140: // long + case 141: // double + case 142: // decimal + case 143: // minKey + case 144: // maxKey + case 145: // value + case 146: // string + case 147: // fieldPath + case 148: // binary + case 149: // undefined + case 150: // objectId + case 151: // bool + case 152: // date + case 153: // null + case 154: // regex + case 155: // simpleValue + case 156: // compoundValue + case 157: // valueArray + case 158: // valueObject + case 159: // valueFields + case 160: // variable + case 161: // stageList + case 162: // stage + case 163: // inhibitOptimization + case 164: // unionWith + case 165: // skip + case 166: // limit + case 167: // project + case 168: // sample + case 169: // projectFields + case 170: // projection + case 171: // num + case 172: // expression + case 173: // compoundExpression + case 174: // exprFixedTwoArg + case 175: // expressionArray + case 176: // expressionObject + case 177: // expressionFields + case 178: // maths + case 179: // add + case 180: // atan2 + case 181: // boolExps + case 182: // and + case 183: // or + case 184: // not + case 185: // literalEscapes + case 186: // const + case 187: // literal + case 188: // stringExps + case 189: // concat + case 190: // dateFromString + case 191: // dateToString + case 192: // indexOfBytes + case 193: // indexOfCP + case 194: // ltrim + case 195: // regexFind + case 196: // regexFindAll + case 197: // regexMatch + case 198: // regexArgs + case 199: // replaceOne + case 200: // replaceAll + case 201: // rtrim + case 202: // split + case 203: // strLenBytes + case 204: // strLenCP + case 205: // strcasecmp + case 206: // substr + case 207: // substrBytes + case 208: // substrCP + case 209: // toLower + case 210: // toUpper + case 211: // trim + case 212: // compExprs + case 213: // cmp + case 214: // eq + case 215: // gt + case 216: // gte + case 217: // lt + case 218: // lte + case 219: // ne + case 220: // typeExpression + case 221: // convert + case 222: // toBool + case 223: // toDate + case 224: // toDecimal + case 225: // toDouble + case 226: // toInt + case 227: // toLong + case 228: // toObjectId + case 229: // toString + case 230: // type + case 231: // abs + case 232: // ceil + case 233: // divide + case 234: // exponent + case 235: // floor + case 236: // ln + case 237: // log + case 238: // logten + case 239: // mod + case 240: // multiply + case 241: // pow + case 242: // round + case 243: // sqrt + case 244: // subtract + case 245: // trunc + case 255: // matchExpression + case 256: // filterFields + case 257: // filterVal value.YY_MOVE_OR_COPY<CNode>(YY_MOVE(that.value)); break; - case 119: // projectionFieldname - case 120: // expressionFieldname - case 121: // stageAsUserFieldname - case 122: // filterFieldname - case 123: // argAsUserFieldname - case 124: // aggExprAsUserFieldname - case 125: // invariableUserFieldname - case 126: // idAsUserFieldname - case 127: // valueFieldname + case 121: // projectionFieldname + case 122: // expressionFieldname + case 123: // stageAsUserFieldname + case 124: // filterFieldname + case 125: // argAsUserFieldname + case 126: // aggExprAsUserFieldname + case 127: // invariableUserFieldname + case 128: // idAsUserFieldname + case 129: // valueFieldname value.YY_MOVE_OR_COPY<CNode::Fieldname>(YY_MOVE(that.value)); break; @@ -400,27 +402,29 @@ PipelineParserGen::stack_symbol_type::stack_symbol_type(YY_RVREF(stack_symbol_ty value.YY_MOVE_OR_COPY<long long>(YY_MOVE(that.value)); break; - case 128: // projectField - case 129: // expressionField - case 130: // valueField - case 131: // filterField - case 242: // onErrorArg - case 243: // onNullArg - case 244: // formatArg - case 245: // timezoneArg - case 246: // charsArg - case 247: // optionsArg + case 130: // projectField + case 131: // expressionField + case 132: // valueField + case 133: // filterField + case 246: // onErrorArg + case 247: // onNullArg + case 248: // formatArg + case 249: // timezoneArg + case 250: // charsArg + case 251: // optionsArg value.YY_MOVE_OR_COPY<std::pair<CNode::Fieldname, CNode>>(YY_MOVE(that.value)); break; - case 97: // "fieldname" - case 98: // "string" + case 97: // "fieldname" + case 98: // "string" + case 116: // "$-prefixed string" + case 117: // "$$-prefixed string" value.YY_MOVE_OR_COPY<std::string>(YY_MOVE(that.value)); break; - case 248: // expressions - case 249: // values - case 250: // exprZeroToTwo + case 252: // expressions + case 253: // values + case 254: // exprZeroToTwo value.YY_MOVE_OR_COPY<std::vector<CNode>>(YY_MOVE(that.value)); break; @@ -461,131 +465,133 @@ PipelineParserGen::stack_symbol_type::stack_symbol_type(state_type s, YY_MOVE_RE value.move<BSONSymbol>(YY_MOVE(that.value)); break; - case 132: // dbPointer - case 133: // javascript - case 134: // symbol - case 135: // javascriptWScope - case 136: // int - case 137: // timestamp - case 138: // long - case 139: // double - case 140: // decimal - case 141: // minKey - case 142: // maxKey - case 143: // value - case 144: // string - case 145: // binary - case 146: // undefined - case 147: // objectId - case 148: // bool - case 149: // date - case 150: // null - case 151: // regex - case 152: // simpleValue - case 153: // compoundValue - case 154: // valueArray - case 155: // valueObject - case 156: // valueFields - case 157: // stageList - case 158: // stage - case 159: // inhibitOptimization - case 160: // unionWith - case 161: // skip - case 162: // limit - case 163: // project - case 164: // sample - case 165: // projectFields - case 166: // projection - case 167: // num - case 168: // expression - case 169: // compoundExpression - case 170: // exprFixedTwoArg - case 171: // expressionArray - case 172: // expressionObject - case 173: // expressionFields - case 174: // maths - case 175: // add - case 176: // atan2 - case 177: // boolExps - case 178: // and - case 179: // or - case 180: // not - case 181: // literalEscapes - case 182: // const - case 183: // literal - case 184: // stringExps - case 185: // concat - case 186: // dateFromString - case 187: // dateToString - case 188: // indexOfBytes - case 189: // indexOfCP - case 190: // ltrim - case 191: // regexFind - case 192: // regexFindAll - case 193: // regexMatch - case 194: // regexArgs - case 195: // replaceOne - case 196: // replaceAll - case 197: // rtrim - case 198: // split - case 199: // strLenBytes - case 200: // strLenCP - case 201: // strcasecmp - case 202: // substr - case 203: // substrBytes - case 204: // substrCP - case 205: // toLower - case 206: // toUpper - case 207: // trim - case 208: // compExprs - case 209: // cmp - case 210: // eq - case 211: // gt - case 212: // gte - case 213: // lt - case 214: // lte - case 215: // ne - case 216: // typeExpression - case 217: // convert - case 218: // toBool - case 219: // toDate - case 220: // toDecimal - case 221: // toDouble - case 222: // toInt - case 223: // toLong - case 224: // toObjectId - case 225: // toString - case 226: // type - case 227: // abs - case 228: // ceil - case 229: // divide - case 230: // exponent - case 231: // floor - case 232: // ln - case 233: // log - case 234: // logten - case 235: // mod - case 236: // multiply - case 237: // pow - case 238: // round - case 239: // sqrt - case 240: // subtract - case 241: // trunc - case 251: // matchExpression - case 252: // filterFields - case 253: // filterVal + case 134: // dbPointer + case 135: // javascript + case 136: // symbol + case 137: // javascriptWScope + case 138: // int + case 139: // timestamp + case 140: // long + case 141: // double + case 142: // decimal + case 143: // minKey + case 144: // maxKey + case 145: // value + case 146: // string + case 147: // fieldPath + case 148: // binary + case 149: // undefined + case 150: // objectId + case 151: // bool + case 152: // date + case 153: // null + case 154: // regex + case 155: // simpleValue + case 156: // compoundValue + case 157: // valueArray + case 158: // valueObject + case 159: // valueFields + case 160: // variable + case 161: // stageList + case 162: // stage + case 163: // inhibitOptimization + case 164: // unionWith + case 165: // skip + case 166: // limit + case 167: // project + case 168: // sample + case 169: // projectFields + case 170: // projection + case 171: // num + case 172: // expression + case 173: // compoundExpression + case 174: // exprFixedTwoArg + case 175: // expressionArray + case 176: // expressionObject + case 177: // expressionFields + case 178: // maths + case 179: // add + case 180: // atan2 + case 181: // boolExps + case 182: // and + case 183: // or + case 184: // not + case 185: // literalEscapes + case 186: // const + case 187: // literal + case 188: // stringExps + case 189: // concat + case 190: // dateFromString + case 191: // dateToString + case 192: // indexOfBytes + case 193: // indexOfCP + case 194: // ltrim + case 195: // regexFind + case 196: // regexFindAll + case 197: // regexMatch + case 198: // regexArgs + case 199: // replaceOne + case 200: // replaceAll + case 201: // rtrim + case 202: // split + case 203: // strLenBytes + case 204: // strLenCP + case 205: // strcasecmp + case 206: // substr + case 207: // substrBytes + case 208: // substrCP + case 209: // toLower + case 210: // toUpper + case 211: // trim + case 212: // compExprs + case 213: // cmp + case 214: // eq + case 215: // gt + case 216: // gte + case 217: // lt + case 218: // lte + case 219: // ne + case 220: // typeExpression + case 221: // convert + case 222: // toBool + case 223: // toDate + case 224: // toDecimal + case 225: // toDouble + case 226: // toInt + case 227: // toLong + case 228: // toObjectId + case 229: // toString + case 230: // type + case 231: // abs + case 232: // ceil + case 233: // divide + case 234: // exponent + case 235: // floor + case 236: // ln + case 237: // log + case 238: // logten + case 239: // mod + case 240: // multiply + case 241: // pow + case 242: // round + case 243: // sqrt + case 244: // subtract + case 245: // trunc + case 255: // matchExpression + case 256: // filterFields + case 257: // filterVal value.move<CNode>(YY_MOVE(that.value)); break; - case 119: // projectionFieldname - case 120: // expressionFieldname - case 121: // stageAsUserFieldname - case 122: // filterFieldname - case 123: // argAsUserFieldname - case 124: // aggExprAsUserFieldname - case 125: // invariableUserFieldname - case 126: // idAsUserFieldname - case 127: // valueFieldname + case 121: // projectionFieldname + case 122: // expressionFieldname + case 123: // stageAsUserFieldname + case 124: // filterFieldname + case 125: // argAsUserFieldname + case 126: // aggExprAsUserFieldname + case 127: // invariableUserFieldname + case 128: // idAsUserFieldname + case 129: // valueFieldname value.move<CNode::Fieldname>(YY_MOVE(that.value)); break; @@ -633,27 +639,29 @@ PipelineParserGen::stack_symbol_type::stack_symbol_type(state_type s, YY_MOVE_RE value.move<long long>(YY_MOVE(that.value)); break; - case 128: // projectField - case 129: // expressionField - case 130: // valueField - case 131: // filterField - case 242: // onErrorArg - case 243: // onNullArg - case 244: // formatArg - case 245: // timezoneArg - case 246: // charsArg - case 247: // optionsArg + case 130: // projectField + case 131: // expressionField + case 132: // valueField + case 133: // filterField + case 246: // onErrorArg + case 247: // onNullArg + case 248: // formatArg + case 249: // timezoneArg + case 250: // charsArg + case 251: // optionsArg value.move<std::pair<CNode::Fieldname, CNode>>(YY_MOVE(that.value)); break; - case 97: // "fieldname" - case 98: // "string" + case 97: // "fieldname" + case 98: // "string" + case 116: // "$-prefixed string" + case 117: // "$$-prefixed string" value.move<std::string>(YY_MOVE(that.value)); break; - case 248: // expressions - case 249: // values - case 250: // exprZeroToTwo + case 252: // expressions + case 253: // values + case 254: // exprZeroToTwo value.move<std::vector<CNode>>(YY_MOVE(that.value)); break; @@ -694,131 +702,133 @@ PipelineParserGen::stack_symbol_type& PipelineParserGen::stack_symbol_type::oper value.copy<BSONSymbol>(that.value); break; - case 132: // dbPointer - case 133: // javascript - case 134: // symbol - case 135: // javascriptWScope - case 136: // int - case 137: // timestamp - case 138: // long - case 139: // double - case 140: // decimal - case 141: // minKey - case 142: // maxKey - case 143: // value - case 144: // string - case 145: // binary - case 146: // undefined - case 147: // objectId - case 148: // bool - case 149: // date - case 150: // null - case 151: // regex - case 152: // simpleValue - case 153: // compoundValue - case 154: // valueArray - case 155: // valueObject - case 156: // valueFields - case 157: // stageList - case 158: // stage - case 159: // inhibitOptimization - case 160: // unionWith - case 161: // skip - case 162: // limit - case 163: // project - case 164: // sample - case 165: // projectFields - case 166: // projection - case 167: // num - case 168: // expression - case 169: // compoundExpression - case 170: // exprFixedTwoArg - case 171: // expressionArray - case 172: // expressionObject - case 173: // expressionFields - case 174: // maths - case 175: // add - case 176: // atan2 - case 177: // boolExps - case 178: // and - case 179: // or - case 180: // not - case 181: // literalEscapes - case 182: // const - case 183: // literal - case 184: // stringExps - case 185: // concat - case 186: // dateFromString - case 187: // dateToString - case 188: // indexOfBytes - case 189: // indexOfCP - case 190: // ltrim - case 191: // regexFind - case 192: // regexFindAll - case 193: // regexMatch - case 194: // regexArgs - case 195: // replaceOne - case 196: // replaceAll - case 197: // rtrim - case 198: // split - case 199: // strLenBytes - case 200: // strLenCP - case 201: // strcasecmp - case 202: // substr - case 203: // substrBytes - case 204: // substrCP - case 205: // toLower - case 206: // toUpper - case 207: // trim - case 208: // compExprs - case 209: // cmp - case 210: // eq - case 211: // gt - case 212: // gte - case 213: // lt - case 214: // lte - case 215: // ne - case 216: // typeExpression - case 217: // convert - case 218: // toBool - case 219: // toDate - case 220: // toDecimal - case 221: // toDouble - case 222: // toInt - case 223: // toLong - case 224: // toObjectId - case 225: // toString - case 226: // type - case 227: // abs - case 228: // ceil - case 229: // divide - case 230: // exponent - case 231: // floor - case 232: // ln - case 233: // log - case 234: // logten - case 235: // mod - case 236: // multiply - case 237: // pow - case 238: // round - case 239: // sqrt - case 240: // subtract - case 241: // trunc - case 251: // matchExpression - case 252: // filterFields - case 253: // filterVal + case 134: // dbPointer + case 135: // javascript + case 136: // symbol + case 137: // javascriptWScope + case 138: // int + case 139: // timestamp + case 140: // long + case 141: // double + case 142: // decimal + case 143: // minKey + case 144: // maxKey + case 145: // value + case 146: // string + case 147: // fieldPath + case 148: // binary + case 149: // undefined + case 150: // objectId + case 151: // bool + case 152: // date + case 153: // null + case 154: // regex + case 155: // simpleValue + case 156: // compoundValue + case 157: // valueArray + case 158: // valueObject + case 159: // valueFields + case 160: // variable + case 161: // stageList + case 162: // stage + case 163: // inhibitOptimization + case 164: // unionWith + case 165: // skip + case 166: // limit + case 167: // project + case 168: // sample + case 169: // projectFields + case 170: // projection + case 171: // num + case 172: // expression + case 173: // compoundExpression + case 174: // exprFixedTwoArg + case 175: // expressionArray + case 176: // expressionObject + case 177: // expressionFields + case 178: // maths + case 179: // add + case 180: // atan2 + case 181: // boolExps + case 182: // and + case 183: // or + case 184: // not + case 185: // literalEscapes + case 186: // const + case 187: // literal + case 188: // stringExps + case 189: // concat + case 190: // dateFromString + case 191: // dateToString + case 192: // indexOfBytes + case 193: // indexOfCP + case 194: // ltrim + case 195: // regexFind + case 196: // regexFindAll + case 197: // regexMatch + case 198: // regexArgs + case 199: // replaceOne + case 200: // replaceAll + case 201: // rtrim + case 202: // split + case 203: // strLenBytes + case 204: // strLenCP + case 205: // strcasecmp + case 206: // substr + case 207: // substrBytes + case 208: // substrCP + case 209: // toLower + case 210: // toUpper + case 211: // trim + case 212: // compExprs + case 213: // cmp + case 214: // eq + case 215: // gt + case 216: // gte + case 217: // lt + case 218: // lte + case 219: // ne + case 220: // typeExpression + case 221: // convert + case 222: // toBool + case 223: // toDate + case 224: // toDecimal + case 225: // toDouble + case 226: // toInt + case 227: // toLong + case 228: // toObjectId + case 229: // toString + case 230: // type + case 231: // abs + case 232: // ceil + case 233: // divide + case 234: // exponent + case 235: // floor + case 236: // ln + case 237: // log + case 238: // logten + case 239: // mod + case 240: // multiply + case 241: // pow + case 242: // round + case 243: // sqrt + case 244: // subtract + case 245: // trunc + case 255: // matchExpression + case 256: // filterFields + case 257: // filterVal value.copy<CNode>(that.value); break; - case 119: // projectionFieldname - case 120: // expressionFieldname - case 121: // stageAsUserFieldname - case 122: // filterFieldname - case 123: // argAsUserFieldname - case 124: // aggExprAsUserFieldname - case 125: // invariableUserFieldname - case 126: // idAsUserFieldname - case 127: // valueFieldname + case 121: // projectionFieldname + case 122: // expressionFieldname + case 123: // stageAsUserFieldname + case 124: // filterFieldname + case 125: // argAsUserFieldname + case 126: // aggExprAsUserFieldname + case 127: // invariableUserFieldname + case 128: // idAsUserFieldname + case 129: // valueFieldname value.copy<CNode::Fieldname>(that.value); break; @@ -866,27 +876,29 @@ PipelineParserGen::stack_symbol_type& PipelineParserGen::stack_symbol_type::oper value.copy<long long>(that.value); break; - case 128: // projectField - case 129: // expressionField - case 130: // valueField - case 131: // filterField - case 242: // onErrorArg - case 243: // onNullArg - case 244: // formatArg - case 245: // timezoneArg - case 246: // charsArg - case 247: // optionsArg + case 130: // projectField + case 131: // expressionField + case 132: // valueField + case 133: // filterField + case 246: // onErrorArg + case 247: // onNullArg + case 248: // formatArg + case 249: // timezoneArg + case 250: // charsArg + case 251: // optionsArg value.copy<std::pair<CNode::Fieldname, CNode>>(that.value); break; - case 97: // "fieldname" - case 98: // "string" + case 97: // "fieldname" + case 98: // "string" + case 116: // "$-prefixed string" + case 117: // "$$-prefixed string" value.copy<std::string>(that.value); break; - case 248: // expressions - case 249: // values - case 250: // exprZeroToTwo + case 252: // expressions + case 253: // values + case 254: // exprZeroToTwo value.copy<std::vector<CNode>>(that.value); break; @@ -926,131 +938,133 @@ PipelineParserGen::stack_symbol_type& PipelineParserGen::stack_symbol_type::oper value.move<BSONSymbol>(that.value); break; - case 132: // dbPointer - case 133: // javascript - case 134: // symbol - case 135: // javascriptWScope - case 136: // int - case 137: // timestamp - case 138: // long - case 139: // double - case 140: // decimal - case 141: // minKey - case 142: // maxKey - case 143: // value - case 144: // string - case 145: // binary - case 146: // undefined - case 147: // objectId - case 148: // bool - case 149: // date - case 150: // null - case 151: // regex - case 152: // simpleValue - case 153: // compoundValue - case 154: // valueArray - case 155: // valueObject - case 156: // valueFields - case 157: // stageList - case 158: // stage - case 159: // inhibitOptimization - case 160: // unionWith - case 161: // skip - case 162: // limit - case 163: // project - case 164: // sample - case 165: // projectFields - case 166: // projection - case 167: // num - case 168: // expression - case 169: // compoundExpression - case 170: // exprFixedTwoArg - case 171: // expressionArray - case 172: // expressionObject - case 173: // expressionFields - case 174: // maths - case 175: // add - case 176: // atan2 - case 177: // boolExps - case 178: // and - case 179: // or - case 180: // not - case 181: // literalEscapes - case 182: // const - case 183: // literal - case 184: // stringExps - case 185: // concat - case 186: // dateFromString - case 187: // dateToString - case 188: // indexOfBytes - case 189: // indexOfCP - case 190: // ltrim - case 191: // regexFind - case 192: // regexFindAll - case 193: // regexMatch - case 194: // regexArgs - case 195: // replaceOne - case 196: // replaceAll - case 197: // rtrim - case 198: // split - case 199: // strLenBytes - case 200: // strLenCP - case 201: // strcasecmp - case 202: // substr - case 203: // substrBytes - case 204: // substrCP - case 205: // toLower - case 206: // toUpper - case 207: // trim - case 208: // compExprs - case 209: // cmp - case 210: // eq - case 211: // gt - case 212: // gte - case 213: // lt - case 214: // lte - case 215: // ne - case 216: // typeExpression - case 217: // convert - case 218: // toBool - case 219: // toDate - case 220: // toDecimal - case 221: // toDouble - case 222: // toInt - case 223: // toLong - case 224: // toObjectId - case 225: // toString - case 226: // type - case 227: // abs - case 228: // ceil - case 229: // divide - case 230: // exponent - case 231: // floor - case 232: // ln - case 233: // log - case 234: // logten - case 235: // mod - case 236: // multiply - case 237: // pow - case 238: // round - case 239: // sqrt - case 240: // subtract - case 241: // trunc - case 251: // matchExpression - case 252: // filterFields - case 253: // filterVal + case 134: // dbPointer + case 135: // javascript + case 136: // symbol + case 137: // javascriptWScope + case 138: // int + case 139: // timestamp + case 140: // long + case 141: // double + case 142: // decimal + case 143: // minKey + case 144: // maxKey + case 145: // value + case 146: // string + case 147: // fieldPath + case 148: // binary + case 149: // undefined + case 150: // objectId + case 151: // bool + case 152: // date + case 153: // null + case 154: // regex + case 155: // simpleValue + case 156: // compoundValue + case 157: // valueArray + case 158: // valueObject + case 159: // valueFields + case 160: // variable + case 161: // stageList + case 162: // stage + case 163: // inhibitOptimization + case 164: // unionWith + case 165: // skip + case 166: // limit + case 167: // project + case 168: // sample + case 169: // projectFields + case 170: // projection + case 171: // num + case 172: // expression + case 173: // compoundExpression + case 174: // exprFixedTwoArg + case 175: // expressionArray + case 176: // expressionObject + case 177: // expressionFields + case 178: // maths + case 179: // add + case 180: // atan2 + case 181: // boolExps + case 182: // and + case 183: // or + case 184: // not + case 185: // literalEscapes + case 186: // const + case 187: // literal + case 188: // stringExps + case 189: // concat + case 190: // dateFromString + case 191: // dateToString + case 192: // indexOfBytes + case 193: // indexOfCP + case 194: // ltrim + case 195: // regexFind + case 196: // regexFindAll + case 197: // regexMatch + case 198: // regexArgs + case 199: // replaceOne + case 200: // replaceAll + case 201: // rtrim + case 202: // split + case 203: // strLenBytes + case 204: // strLenCP + case 205: // strcasecmp + case 206: // substr + case 207: // substrBytes + case 208: // substrCP + case 209: // toLower + case 210: // toUpper + case 211: // trim + case 212: // compExprs + case 213: // cmp + case 214: // eq + case 215: // gt + case 216: // gte + case 217: // lt + case 218: // lte + case 219: // ne + case 220: // typeExpression + case 221: // convert + case 222: // toBool + case 223: // toDate + case 224: // toDecimal + case 225: // toDouble + case 226: // toInt + case 227: // toLong + case 228: // toObjectId + case 229: // toString + case 230: // type + case 231: // abs + case 232: // ceil + case 233: // divide + case 234: // exponent + case 235: // floor + case 236: // ln + case 237: // log + case 238: // logten + case 239: // mod + case 240: // multiply + case 241: // pow + case 242: // round + case 243: // sqrt + case 244: // subtract + case 245: // trunc + case 255: // matchExpression + case 256: // filterFields + case 257: // filterVal value.move<CNode>(that.value); break; - case 119: // projectionFieldname - case 120: // expressionFieldname - case 121: // stageAsUserFieldname - case 122: // filterFieldname - case 123: // argAsUserFieldname - case 124: // aggExprAsUserFieldname - case 125: // invariableUserFieldname - case 126: // idAsUserFieldname - case 127: // valueFieldname + case 121: // projectionFieldname + case 122: // expressionFieldname + case 123: // stageAsUserFieldname + case 124: // filterFieldname + case 125: // argAsUserFieldname + case 126: // aggExprAsUserFieldname + case 127: // invariableUserFieldname + case 128: // idAsUserFieldname + case 129: // valueFieldname value.move<CNode::Fieldname>(that.value); break; @@ -1098,27 +1112,29 @@ PipelineParserGen::stack_symbol_type& PipelineParserGen::stack_symbol_type::oper value.move<long long>(that.value); break; - case 128: // projectField - case 129: // expressionField - case 130: // valueField - case 131: // filterField - case 242: // onErrorArg - case 243: // onNullArg - case 244: // formatArg - case 245: // timezoneArg - case 246: // charsArg - case 247: // optionsArg + case 130: // projectField + case 131: // expressionField + case 132: // valueField + case 133: // filterField + case 246: // onErrorArg + case 247: // onNullArg + case 248: // formatArg + case 249: // timezoneArg + case 250: // charsArg + case 251: // optionsArg value.move<std::pair<CNode::Fieldname, CNode>>(that.value); break; - case 97: // "fieldname" - case 98: // "string" + case 97: // "fieldname" + case 98: // "string" + case 116: // "$-prefixed string" + case 117: // "$$-prefixed string" value.move<std::string>(that.value); break; - case 248: // expressions - case 249: // values - case 250: // exprZeroToTwo + case 252: // expressions + case 253: // values + case 254: // exprZeroToTwo value.move<std::vector<CNode>>(that.value); break; @@ -1369,131 +1385,133 @@ int PipelineParserGen::parse() { yylhs.value.emplace<BSONSymbol>(); break; - case 132: // dbPointer - case 133: // javascript - case 134: // symbol - case 135: // javascriptWScope - case 136: // int - case 137: // timestamp - case 138: // long - case 139: // double - case 140: // decimal - case 141: // minKey - case 142: // maxKey - case 143: // value - case 144: // string - case 145: // binary - case 146: // undefined - case 147: // objectId - case 148: // bool - case 149: // date - case 150: // null - case 151: // regex - case 152: // simpleValue - case 153: // compoundValue - case 154: // valueArray - case 155: // valueObject - case 156: // valueFields - case 157: // stageList - case 158: // stage - case 159: // inhibitOptimization - case 160: // unionWith - case 161: // skip - case 162: // limit - case 163: // project - case 164: // sample - case 165: // projectFields - case 166: // projection - case 167: // num - case 168: // expression - case 169: // compoundExpression - case 170: // exprFixedTwoArg - case 171: // expressionArray - case 172: // expressionObject - case 173: // expressionFields - case 174: // maths - case 175: // add - case 176: // atan2 - case 177: // boolExps - case 178: // and - case 179: // or - case 180: // not - case 181: // literalEscapes - case 182: // const - case 183: // literal - case 184: // stringExps - case 185: // concat - case 186: // dateFromString - case 187: // dateToString - case 188: // indexOfBytes - case 189: // indexOfCP - case 190: // ltrim - case 191: // regexFind - case 192: // regexFindAll - case 193: // regexMatch - case 194: // regexArgs - case 195: // replaceOne - case 196: // replaceAll - case 197: // rtrim - case 198: // split - case 199: // strLenBytes - case 200: // strLenCP - case 201: // strcasecmp - case 202: // substr - case 203: // substrBytes - case 204: // substrCP - case 205: // toLower - case 206: // toUpper - case 207: // trim - case 208: // compExprs - case 209: // cmp - case 210: // eq - case 211: // gt - case 212: // gte - case 213: // lt - case 214: // lte - case 215: // ne - case 216: // typeExpression - case 217: // convert - case 218: // toBool - case 219: // toDate - case 220: // toDecimal - case 221: // toDouble - case 222: // toInt - case 223: // toLong - case 224: // toObjectId - case 225: // toString - case 226: // type - case 227: // abs - case 228: // ceil - case 229: // divide - case 230: // exponent - case 231: // floor - case 232: // ln - case 233: // log - case 234: // logten - case 235: // mod - case 236: // multiply - case 237: // pow - case 238: // round - case 239: // sqrt - case 240: // subtract - case 241: // trunc - case 251: // matchExpression - case 252: // filterFields - case 253: // filterVal + case 134: // dbPointer + case 135: // javascript + case 136: // symbol + case 137: // javascriptWScope + case 138: // int + case 139: // timestamp + case 140: // long + case 141: // double + case 142: // decimal + case 143: // minKey + case 144: // maxKey + case 145: // value + case 146: // string + case 147: // fieldPath + case 148: // binary + case 149: // undefined + case 150: // objectId + case 151: // bool + case 152: // date + case 153: // null + case 154: // regex + case 155: // simpleValue + case 156: // compoundValue + case 157: // valueArray + case 158: // valueObject + case 159: // valueFields + case 160: // variable + case 161: // stageList + case 162: // stage + case 163: // inhibitOptimization + case 164: // unionWith + case 165: // skip + case 166: // limit + case 167: // project + case 168: // sample + case 169: // projectFields + case 170: // projection + case 171: // num + case 172: // expression + case 173: // compoundExpression + case 174: // exprFixedTwoArg + case 175: // expressionArray + case 176: // expressionObject + case 177: // expressionFields + case 178: // maths + case 179: // add + case 180: // atan2 + case 181: // boolExps + case 182: // and + case 183: // or + case 184: // not + case 185: // literalEscapes + case 186: // const + case 187: // literal + case 188: // stringExps + case 189: // concat + case 190: // dateFromString + case 191: // dateToString + case 192: // indexOfBytes + case 193: // indexOfCP + case 194: // ltrim + case 195: // regexFind + case 196: // regexFindAll + case 197: // regexMatch + case 198: // regexArgs + case 199: // replaceOne + case 200: // replaceAll + case 201: // rtrim + case 202: // split + case 203: // strLenBytes + case 204: // strLenCP + case 205: // strcasecmp + case 206: // substr + case 207: // substrBytes + case 208: // substrCP + case 209: // toLower + case 210: // toUpper + case 211: // trim + case 212: // compExprs + case 213: // cmp + case 214: // eq + case 215: // gt + case 216: // gte + case 217: // lt + case 218: // lte + case 219: // ne + case 220: // typeExpression + case 221: // convert + case 222: // toBool + case 223: // toDate + case 224: // toDecimal + case 225: // toDouble + case 226: // toInt + case 227: // toLong + case 228: // toObjectId + case 229: // toString + case 230: // type + case 231: // abs + case 232: // ceil + case 233: // divide + case 234: // exponent + case 235: // floor + case 236: // ln + case 237: // log + case 238: // logten + case 239: // mod + case 240: // multiply + case 241: // pow + case 242: // round + case 243: // sqrt + case 244: // subtract + case 245: // trunc + case 255: // matchExpression + case 256: // filterFields + case 257: // filterVal yylhs.value.emplace<CNode>(); break; - case 119: // projectionFieldname - case 120: // expressionFieldname - case 121: // stageAsUserFieldname - case 122: // filterFieldname - case 123: // argAsUserFieldname - case 124: // aggExprAsUserFieldname - case 125: // invariableUserFieldname - case 126: // idAsUserFieldname - case 127: // valueFieldname + case 121: // projectionFieldname + case 122: // expressionFieldname + case 123: // stageAsUserFieldname + case 124: // filterFieldname + case 125: // argAsUserFieldname + case 126: // aggExprAsUserFieldname + case 127: // invariableUserFieldname + case 128: // idAsUserFieldname + case 129: // valueFieldname yylhs.value.emplace<CNode::Fieldname>(); break; @@ -1541,27 +1559,29 @@ int PipelineParserGen::parse() { yylhs.value.emplace<long long>(); break; - case 128: // projectField - case 129: // expressionField - case 130: // valueField - case 131: // filterField - case 242: // onErrorArg - case 243: // onNullArg - case 244: // formatArg - case 245: // timezoneArg - case 246: // charsArg - case 247: // optionsArg + case 130: // projectField + case 131: // expressionField + case 132: // valueField + case 133: // filterField + case 246: // onErrorArg + case 247: // onNullArg + case 248: // formatArg + case 249: // timezoneArg + case 250: // charsArg + case 251: // optionsArg yylhs.value.emplace<std::pair<CNode::Fieldname, CNode>>(); break; - case 97: // "fieldname" - case 98: // "string" + case 97: // "fieldname" + case 98: // "string" + case 116: // "$-prefixed string" + case 117: // "$$-prefixed string" yylhs.value.emplace<std::string>(); break; - case 248: // expressions - case 249: // values - case 250: // exprZeroToTwo + case 252: // expressions + case 253: // values + case 254: // exprZeroToTwo yylhs.value.emplace<std::vector<CNode>>(); break; @@ -1585,95 +1605,95 @@ int PipelineParserGen::parse() { { switch (yyn) { case 3: -#line 280 "pipeline_grammar.yy" +#line 282 "pipeline_grammar.yy" { *cst = CNode{YY_MOVE(yystack_[0].value.as<CNode>())}; } -#line 1658 "pipeline_parser_gen.cpp" +#line 1678 "pipeline_parser_gen.cpp" break; case 4: -#line 287 "pipeline_grammar.yy" +#line 289 "pipeline_grammar.yy" { *cst = YY_MOVE(yystack_[1].value.as<CNode>()); } -#line 1666 "pipeline_parser_gen.cpp" +#line 1686 "pipeline_parser_gen.cpp" break; case 5: -#line 293 "pipeline_grammar.yy" +#line 295 "pipeline_grammar.yy" { } -#line 1672 "pipeline_parser_gen.cpp" +#line 1692 "pipeline_parser_gen.cpp" break; case 6: -#line 294 "pipeline_grammar.yy" +#line 296 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ArrayChildren{YY_MOVE(yystack_[2].value.as<CNode>())}}; } -#line 1680 "pipeline_parser_gen.cpp" +#line 1700 "pipeline_parser_gen.cpp" break; case 7: -#line 302 "pipeline_grammar.yy" +#line 304 "pipeline_grammar.yy" { lexer.sortObjTokens(); } -#line 1686 "pipeline_parser_gen.cpp" +#line 1706 "pipeline_parser_gen.cpp" break; case 9: -#line 305 "pipeline_grammar.yy" +#line 307 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1692 "pipeline_parser_gen.cpp" +#line 1712 "pipeline_parser_gen.cpp" break; case 10: -#line 305 "pipeline_grammar.yy" +#line 307 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1698 "pipeline_parser_gen.cpp" +#line 1718 "pipeline_parser_gen.cpp" break; case 11: -#line 305 "pipeline_grammar.yy" +#line 307 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1704 "pipeline_parser_gen.cpp" +#line 1724 "pipeline_parser_gen.cpp" break; case 12: -#line 305 "pipeline_grammar.yy" +#line 307 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1710 "pipeline_parser_gen.cpp" +#line 1730 "pipeline_parser_gen.cpp" break; case 13: -#line 305 "pipeline_grammar.yy" +#line 307 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1716 "pipeline_parser_gen.cpp" +#line 1736 "pipeline_parser_gen.cpp" break; case 14: -#line 305 "pipeline_grammar.yy" +#line 307 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1722 "pipeline_parser_gen.cpp" +#line 1742 "pipeline_parser_gen.cpp" break; case 15: -#line 308 "pipeline_grammar.yy" +#line 310 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{std::pair{ KeyFieldname::sample, @@ -1681,20 +1701,20 @@ int PipelineParserGen::parse() { {KeyFieldname::sizeArg, YY_MOVE(yystack_[1].value.as<CNode>())}, }}}}}; } -#line 1734 "pipeline_parser_gen.cpp" +#line 1754 "pipeline_parser_gen.cpp" break; case 16: -#line 318 "pipeline_grammar.yy" +#line 320 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ std::pair{KeyFieldname::inhibitOptimization, CNode::noopLeaf()}}}; } -#line 1742 "pipeline_parser_gen.cpp" +#line 1762 "pipeline_parser_gen.cpp" break; case 17: -#line 324 "pipeline_grammar.yy" +#line 326 "pipeline_grammar.yy" { auto pipeline = YY_MOVE(yystack_[1].value.as<CNode>()); yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{std::pair{ @@ -1703,61 +1723,61 @@ int PipelineParserGen::parse() { {KeyFieldname::collArg, YY_MOVE(yystack_[3].value.as<CNode>())}, {KeyFieldname::pipelineArg, std::move(pipeline)}}}}}}; } -#line 1755 "pipeline_parser_gen.cpp" +#line 1775 "pipeline_parser_gen.cpp" break; case 18: -#line 334 "pipeline_grammar.yy" +#line 336 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1761 "pipeline_parser_gen.cpp" +#line 1781 "pipeline_parser_gen.cpp" break; case 19: -#line 334 "pipeline_grammar.yy" +#line 336 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1767 "pipeline_parser_gen.cpp" +#line 1787 "pipeline_parser_gen.cpp" break; case 20: -#line 334 "pipeline_grammar.yy" +#line 336 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1773 "pipeline_parser_gen.cpp" +#line 1793 "pipeline_parser_gen.cpp" break; case 21: -#line 334 "pipeline_grammar.yy" +#line 336 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1779 "pipeline_parser_gen.cpp" +#line 1799 "pipeline_parser_gen.cpp" break; case 22: -#line 338 "pipeline_grammar.yy" +#line 340 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ std::pair{KeyFieldname::skip, YY_MOVE(yystack_[0].value.as<CNode>())}}}; } -#line 1787 "pipeline_parser_gen.cpp" +#line 1807 "pipeline_parser_gen.cpp" break; case 23: -#line 343 "pipeline_grammar.yy" +#line 345 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{std::pair{ KeyFieldname::limit, YY_MOVE(yystack_[0].value.as<CNode>())}}}; } -#line 1795 "pipeline_parser_gen.cpp" +#line 1815 "pipeline_parser_gen.cpp" break; case 24: -#line 348 "pipeline_grammar.yy" +#line 350 "pipeline_grammar.yy" { auto&& fields = YY_MOVE(yystack_[1].value.as<CNode>()); if (auto inclusion = @@ -1773,244 +1793,244 @@ int PipelineParserGen::parse() { // function. error(yystack_[3].location, inclusion.getStatus().reason()); } -#line 1813 "pipeline_parser_gen.cpp" +#line 1833 "pipeline_parser_gen.cpp" break; case 25: -#line 364 "pipeline_grammar.yy" +#line 366 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode::noopLeaf(); } -#line 1821 "pipeline_parser_gen.cpp" +#line 1841 "pipeline_parser_gen.cpp" break; case 26: -#line 367 "pipeline_grammar.yy" +#line 369 "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 1830 "pipeline_parser_gen.cpp" +#line 1850 "pipeline_parser_gen.cpp" break; case 27: -#line 374 "pipeline_grammar.yy" +#line 376 "pipeline_grammar.yy" { yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = { KeyFieldname::id, YY_MOVE(yystack_[0].value.as<CNode>())}; } -#line 1838 "pipeline_parser_gen.cpp" +#line 1858 "pipeline_parser_gen.cpp" break; case 28: -#line 377 "pipeline_grammar.yy" +#line 379 "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 1846 "pipeline_parser_gen.cpp" +#line 1866 "pipeline_parser_gen.cpp" break; case 29: -#line 383 "pipeline_grammar.yy" +#line 385 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1852 "pipeline_parser_gen.cpp" +#line 1872 "pipeline_parser_gen.cpp" break; case 30: -#line 384 "pipeline_grammar.yy" +#line 386 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1858 "pipeline_parser_gen.cpp" +#line 1878 "pipeline_parser_gen.cpp" break; case 31: -#line 385 "pipeline_grammar.yy" +#line 387 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1864 "pipeline_parser_gen.cpp" +#line 1884 "pipeline_parser_gen.cpp" break; case 32: -#line 386 "pipeline_grammar.yy" +#line 388 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1870 "pipeline_parser_gen.cpp" +#line 1890 "pipeline_parser_gen.cpp" break; case 33: -#line 387 "pipeline_grammar.yy" +#line 389 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1876 "pipeline_parser_gen.cpp" +#line 1896 "pipeline_parser_gen.cpp" break; case 34: -#line 388 "pipeline_grammar.yy" +#line 390 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1882 "pipeline_parser_gen.cpp" +#line 1902 "pipeline_parser_gen.cpp" break; case 35: -#line 389 "pipeline_grammar.yy" +#line 391 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1888 "pipeline_parser_gen.cpp" +#line 1908 "pipeline_parser_gen.cpp" break; case 36: -#line 390 "pipeline_grammar.yy" +#line 392 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1894 "pipeline_parser_gen.cpp" +#line 1914 "pipeline_parser_gen.cpp" break; case 37: -#line 391 "pipeline_grammar.yy" +#line 393 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1900 "pipeline_parser_gen.cpp" +#line 1920 "pipeline_parser_gen.cpp" break; case 38: -#line 392 "pipeline_grammar.yy" +#line 394 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1906 "pipeline_parser_gen.cpp" +#line 1926 "pipeline_parser_gen.cpp" break; case 39: -#line 393 "pipeline_grammar.yy" +#line 395 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1912 "pipeline_parser_gen.cpp" +#line 1932 "pipeline_parser_gen.cpp" break; case 40: -#line 394 "pipeline_grammar.yy" +#line 396 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{NonZeroKey{YY_MOVE(yystack_[0].value.as<int>())}}; } -#line 1920 "pipeline_parser_gen.cpp" +#line 1940 "pipeline_parser_gen.cpp" break; case 41: -#line 397 "pipeline_grammar.yy" +#line 399 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{KeyValue::intZeroKey}; } -#line 1928 "pipeline_parser_gen.cpp" +#line 1948 "pipeline_parser_gen.cpp" break; case 42: -#line 400 "pipeline_grammar.yy" +#line 402 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{NonZeroKey{YY_MOVE(yystack_[0].value.as<long long>())}}; } -#line 1936 "pipeline_parser_gen.cpp" +#line 1956 "pipeline_parser_gen.cpp" break; case 43: -#line 403 "pipeline_grammar.yy" +#line 405 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{KeyValue::longZeroKey}; } -#line 1944 "pipeline_parser_gen.cpp" +#line 1964 "pipeline_parser_gen.cpp" break; case 44: -#line 406 "pipeline_grammar.yy" +#line 408 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{NonZeroKey{YY_MOVE(yystack_[0].value.as<double>())}}; } -#line 1952 "pipeline_parser_gen.cpp" +#line 1972 "pipeline_parser_gen.cpp" break; case 45: -#line 409 "pipeline_grammar.yy" +#line 411 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{KeyValue::doubleZeroKey}; } -#line 1960 "pipeline_parser_gen.cpp" +#line 1980 "pipeline_parser_gen.cpp" break; case 46: -#line 412 "pipeline_grammar.yy" +#line 414 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{NonZeroKey{YY_MOVE(yystack_[0].value.as<Decimal128>())}}; } -#line 1968 "pipeline_parser_gen.cpp" +#line 1988 "pipeline_parser_gen.cpp" break; case 47: -#line 415 "pipeline_grammar.yy" +#line 417 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{KeyValue::decimalZeroKey}; } -#line 1976 "pipeline_parser_gen.cpp" +#line 1996 "pipeline_parser_gen.cpp" break; case 48: -#line 418 "pipeline_grammar.yy" +#line 420 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{KeyValue::trueKey}; } -#line 1984 "pipeline_parser_gen.cpp" +#line 2004 "pipeline_parser_gen.cpp" break; case 49: -#line 421 "pipeline_grammar.yy" +#line 423 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{KeyValue::falseKey}; } -#line 1992 "pipeline_parser_gen.cpp" +#line 2012 "pipeline_parser_gen.cpp" break; case 50: -#line 424 "pipeline_grammar.yy" +#line 426 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 1998 "pipeline_parser_gen.cpp" +#line 2018 "pipeline_parser_gen.cpp" break; case 51: -#line 425 "pipeline_grammar.yy" +#line 427 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2004 "pipeline_parser_gen.cpp" +#line 2024 "pipeline_parser_gen.cpp" break; case 52: -#line 426 "pipeline_grammar.yy" +#line 428 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2010 "pipeline_parser_gen.cpp" +#line 2030 "pipeline_parser_gen.cpp" break; case 53: -#line 427 "pipeline_grammar.yy" +#line 429 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = c_node_disambiguation::disambiguateCompoundProjection( @@ -2022,1608 +2042,1649 @@ int PipelineParserGen::parse() { "object project field cannot contain both inclusion and " "exclusion indicators"); } -#line 2021 "pipeline_parser_gen.cpp" +#line 2041 "pipeline_parser_gen.cpp" break; case 54: -#line 436 "pipeline_grammar.yy" +#line 438 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 2027 "pipeline_parser_gen.cpp" +#line 2047 "pipeline_parser_gen.cpp" break; case 55: -#line 436 "pipeline_grammar.yy" +#line 438 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 2033 "pipeline_parser_gen.cpp" +#line 2053 "pipeline_parser_gen.cpp" break; case 56: -#line 436 "pipeline_grammar.yy" +#line 438 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 2039 "pipeline_parser_gen.cpp" +#line 2059 "pipeline_parser_gen.cpp" break; case 57: -#line 436 "pipeline_grammar.yy" +#line 438 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 2045 "pipeline_parser_gen.cpp" +#line 2065 "pipeline_parser_gen.cpp" break; case 58: -#line 440 "pipeline_grammar.yy" +#line 442 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{std::pair{ KeyFieldname::match, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 2053 "pipeline_parser_gen.cpp" +#line 2073 "pipeline_parser_gen.cpp" break; case 59: -#line 446 "pipeline_grammar.yy" +#line 448 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode::noopLeaf(); } -#line 2061 "pipeline_parser_gen.cpp" +#line 2081 "pipeline_parser_gen.cpp" break; case 60: -#line 449 "pipeline_grammar.yy" +#line 451 "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 2070 "pipeline_parser_gen.cpp" +#line 2090 "pipeline_parser_gen.cpp" break; case 61: -#line 456 "pipeline_grammar.yy" +#line 458 "pipeline_grammar.yy" { yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = { KeyFieldname::id, YY_MOVE(yystack_[0].value.as<CNode>())}; } -#line 2078 "pipeline_parser_gen.cpp" +#line 2098 "pipeline_parser_gen.cpp" break; case 62: -#line 459 "pipeline_grammar.yy" +#line 461 "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 2086 "pipeline_parser_gen.cpp" +#line 2106 "pipeline_parser_gen.cpp" break; case 63: -#line 465 "pipeline_grammar.yy" +#line 467 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2092 "pipeline_parser_gen.cpp" +#line 2112 "pipeline_parser_gen.cpp" break; case 64: -#line 469 "pipeline_grammar.yy" +#line 471 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 2098 "pipeline_parser_gen.cpp" +#line 2118 "pipeline_parser_gen.cpp" break; case 65: -#line 469 "pipeline_grammar.yy" +#line 471 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 2104 "pipeline_parser_gen.cpp" +#line 2124 "pipeline_parser_gen.cpp" break; case 66: -#line 469 "pipeline_grammar.yy" +#line 471 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 2110 "pipeline_parser_gen.cpp" +#line 2130 "pipeline_parser_gen.cpp" break; case 67: -#line 469 "pipeline_grammar.yy" +#line 471 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 2116 "pipeline_parser_gen.cpp" +#line 2136 "pipeline_parser_gen.cpp" break; case 68: -#line 473 "pipeline_grammar.yy" +#line 475 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{YY_MOVE(yystack_[0].value.as<std::string>())}; } -#line 2124 "pipeline_parser_gen.cpp" +#line 2144 "pipeline_parser_gen.cpp" break; case 69: -#line 481 "pipeline_grammar.yy" +#line 483 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$_internalInhibitOptimization"}; } -#line 2132 "pipeline_parser_gen.cpp" +#line 2152 "pipeline_parser_gen.cpp" break; case 70: -#line 484 "pipeline_grammar.yy" +#line 486 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$unionWith"}; } -#line 2140 "pipeline_parser_gen.cpp" +#line 2160 "pipeline_parser_gen.cpp" break; case 71: -#line 487 "pipeline_grammar.yy" +#line 489 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$skip"}; } -#line 2148 "pipeline_parser_gen.cpp" +#line 2168 "pipeline_parser_gen.cpp" break; case 72: -#line 490 "pipeline_grammar.yy" +#line 492 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$limit"}; } -#line 2156 "pipeline_parser_gen.cpp" +#line 2176 "pipeline_parser_gen.cpp" break; case 73: -#line 493 "pipeline_grammar.yy" +#line 495 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$project"}; } -#line 2164 "pipeline_parser_gen.cpp" +#line 2184 "pipeline_parser_gen.cpp" break; case 74: -#line 496 "pipeline_grammar.yy" +#line 498 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$sample"}; } -#line 2172 "pipeline_parser_gen.cpp" +#line 2192 "pipeline_parser_gen.cpp" break; case 75: -#line 505 "pipeline_grammar.yy" +#line 507 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"coll"}; } -#line 2180 "pipeline_parser_gen.cpp" +#line 2200 "pipeline_parser_gen.cpp" break; case 76: -#line 508 "pipeline_grammar.yy" +#line 510 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"pipeline"}; } -#line 2188 "pipeline_parser_gen.cpp" +#line 2208 "pipeline_parser_gen.cpp" break; case 77: -#line 511 "pipeline_grammar.yy" +#line 513 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"size"}; } -#line 2196 "pipeline_parser_gen.cpp" +#line 2216 "pipeline_parser_gen.cpp" break; case 78: -#line 514 "pipeline_grammar.yy" +#line 516 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"input"}; } -#line 2204 "pipeline_parser_gen.cpp" +#line 2224 "pipeline_parser_gen.cpp" break; case 79: -#line 517 "pipeline_grammar.yy" +#line 519 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"to"}; } -#line 2212 "pipeline_parser_gen.cpp" +#line 2232 "pipeline_parser_gen.cpp" break; case 80: -#line 520 "pipeline_grammar.yy" +#line 522 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"onError"}; } -#line 2220 "pipeline_parser_gen.cpp" +#line 2240 "pipeline_parser_gen.cpp" break; case 81: -#line 523 "pipeline_grammar.yy" +#line 525 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"onNull"}; } -#line 2228 "pipeline_parser_gen.cpp" +#line 2248 "pipeline_parser_gen.cpp" break; case 82: -#line 526 "pipeline_grammar.yy" +#line 528 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"dateString"}; } -#line 2236 "pipeline_parser_gen.cpp" +#line 2256 "pipeline_parser_gen.cpp" break; case 83: -#line 529 "pipeline_grammar.yy" +#line 531 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"format"}; } -#line 2244 "pipeline_parser_gen.cpp" +#line 2264 "pipeline_parser_gen.cpp" break; case 84: -#line 532 "pipeline_grammar.yy" +#line 534 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"timezone"}; } -#line 2252 "pipeline_parser_gen.cpp" +#line 2272 "pipeline_parser_gen.cpp" break; case 85: -#line 535 "pipeline_grammar.yy" +#line 537 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"date"}; } -#line 2260 "pipeline_parser_gen.cpp" +#line 2280 "pipeline_parser_gen.cpp" break; case 86: -#line 538 "pipeline_grammar.yy" +#line 540 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"chars"}; } -#line 2268 "pipeline_parser_gen.cpp" +#line 2288 "pipeline_parser_gen.cpp" break; case 87: -#line 541 "pipeline_grammar.yy" +#line 543 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"regex"}; } -#line 2276 "pipeline_parser_gen.cpp" +#line 2296 "pipeline_parser_gen.cpp" break; case 88: -#line 544 "pipeline_grammar.yy" +#line 546 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"options"}; } -#line 2284 "pipeline_parser_gen.cpp" +#line 2304 "pipeline_parser_gen.cpp" break; case 89: -#line 547 "pipeline_grammar.yy" +#line 549 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"find"}; } -#line 2292 "pipeline_parser_gen.cpp" +#line 2312 "pipeline_parser_gen.cpp" break; case 90: -#line 550 "pipeline_grammar.yy" +#line 552 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"replacement"}; } -#line 2300 "pipeline_parser_gen.cpp" +#line 2320 "pipeline_parser_gen.cpp" break; case 91: -#line 558 "pipeline_grammar.yy" +#line 560 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$add"}; } -#line 2308 "pipeline_parser_gen.cpp" +#line 2328 "pipeline_parser_gen.cpp" break; case 92: -#line 561 "pipeline_grammar.yy" +#line 563 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$atan2"}; } -#line 2316 "pipeline_parser_gen.cpp" +#line 2336 "pipeline_parser_gen.cpp" break; case 93: -#line 564 "pipeline_grammar.yy" +#line 566 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$and"}; } -#line 2324 "pipeline_parser_gen.cpp" +#line 2344 "pipeline_parser_gen.cpp" break; case 94: -#line 567 "pipeline_grammar.yy" +#line 569 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$const"}; } -#line 2332 "pipeline_parser_gen.cpp" +#line 2352 "pipeline_parser_gen.cpp" break; case 95: -#line 570 "pipeline_grammar.yy" +#line 572 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$literal"}; } -#line 2340 "pipeline_parser_gen.cpp" +#line 2360 "pipeline_parser_gen.cpp" break; case 96: -#line 573 "pipeline_grammar.yy" +#line 575 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$or"}; } -#line 2348 "pipeline_parser_gen.cpp" +#line 2368 "pipeline_parser_gen.cpp" break; case 97: -#line 576 "pipeline_grammar.yy" +#line 578 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$not"}; } -#line 2356 "pipeline_parser_gen.cpp" +#line 2376 "pipeline_parser_gen.cpp" break; case 98: -#line 579 "pipeline_grammar.yy" +#line 581 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$cmp"}; } -#line 2364 "pipeline_parser_gen.cpp" +#line 2384 "pipeline_parser_gen.cpp" break; case 99: -#line 582 "pipeline_grammar.yy" +#line 584 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$eq"}; } -#line 2372 "pipeline_parser_gen.cpp" +#line 2392 "pipeline_parser_gen.cpp" break; case 100: -#line 585 "pipeline_grammar.yy" +#line 587 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$gt"}; } -#line 2380 "pipeline_parser_gen.cpp" +#line 2400 "pipeline_parser_gen.cpp" break; case 101: -#line 588 "pipeline_grammar.yy" +#line 590 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$gte"}; } -#line 2388 "pipeline_parser_gen.cpp" +#line 2408 "pipeline_parser_gen.cpp" break; case 102: -#line 591 "pipeline_grammar.yy" +#line 593 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$lt"}; } -#line 2396 "pipeline_parser_gen.cpp" +#line 2416 "pipeline_parser_gen.cpp" break; case 103: -#line 594 "pipeline_grammar.yy" +#line 596 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$lte"}; } -#line 2404 "pipeline_parser_gen.cpp" +#line 2424 "pipeline_parser_gen.cpp" break; case 104: -#line 597 "pipeline_grammar.yy" +#line 599 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$ne"}; } -#line 2412 "pipeline_parser_gen.cpp" +#line 2432 "pipeline_parser_gen.cpp" break; case 105: -#line 600 "pipeline_grammar.yy" +#line 602 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$convert"}; } -#line 2420 "pipeline_parser_gen.cpp" +#line 2440 "pipeline_parser_gen.cpp" break; case 106: -#line 603 "pipeline_grammar.yy" +#line 605 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$toBool"}; } -#line 2428 "pipeline_parser_gen.cpp" +#line 2448 "pipeline_parser_gen.cpp" break; case 107: -#line 606 "pipeline_grammar.yy" +#line 608 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$toDate"}; } -#line 2436 "pipeline_parser_gen.cpp" +#line 2456 "pipeline_parser_gen.cpp" break; case 108: -#line 609 "pipeline_grammar.yy" +#line 611 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$toDecimal"}; } -#line 2444 "pipeline_parser_gen.cpp" +#line 2464 "pipeline_parser_gen.cpp" break; case 109: -#line 612 "pipeline_grammar.yy" +#line 614 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$toDouble"}; } -#line 2452 "pipeline_parser_gen.cpp" +#line 2472 "pipeline_parser_gen.cpp" break; case 110: -#line 615 "pipeline_grammar.yy" +#line 617 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$toInt"}; } -#line 2460 "pipeline_parser_gen.cpp" +#line 2480 "pipeline_parser_gen.cpp" break; case 111: -#line 618 "pipeline_grammar.yy" +#line 620 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$toLong"}; } -#line 2468 "pipeline_parser_gen.cpp" +#line 2488 "pipeline_parser_gen.cpp" break; case 112: -#line 621 "pipeline_grammar.yy" +#line 623 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$toObjectId"}; } -#line 2476 "pipeline_parser_gen.cpp" +#line 2496 "pipeline_parser_gen.cpp" break; case 113: -#line 624 "pipeline_grammar.yy" +#line 626 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$toString"}; } -#line 2484 "pipeline_parser_gen.cpp" +#line 2504 "pipeline_parser_gen.cpp" break; case 114: -#line 627 "pipeline_grammar.yy" +#line 629 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$type"}; } -#line 2492 "pipeline_parser_gen.cpp" +#line 2512 "pipeline_parser_gen.cpp" break; case 115: -#line 630 "pipeline_grammar.yy" +#line 632 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$abs"}; } -#line 2500 "pipeline_parser_gen.cpp" +#line 2520 "pipeline_parser_gen.cpp" break; case 116: -#line 633 "pipeline_grammar.yy" +#line 635 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$ceil"}; } -#line 2508 "pipeline_parser_gen.cpp" +#line 2528 "pipeline_parser_gen.cpp" break; case 117: -#line 636 "pipeline_grammar.yy" +#line 638 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$divide"}; } -#line 2516 "pipeline_parser_gen.cpp" +#line 2536 "pipeline_parser_gen.cpp" break; case 118: -#line 639 "pipeline_grammar.yy" +#line 641 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$exp"}; } -#line 2524 "pipeline_parser_gen.cpp" +#line 2544 "pipeline_parser_gen.cpp" break; case 119: -#line 642 "pipeline_grammar.yy" +#line 644 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$floor"}; } -#line 2532 "pipeline_parser_gen.cpp" +#line 2552 "pipeline_parser_gen.cpp" break; case 120: -#line 645 "pipeline_grammar.yy" +#line 647 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$ln"}; } -#line 2540 "pipeline_parser_gen.cpp" +#line 2560 "pipeline_parser_gen.cpp" break; case 121: -#line 648 "pipeline_grammar.yy" +#line 650 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$log"}; } -#line 2548 "pipeline_parser_gen.cpp" +#line 2568 "pipeline_parser_gen.cpp" break; case 122: -#line 651 "pipeline_grammar.yy" +#line 653 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$log10"}; } -#line 2556 "pipeline_parser_gen.cpp" +#line 2576 "pipeline_parser_gen.cpp" break; case 123: -#line 654 "pipeline_grammar.yy" +#line 656 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$mod"}; } -#line 2564 "pipeline_parser_gen.cpp" +#line 2584 "pipeline_parser_gen.cpp" break; case 124: -#line 657 "pipeline_grammar.yy" +#line 659 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$multiply"}; } -#line 2572 "pipeline_parser_gen.cpp" +#line 2592 "pipeline_parser_gen.cpp" break; case 125: -#line 660 "pipeline_grammar.yy" +#line 662 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$pow"}; } -#line 2580 "pipeline_parser_gen.cpp" +#line 2600 "pipeline_parser_gen.cpp" break; case 126: -#line 663 "pipeline_grammar.yy" +#line 665 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$round"}; } -#line 2588 "pipeline_parser_gen.cpp" +#line 2608 "pipeline_parser_gen.cpp" break; case 127: -#line 666 "pipeline_grammar.yy" +#line 668 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$sqrt"}; } -#line 2596 "pipeline_parser_gen.cpp" +#line 2616 "pipeline_parser_gen.cpp" break; case 128: -#line 669 "pipeline_grammar.yy" +#line 671 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$subtract"}; } -#line 2604 "pipeline_parser_gen.cpp" +#line 2624 "pipeline_parser_gen.cpp" break; case 129: -#line 672 "pipeline_grammar.yy" +#line 674 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$trunc"}; } -#line 2612 "pipeline_parser_gen.cpp" +#line 2632 "pipeline_parser_gen.cpp" break; case 130: -#line 675 "pipeline_grammar.yy" +#line 677 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$concat"}; } -#line 2620 "pipeline_parser_gen.cpp" +#line 2640 "pipeline_parser_gen.cpp" break; case 131: -#line 678 "pipeline_grammar.yy" +#line 680 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$dateFromString"}; } -#line 2628 "pipeline_parser_gen.cpp" +#line 2648 "pipeline_parser_gen.cpp" break; case 132: -#line 681 "pipeline_grammar.yy" +#line 683 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$dateToString"}; } -#line 2636 "pipeline_parser_gen.cpp" +#line 2656 "pipeline_parser_gen.cpp" break; case 133: -#line 684 "pipeline_grammar.yy" +#line 686 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$indexOfBytes"}; } -#line 2644 "pipeline_parser_gen.cpp" +#line 2664 "pipeline_parser_gen.cpp" break; case 134: -#line 687 "pipeline_grammar.yy" +#line 689 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$indexOfCP"}; } -#line 2652 "pipeline_parser_gen.cpp" +#line 2672 "pipeline_parser_gen.cpp" break; case 135: -#line 690 "pipeline_grammar.yy" +#line 692 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$ltrim"}; } -#line 2660 "pipeline_parser_gen.cpp" +#line 2680 "pipeline_parser_gen.cpp" break; case 136: -#line 693 "pipeline_grammar.yy" +#line 695 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$regexFind"}; } -#line 2668 "pipeline_parser_gen.cpp" +#line 2688 "pipeline_parser_gen.cpp" break; case 137: -#line 696 "pipeline_grammar.yy" +#line 698 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$regexFindAll"}; } -#line 2676 "pipeline_parser_gen.cpp" +#line 2696 "pipeline_parser_gen.cpp" break; case 138: -#line 699 "pipeline_grammar.yy" +#line 701 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$regexMatch"}; } -#line 2684 "pipeline_parser_gen.cpp" +#line 2704 "pipeline_parser_gen.cpp" break; case 139: -#line 702 "pipeline_grammar.yy" +#line 704 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$replaceOne"}; } -#line 2692 "pipeline_parser_gen.cpp" +#line 2712 "pipeline_parser_gen.cpp" break; case 140: -#line 705 "pipeline_grammar.yy" +#line 707 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$replaceAll"}; } -#line 2700 "pipeline_parser_gen.cpp" +#line 2720 "pipeline_parser_gen.cpp" break; case 141: -#line 708 "pipeline_grammar.yy" +#line 710 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$rtrim"}; } -#line 2708 "pipeline_parser_gen.cpp" +#line 2728 "pipeline_parser_gen.cpp" break; case 142: -#line 711 "pipeline_grammar.yy" +#line 713 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$split"}; } -#line 2716 "pipeline_parser_gen.cpp" +#line 2736 "pipeline_parser_gen.cpp" break; case 143: -#line 714 "pipeline_grammar.yy" +#line 716 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$strLenBytes"}; } -#line 2724 "pipeline_parser_gen.cpp" +#line 2744 "pipeline_parser_gen.cpp" break; case 144: -#line 717 "pipeline_grammar.yy" +#line 719 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$strLenCP"}; } -#line 2732 "pipeline_parser_gen.cpp" +#line 2752 "pipeline_parser_gen.cpp" break; case 145: -#line 720 "pipeline_grammar.yy" +#line 722 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$strcasecmp"}; } -#line 2740 "pipeline_parser_gen.cpp" +#line 2760 "pipeline_parser_gen.cpp" break; case 146: -#line 723 "pipeline_grammar.yy" +#line 725 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$substr"}; } -#line 2748 "pipeline_parser_gen.cpp" +#line 2768 "pipeline_parser_gen.cpp" break; case 147: -#line 726 "pipeline_grammar.yy" +#line 728 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$substrBytes"}; } -#line 2756 "pipeline_parser_gen.cpp" +#line 2776 "pipeline_parser_gen.cpp" break; case 148: -#line 729 "pipeline_grammar.yy" +#line 731 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$substrCP"}; } -#line 2764 "pipeline_parser_gen.cpp" +#line 2784 "pipeline_parser_gen.cpp" break; case 149: -#line 732 "pipeline_grammar.yy" +#line 734 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$toLower"}; } -#line 2772 "pipeline_parser_gen.cpp" +#line 2792 "pipeline_parser_gen.cpp" break; case 150: -#line 735 "pipeline_grammar.yy" +#line 737 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$trim"}; } -#line 2780 "pipeline_parser_gen.cpp" +#line 2800 "pipeline_parser_gen.cpp" break; case 151: -#line 738 "pipeline_grammar.yy" +#line 740 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = UserFieldname{"$toUpper"}; } -#line 2788 "pipeline_parser_gen.cpp" +#line 2808 "pipeline_parser_gen.cpp" break; case 152: -#line 745 "pipeline_grammar.yy" +#line 747 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{UserString{YY_MOVE(yystack_[0].value.as<std::string>())}}; } -#line 2796 "pipeline_parser_gen.cpp" +#line 2816 "pipeline_parser_gen.cpp" break; case 153: -#line 751 "pipeline_grammar.yy" +#line 752 "pipeline_grammar.yy" { - yylhs.value.as<CNode>() = - CNode{UserBinary{YY_MOVE(yystack_[0].value.as<BSONBinData>())}}; + std::string str = YY_MOVE(yystack_[0].value.as<std::string>()); + if (str.size() == 1) { + error(yystack_[0].location, "'$' by iteslf is not a valid FieldPath"); + } + yylhs.value.as<CNode>() = CNode{UserFieldPath{str.substr(1), false}}; } -#line 2804 "pipeline_parser_gen.cpp" +#line 2828 "pipeline_parser_gen.cpp" break; case 154: -#line 757 "pipeline_grammar.yy" +#line 760 "pipeline_grammar.yy" { - yylhs.value.as<CNode>() = CNode{UserUndefined{}}; + std::string str = YY_MOVE(yystack_[0].value.as<std::string>()).substr(2); + auto status = c_node_validation::validateVariableName(str); + if (!status.isOK()) { + error(yystack_[0].location, status.reason()); + } + yylhs.value.as<CNode>() = CNode{UserFieldPath{str, true}}; } -#line 2812 "pipeline_parser_gen.cpp" +#line 2841 "pipeline_parser_gen.cpp" break; case 155: -#line 763 "pipeline_grammar.yy" +#line 769 "pipeline_grammar.yy" { - yylhs.value.as<CNode>() = CNode{UserObjectId{}}; + yylhs.value.as<CNode>() = + CNode{UserBinary{YY_MOVE(yystack_[0].value.as<BSONBinData>())}}; } -#line 2820 "pipeline_parser_gen.cpp" +#line 2849 "pipeline_parser_gen.cpp" break; case 156: -#line 769 "pipeline_grammar.yy" +#line 775 "pipeline_grammar.yy" { - yylhs.value.as<CNode>() = - CNode{UserDate{YY_MOVE(yystack_[0].value.as<Date_t>())}}; + yylhs.value.as<CNode>() = CNode{UserUndefined{}}; } -#line 2828 "pipeline_parser_gen.cpp" +#line 2857 "pipeline_parser_gen.cpp" break; case 157: -#line 775 "pipeline_grammar.yy" +#line 781 "pipeline_grammar.yy" { - yylhs.value.as<CNode>() = CNode{UserNull{}}; + yylhs.value.as<CNode>() = CNode{UserObjectId{}}; } -#line 2836 "pipeline_parser_gen.cpp" +#line 2865 "pipeline_parser_gen.cpp" break; case 158: -#line 781 "pipeline_grammar.yy" +#line 787 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = - CNode{UserRegex{YY_MOVE(yystack_[0].value.as<BSONRegEx>())}}; + CNode{UserDate{YY_MOVE(yystack_[0].value.as<Date_t>())}}; } -#line 2844 "pipeline_parser_gen.cpp" +#line 2873 "pipeline_parser_gen.cpp" break; case 159: -#line 787 "pipeline_grammar.yy" +#line 793 "pipeline_grammar.yy" { - yylhs.value.as<CNode>() = - CNode{UserDBPointer{YY_MOVE(yystack_[0].value.as<BSONDBRef>())}}; + yylhs.value.as<CNode>() = CNode{UserNull{}}; } -#line 2852 "pipeline_parser_gen.cpp" +#line 2881 "pipeline_parser_gen.cpp" break; case 160: -#line 793 "pipeline_grammar.yy" +#line 799 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = - CNode{UserJavascript{YY_MOVE(yystack_[0].value.as<BSONCode>())}}; + CNode{UserRegex{YY_MOVE(yystack_[0].value.as<BSONRegEx>())}}; } -#line 2860 "pipeline_parser_gen.cpp" +#line 2889 "pipeline_parser_gen.cpp" break; case 161: -#line 799 "pipeline_grammar.yy" +#line 805 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = - CNode{UserSymbol{YY_MOVE(yystack_[0].value.as<BSONSymbol>())}}; + CNode{UserDBPointer{YY_MOVE(yystack_[0].value.as<BSONDBRef>())}}; } -#line 2868 "pipeline_parser_gen.cpp" +#line 2897 "pipeline_parser_gen.cpp" break; case 162: -#line 805 "pipeline_grammar.yy" +#line 811 "pipeline_grammar.yy" { - yylhs.value.as<CNode>() = CNode{UserJavascriptWithScope{ - YY_MOVE(yystack_[0].value.as<BSONCodeWScope>())}}; + yylhs.value.as<CNode>() = + CNode{UserJavascript{YY_MOVE(yystack_[0].value.as<BSONCode>())}}; } -#line 2876 "pipeline_parser_gen.cpp" +#line 2905 "pipeline_parser_gen.cpp" break; case 163: -#line 811 "pipeline_grammar.yy" +#line 817 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = - CNode{UserTimestamp{YY_MOVE(yystack_[0].value.as<Timestamp>())}}; + CNode{UserSymbol{YY_MOVE(yystack_[0].value.as<BSONSymbol>())}}; } -#line 2884 "pipeline_parser_gen.cpp" +#line 2913 "pipeline_parser_gen.cpp" break; case 164: -#line 817 "pipeline_grammar.yy" +#line 823 "pipeline_grammar.yy" { - yylhs.value.as<CNode>() = - CNode{UserMinKey{YY_MOVE(yystack_[0].value.as<UserMinKey>())}}; + yylhs.value.as<CNode>() = CNode{UserJavascriptWithScope{ + YY_MOVE(yystack_[0].value.as<BSONCodeWScope>())}}; } -#line 2892 "pipeline_parser_gen.cpp" +#line 2921 "pipeline_parser_gen.cpp" break; case 165: -#line 823 "pipeline_grammar.yy" +#line 829 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = - CNode{UserMaxKey{YY_MOVE(yystack_[0].value.as<UserMaxKey>())}}; + CNode{UserTimestamp{YY_MOVE(yystack_[0].value.as<Timestamp>())}}; } -#line 2900 "pipeline_parser_gen.cpp" +#line 2929 "pipeline_parser_gen.cpp" break; case 166: -#line 829 "pipeline_grammar.yy" +#line 835 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = - CNode{UserInt{YY_MOVE(yystack_[0].value.as<int>())}}; + CNode{UserMinKey{YY_MOVE(yystack_[0].value.as<UserMinKey>())}}; } -#line 2908 "pipeline_parser_gen.cpp" +#line 2937 "pipeline_parser_gen.cpp" break; case 167: -#line 832 "pipeline_grammar.yy" +#line 841 "pipeline_grammar.yy" { - yylhs.value.as<CNode>() = CNode{UserInt{0}}; + yylhs.value.as<CNode>() = + CNode{UserMaxKey{YY_MOVE(yystack_[0].value.as<UserMaxKey>())}}; } -#line 2916 "pipeline_parser_gen.cpp" +#line 2945 "pipeline_parser_gen.cpp" break; case 168: -#line 838 "pipeline_grammar.yy" +#line 847 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = - CNode{UserLong{YY_MOVE(yystack_[0].value.as<long long>())}}; + CNode{UserInt{YY_MOVE(yystack_[0].value.as<int>())}}; } -#line 2924 "pipeline_parser_gen.cpp" +#line 2953 "pipeline_parser_gen.cpp" break; case 169: -#line 841 "pipeline_grammar.yy" +#line 850 "pipeline_grammar.yy" { - yylhs.value.as<CNode>() = CNode{UserLong{0ll}}; + yylhs.value.as<CNode>() = CNode{UserInt{0}}; } -#line 2932 "pipeline_parser_gen.cpp" +#line 2961 "pipeline_parser_gen.cpp" break; case 170: -#line 847 "pipeline_grammar.yy" +#line 856 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = - CNode{UserDouble{YY_MOVE(yystack_[0].value.as<double>())}}; + CNode{UserLong{YY_MOVE(yystack_[0].value.as<long long>())}}; } -#line 2940 "pipeline_parser_gen.cpp" +#line 2969 "pipeline_parser_gen.cpp" break; case 171: -#line 850 "pipeline_grammar.yy" +#line 859 "pipeline_grammar.yy" { - yylhs.value.as<CNode>() = CNode{UserDouble{0.0}}; + yylhs.value.as<CNode>() = CNode{UserLong{0ll}}; } -#line 2948 "pipeline_parser_gen.cpp" +#line 2977 "pipeline_parser_gen.cpp" break; case 172: -#line 856 "pipeline_grammar.yy" +#line 865 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = - CNode{UserDecimal{YY_MOVE(yystack_[0].value.as<Decimal128>())}}; + CNode{UserDouble{YY_MOVE(yystack_[0].value.as<double>())}}; } -#line 2956 "pipeline_parser_gen.cpp" +#line 2985 "pipeline_parser_gen.cpp" break; case 173: -#line 859 "pipeline_grammar.yy" +#line 868 "pipeline_grammar.yy" { - yylhs.value.as<CNode>() = CNode{UserDecimal{0.0}}; + yylhs.value.as<CNode>() = CNode{UserDouble{0.0}}; } -#line 2964 "pipeline_parser_gen.cpp" +#line 2993 "pipeline_parser_gen.cpp" break; case 174: -#line 865 "pipeline_grammar.yy" +#line 874 "pipeline_grammar.yy" { - yylhs.value.as<CNode>() = CNode{UserBoolean{true}}; + yylhs.value.as<CNode>() = + CNode{UserDecimal{YY_MOVE(yystack_[0].value.as<Decimal128>())}}; } -#line 2972 "pipeline_parser_gen.cpp" +#line 3001 "pipeline_parser_gen.cpp" break; case 175: -#line 868 "pipeline_grammar.yy" +#line 877 "pipeline_grammar.yy" { - yylhs.value.as<CNode>() = CNode{UserBoolean{false}}; + yylhs.value.as<CNode>() = CNode{UserDecimal{0.0}}; } -#line 2980 "pipeline_parser_gen.cpp" +#line 3009 "pipeline_parser_gen.cpp" break; case 176: -#line 874 "pipeline_grammar.yy" +#line 883 "pipeline_grammar.yy" { - yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); + yylhs.value.as<CNode>() = CNode{UserBoolean{true}}; } -#line 2986 "pipeline_parser_gen.cpp" +#line 3017 "pipeline_parser_gen.cpp" break; case 177: -#line 875 "pipeline_grammar.yy" +#line 886 "pipeline_grammar.yy" { - yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); + yylhs.value.as<CNode>() = CNode{UserBoolean{false}}; } -#line 2992 "pipeline_parser_gen.cpp" +#line 3025 "pipeline_parser_gen.cpp" break; case 178: -#line 876 "pipeline_grammar.yy" +#line 892 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 2998 "pipeline_parser_gen.cpp" +#line 3031 "pipeline_parser_gen.cpp" break; case 179: -#line 877 "pipeline_grammar.yy" +#line 893 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3004 "pipeline_parser_gen.cpp" +#line 3037 "pipeline_parser_gen.cpp" break; case 180: -#line 878 "pipeline_grammar.yy" +#line 894 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3010 "pipeline_parser_gen.cpp" +#line 3043 "pipeline_parser_gen.cpp" break; case 181: -#line 879 "pipeline_grammar.yy" +#line 895 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3016 "pipeline_parser_gen.cpp" +#line 3049 "pipeline_parser_gen.cpp" break; case 182: -#line 880 "pipeline_grammar.yy" +#line 896 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3022 "pipeline_parser_gen.cpp" +#line 3055 "pipeline_parser_gen.cpp" break; case 183: -#line 881 "pipeline_grammar.yy" +#line 897 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3028 "pipeline_parser_gen.cpp" +#line 3061 "pipeline_parser_gen.cpp" break; case 184: -#line 882 "pipeline_grammar.yy" +#line 898 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3034 "pipeline_parser_gen.cpp" +#line 3067 "pipeline_parser_gen.cpp" break; case 185: -#line 883 "pipeline_grammar.yy" +#line 899 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3040 "pipeline_parser_gen.cpp" +#line 3073 "pipeline_parser_gen.cpp" break; case 186: -#line 884 "pipeline_grammar.yy" +#line 900 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3046 "pipeline_parser_gen.cpp" +#line 3079 "pipeline_parser_gen.cpp" break; case 187: -#line 885 "pipeline_grammar.yy" +#line 901 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3052 "pipeline_parser_gen.cpp" +#line 3085 "pipeline_parser_gen.cpp" break; case 188: -#line 886 "pipeline_grammar.yy" +#line 902 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3058 "pipeline_parser_gen.cpp" +#line 3091 "pipeline_parser_gen.cpp" break; case 189: -#line 887 "pipeline_grammar.yy" +#line 903 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3064 "pipeline_parser_gen.cpp" +#line 3097 "pipeline_parser_gen.cpp" break; case 190: -#line 888 "pipeline_grammar.yy" +#line 904 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3070 "pipeline_parser_gen.cpp" +#line 3103 "pipeline_parser_gen.cpp" break; case 191: -#line 889 "pipeline_grammar.yy" +#line 905 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3076 "pipeline_parser_gen.cpp" +#line 3109 "pipeline_parser_gen.cpp" break; case 192: -#line 890 "pipeline_grammar.yy" +#line 906 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3082 "pipeline_parser_gen.cpp" +#line 3115 "pipeline_parser_gen.cpp" break; case 193: -#line 891 "pipeline_grammar.yy" +#line 907 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3088 "pipeline_parser_gen.cpp" +#line 3121 "pipeline_parser_gen.cpp" break; case 194: -#line 892 "pipeline_grammar.yy" +#line 908 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3094 "pipeline_parser_gen.cpp" +#line 3127 "pipeline_parser_gen.cpp" break; case 195: -#line 899 "pipeline_grammar.yy" +#line 909 "pipeline_grammar.yy" { + yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3100 "pipeline_parser_gen.cpp" +#line 3133 "pipeline_parser_gen.cpp" break; case 196: -#line 900 "pipeline_grammar.yy" +#line 910 "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>())); + yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3109 "pipeline_parser_gen.cpp" +#line 3139 "pipeline_parser_gen.cpp" break; case 197: -#line 907 "pipeline_grammar.yy" +#line 911 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3115 "pipeline_parser_gen.cpp" +#line 3145 "pipeline_parser_gen.cpp" break; case 198: -#line 907 "pipeline_grammar.yy" +#line 912 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3121 "pipeline_parser_gen.cpp" +#line 3151 "pipeline_parser_gen.cpp" break; case 199: -#line 911 "pipeline_grammar.yy" +#line 919 "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 3129 "pipeline_parser_gen.cpp" +#line 3157 "pipeline_parser_gen.cpp" break; case 200: -#line 916 "pipeline_grammar.yy" +#line 920 "pipeline_grammar.yy" { - yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); + 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 3135 "pipeline_parser_gen.cpp" +#line 3166 "pipeline_parser_gen.cpp" break; case 201: -#line 916 "pipeline_grammar.yy" +#line 927 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3141 "pipeline_parser_gen.cpp" +#line 3172 "pipeline_parser_gen.cpp" break; case 202: -#line 916 "pipeline_grammar.yy" +#line 927 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3147 "pipeline_parser_gen.cpp" +#line 3178 "pipeline_parser_gen.cpp" break; case 203: -#line 916 "pipeline_grammar.yy" +#line 931 "pipeline_grammar.yy" { - yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); + yylhs.value.as<CNode>() = + CNode{CNode::ArrayChildren{YY_MOVE(yystack_[2].value.as<CNode>()), + YY_MOVE(yystack_[1].value.as<CNode>())}}; } -#line 3153 "pipeline_parser_gen.cpp" +#line 3186 "pipeline_parser_gen.cpp" break; case 204: -#line 916 "pipeline_grammar.yy" +#line 936 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3159 "pipeline_parser_gen.cpp" +#line 3192 "pipeline_parser_gen.cpp" break; case 205: -#line 916 "pipeline_grammar.yy" +#line 936 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3165 "pipeline_parser_gen.cpp" +#line 3198 "pipeline_parser_gen.cpp" break; case 206: -#line 917 "pipeline_grammar.yy" +#line 936 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3171 "pipeline_parser_gen.cpp" +#line 3204 "pipeline_parser_gen.cpp" break; case 207: -#line 917 "pipeline_grammar.yy" +#line 936 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3177 "pipeline_parser_gen.cpp" +#line 3210 "pipeline_parser_gen.cpp" break; case 208: -#line 923 "pipeline_grammar.yy" +#line 936 "pipeline_grammar.yy" { - yylhs.value.as<CNode>() = - CNode{YY_MOVE(yystack_[1].value.as<std::vector<CNode>>())}; + yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3185 "pipeline_parser_gen.cpp" +#line 3216 "pipeline_parser_gen.cpp" break; case 209: -#line 931 "pipeline_grammar.yy" +#line 936 "pipeline_grammar.yy" { - yylhs.value.as<CNode>() = YY_MOVE(yystack_[1].value.as<CNode>()); + yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3193 "pipeline_parser_gen.cpp" +#line 3222 "pipeline_parser_gen.cpp" break; case 210: #line 937 "pipeline_grammar.yy" { - yylhs.value.as<CNode>() = CNode::noopLeaf(); + yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3201 "pipeline_parser_gen.cpp" +#line 3228 "pipeline_parser_gen.cpp" break; case 211: -#line 940 "pipeline_grammar.yy" +#line 937 "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>>())); + yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3210 "pipeline_parser_gen.cpp" +#line 3234 "pipeline_parser_gen.cpp" break; case 212: -#line 947 "pipeline_grammar.yy" +#line 943 "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>())}; + yylhs.value.as<CNode>() = + CNode{YY_MOVE(yystack_[1].value.as<std::vector<CNode>>())}; } -#line 3218 "pipeline_parser_gen.cpp" +#line 3242 "pipeline_parser_gen.cpp" break; case 213: -#line 954 "pipeline_grammar.yy" +#line 951 "pipeline_grammar.yy" { - yylhs.value.as<CNode::Fieldname>() = - YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); + yylhs.value.as<CNode>() = YY_MOVE(yystack_[1].value.as<CNode>()); } -#line 3224 "pipeline_parser_gen.cpp" +#line 3250 "pipeline_parser_gen.cpp" break; case 214: -#line 954 "pipeline_grammar.yy" +#line 957 "pipeline_grammar.yy" { - yylhs.value.as<CNode::Fieldname>() = - YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); + yylhs.value.as<CNode>() = CNode::noopLeaf(); } -#line 3230 "pipeline_parser_gen.cpp" +#line 3258 "pipeline_parser_gen.cpp" break; case 215: -#line 954 "pipeline_grammar.yy" +#line 960 "pipeline_grammar.yy" { - yylhs.value.as<CNode::Fieldname>() = - YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); + 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 3236 "pipeline_parser_gen.cpp" +#line 3267 "pipeline_parser_gen.cpp" break; case 216: -#line 954 "pipeline_grammar.yy" +#line 967 "pipeline_grammar.yy" { - yylhs.value.as<CNode::Fieldname>() = - YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); + yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = { + YY_MOVE(yystack_[1].value.as<CNode::Fieldname>()), + YY_MOVE(yystack_[0].value.as<CNode>())}; } -#line 3242 "pipeline_parser_gen.cpp" +#line 3275 "pipeline_parser_gen.cpp" break; case 217: -#line 958 "pipeline_grammar.yy" +#line 974 "pipeline_grammar.yy" { - yylhs.value.as<CNode::Fieldname>() = UserFieldname{"_id"}; + yylhs.value.as<CNode::Fieldname>() = + YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 3250 "pipeline_parser_gen.cpp" +#line 3281 "pipeline_parser_gen.cpp" break; case 218: -#line 964 "pipeline_grammar.yy" +#line 974 "pipeline_grammar.yy" { - yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); + yylhs.value.as<CNode::Fieldname>() = + YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 3256 "pipeline_parser_gen.cpp" +#line 3287 "pipeline_parser_gen.cpp" break; case 219: -#line 964 "pipeline_grammar.yy" +#line 974 "pipeline_grammar.yy" { - yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); + yylhs.value.as<CNode::Fieldname>() = + YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 3262 "pipeline_parser_gen.cpp" +#line 3293 "pipeline_parser_gen.cpp" break; case 220: -#line 964 "pipeline_grammar.yy" +#line 974 "pipeline_grammar.yy" { - yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); + yylhs.value.as<CNode::Fieldname>() = + YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 3268 "pipeline_parser_gen.cpp" +#line 3299 "pipeline_parser_gen.cpp" break; case 221: -#line 964 "pipeline_grammar.yy" +#line 978 "pipeline_grammar.yy" { - yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); + yylhs.value.as<CNode::Fieldname>() = UserFieldname{"_id"}; } -#line 3274 "pipeline_parser_gen.cpp" +#line 3307 "pipeline_parser_gen.cpp" break; case 222: -#line 964 "pipeline_grammar.yy" +#line 984 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3280 "pipeline_parser_gen.cpp" +#line 3313 "pipeline_parser_gen.cpp" break; case 223: -#line 964 "pipeline_grammar.yy" +#line 984 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3286 "pipeline_parser_gen.cpp" +#line 3319 "pipeline_parser_gen.cpp" break; case 224: -#line 964 "pipeline_grammar.yy" +#line 984 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3292 "pipeline_parser_gen.cpp" +#line 3325 "pipeline_parser_gen.cpp" break; case 225: -#line 964 "pipeline_grammar.yy" +#line 984 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3298 "pipeline_parser_gen.cpp" +#line 3331 "pipeline_parser_gen.cpp" break; case 226: -#line 964 "pipeline_grammar.yy" +#line 984 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3304 "pipeline_parser_gen.cpp" +#line 3337 "pipeline_parser_gen.cpp" break; case 227: -#line 964 "pipeline_grammar.yy" +#line 984 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3310 "pipeline_parser_gen.cpp" +#line 3343 "pipeline_parser_gen.cpp" break; case 228: -#line 964 "pipeline_grammar.yy" +#line 984 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3316 "pipeline_parser_gen.cpp" +#line 3349 "pipeline_parser_gen.cpp" break; case 229: -#line 964 "pipeline_grammar.yy" +#line 984 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3322 "pipeline_parser_gen.cpp" +#line 3355 "pipeline_parser_gen.cpp" break; case 230: -#line 964 "pipeline_grammar.yy" +#line 984 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3328 "pipeline_parser_gen.cpp" +#line 3361 "pipeline_parser_gen.cpp" break; case 231: -#line 965 "pipeline_grammar.yy" +#line 984 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3334 "pipeline_parser_gen.cpp" +#line 3367 "pipeline_parser_gen.cpp" break; case 232: -#line 965 "pipeline_grammar.yy" +#line 984 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3340 "pipeline_parser_gen.cpp" +#line 3373 "pipeline_parser_gen.cpp" break; case 233: -#line 965 "pipeline_grammar.yy" +#line 984 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3346 "pipeline_parser_gen.cpp" +#line 3379 "pipeline_parser_gen.cpp" break; case 234: -#line 965 "pipeline_grammar.yy" +#line 984 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3352 "pipeline_parser_gen.cpp" +#line 3385 "pipeline_parser_gen.cpp" break; case 235: -#line 969 "pipeline_grammar.yy" +#line 985 "pipeline_grammar.yy" + { + yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); + } +#line 3391 "pipeline_parser_gen.cpp" + break; + + case 236: +#line 985 "pipeline_grammar.yy" + { + yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); + } +#line 3397 "pipeline_parser_gen.cpp" + break; + + case 237: +#line 985 "pipeline_grammar.yy" + { + yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); + } +#line 3403 "pipeline_parser_gen.cpp" + break; + + case 238: +#line 985 "pipeline_grammar.yy" + { + yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); + } +#line 3409 "pipeline_parser_gen.cpp" + break; + + case 239: +#line 989 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::add, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3361 "pipeline_parser_gen.cpp" +#line 3418 "pipeline_parser_gen.cpp" break; - case 236: -#line 976 "pipeline_grammar.yy" + case 240: +#line 996 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::atan2, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3370 "pipeline_parser_gen.cpp" +#line 3427 "pipeline_parser_gen.cpp" break; - case 237: -#line 982 "pipeline_grammar.yy" + case 241: +#line 1002 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::abs, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3378 "pipeline_parser_gen.cpp" +#line 3435 "pipeline_parser_gen.cpp" break; - case 238: -#line 987 "pipeline_grammar.yy" + case 242: +#line 1007 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::ceil, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3386 "pipeline_parser_gen.cpp" +#line 3443 "pipeline_parser_gen.cpp" break; - case 239: -#line 992 "pipeline_grammar.yy" + case 243: +#line 1012 "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 3395 "pipeline_parser_gen.cpp" +#line 3452 "pipeline_parser_gen.cpp" break; - case 240: -#line 998 "pipeline_grammar.yy" + case 244: +#line 1018 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::exponent, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3403 "pipeline_parser_gen.cpp" +#line 3460 "pipeline_parser_gen.cpp" break; - case 241: -#line 1003 "pipeline_grammar.yy" + case 245: +#line 1023 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::floor, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3411 "pipeline_parser_gen.cpp" +#line 3468 "pipeline_parser_gen.cpp" break; - case 242: -#line 1008 "pipeline_grammar.yy" + case 246: +#line 1028 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::ln, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3419 "pipeline_parser_gen.cpp" +#line 3476 "pipeline_parser_gen.cpp" break; - case 243: -#line 1013 "pipeline_grammar.yy" + case 247: +#line 1033 "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 3428 "pipeline_parser_gen.cpp" +#line 3485 "pipeline_parser_gen.cpp" break; - case 244: -#line 1019 "pipeline_grammar.yy" + case 248: +#line 1039 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::logten, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3436 "pipeline_parser_gen.cpp" +#line 3493 "pipeline_parser_gen.cpp" break; - case 245: -#line 1024 "pipeline_grammar.yy" + case 249: +#line 1044 "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 3445 "pipeline_parser_gen.cpp" +#line 3502 "pipeline_parser_gen.cpp" break; - case 246: -#line 1030 "pipeline_grammar.yy" + case 250: +#line 1050 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::multiply, @@ -3634,292 +3695,292 @@ int PipelineParserGen::parse() { yylhs.value.as<CNode>().objectChildren()[0].second.arrayChildren(); array.insert(array.end(), others.begin(), others.end()); } -#line 3457 "pipeline_parser_gen.cpp" +#line 3514 "pipeline_parser_gen.cpp" break; - case 247: -#line 1039 "pipeline_grammar.yy" + case 251: +#line 1059 "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 3466 "pipeline_parser_gen.cpp" +#line 3523 "pipeline_parser_gen.cpp" break; - case 248: -#line 1045 "pipeline_grammar.yy" + case 252: +#line 1065 "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 3475 "pipeline_parser_gen.cpp" +#line 3532 "pipeline_parser_gen.cpp" break; - case 249: -#line 1051 "pipeline_grammar.yy" + case 253: +#line 1071 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::sqrt, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3483 "pipeline_parser_gen.cpp" +#line 3540 "pipeline_parser_gen.cpp" break; - case 250: -#line 1056 "pipeline_grammar.yy" + case 254: +#line 1076 "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 3492 "pipeline_parser_gen.cpp" +#line 3549 "pipeline_parser_gen.cpp" break; - case 251: -#line 1062 "pipeline_grammar.yy" + case 255: +#line 1082 "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 3501 "pipeline_parser_gen.cpp" +#line 3558 "pipeline_parser_gen.cpp" break; - case 252: -#line 1068 "pipeline_grammar.yy" + case 256: +#line 1088 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3507 "pipeline_parser_gen.cpp" +#line 3564 "pipeline_parser_gen.cpp" break; - case 253: -#line 1068 "pipeline_grammar.yy" + case 257: +#line 1088 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3513 "pipeline_parser_gen.cpp" +#line 3570 "pipeline_parser_gen.cpp" break; - case 254: -#line 1068 "pipeline_grammar.yy" + case 258: +#line 1088 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3519 "pipeline_parser_gen.cpp" +#line 3576 "pipeline_parser_gen.cpp" break; - case 255: -#line 1072 "pipeline_grammar.yy" + case 259: +#line 1092 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::andExpr, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3528 "pipeline_parser_gen.cpp" +#line 3585 "pipeline_parser_gen.cpp" break; - case 256: -#line 1079 "pipeline_grammar.yy" + case 260: +#line 1099 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::orExpr, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3537 "pipeline_parser_gen.cpp" +#line 3594 "pipeline_parser_gen.cpp" break; - case 257: -#line 1086 "pipeline_grammar.yy" + case 261: +#line 1106 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::notExpr, CNode{CNode::ArrayChildren{YY_MOVE(yystack_[2].value.as<CNode>())}}}}}; } -#line 3546 "pipeline_parser_gen.cpp" +#line 3603 "pipeline_parser_gen.cpp" break; - case 258: -#line 1093 "pipeline_grammar.yy" + case 262: +#line 1113 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3552 "pipeline_parser_gen.cpp" +#line 3609 "pipeline_parser_gen.cpp" break; - case 259: -#line 1093 "pipeline_grammar.yy" + case 263: +#line 1113 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3558 "pipeline_parser_gen.cpp" +#line 3615 "pipeline_parser_gen.cpp" break; - case 260: -#line 1093 "pipeline_grammar.yy" + case 264: +#line 1113 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3564 "pipeline_parser_gen.cpp" +#line 3621 "pipeline_parser_gen.cpp" break; - case 261: -#line 1093 "pipeline_grammar.yy" + case 265: +#line 1113 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3570 "pipeline_parser_gen.cpp" +#line 3627 "pipeline_parser_gen.cpp" break; - case 262: -#line 1093 "pipeline_grammar.yy" + case 266: +#line 1113 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3576 "pipeline_parser_gen.cpp" +#line 3633 "pipeline_parser_gen.cpp" break; - case 263: -#line 1093 "pipeline_grammar.yy" + case 267: +#line 1113 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3582 "pipeline_parser_gen.cpp" +#line 3639 "pipeline_parser_gen.cpp" break; - case 264: -#line 1093 "pipeline_grammar.yy" + case 268: +#line 1113 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3588 "pipeline_parser_gen.cpp" +#line 3645 "pipeline_parser_gen.cpp" break; - case 265: -#line 1094 "pipeline_grammar.yy" + case 269: +#line 1114 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3594 "pipeline_parser_gen.cpp" +#line 3651 "pipeline_parser_gen.cpp" break; - case 266: -#line 1094 "pipeline_grammar.yy" + case 270: +#line 1114 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3600 "pipeline_parser_gen.cpp" +#line 3657 "pipeline_parser_gen.cpp" break; - case 267: -#line 1094 "pipeline_grammar.yy" + case 271: +#line 1114 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3606 "pipeline_parser_gen.cpp" +#line 3663 "pipeline_parser_gen.cpp" break; - case 268: -#line 1094 "pipeline_grammar.yy" + case 272: +#line 1114 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3612 "pipeline_parser_gen.cpp" +#line 3669 "pipeline_parser_gen.cpp" break; - case 269: -#line 1094 "pipeline_grammar.yy" + case 273: +#line 1114 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3618 "pipeline_parser_gen.cpp" +#line 3675 "pipeline_parser_gen.cpp" break; - case 270: -#line 1094 "pipeline_grammar.yy" + case 274: +#line 1114 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3624 "pipeline_parser_gen.cpp" +#line 3681 "pipeline_parser_gen.cpp" break; - case 271: -#line 1094 "pipeline_grammar.yy" + case 275: +#line 1114 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3630 "pipeline_parser_gen.cpp" +#line 3687 "pipeline_parser_gen.cpp" break; - case 272: -#line 1094 "pipeline_grammar.yy" + case 276: +#line 1114 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3636 "pipeline_parser_gen.cpp" +#line 3693 "pipeline_parser_gen.cpp" break; - case 273: -#line 1095 "pipeline_grammar.yy" + case 277: +#line 1115 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3642 "pipeline_parser_gen.cpp" +#line 3699 "pipeline_parser_gen.cpp" break; - case 274: -#line 1095 "pipeline_grammar.yy" + case 278: +#line 1115 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3648 "pipeline_parser_gen.cpp" +#line 3705 "pipeline_parser_gen.cpp" break; - case 275: -#line 1095 "pipeline_grammar.yy" + case 279: +#line 1115 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3654 "pipeline_parser_gen.cpp" +#line 3711 "pipeline_parser_gen.cpp" break; - case 276: -#line 1095 "pipeline_grammar.yy" + case 280: +#line 1115 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3660 "pipeline_parser_gen.cpp" +#line 3717 "pipeline_parser_gen.cpp" break; - case 277: -#line 1095 "pipeline_grammar.yy" + case 281: +#line 1115 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3666 "pipeline_parser_gen.cpp" +#line 3723 "pipeline_parser_gen.cpp" break; - case 278: -#line 1095 "pipeline_grammar.yy" + case 282: +#line 1115 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3672 "pipeline_parser_gen.cpp" +#line 3729 "pipeline_parser_gen.cpp" break; - case 279: -#line 1095 "pipeline_grammar.yy" + case 283: +#line 1115 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3678 "pipeline_parser_gen.cpp" +#line 3735 "pipeline_parser_gen.cpp" break; - case 280: -#line 1099 "pipeline_grammar.yy" + case 284: +#line 1119 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::concat, CNode{CNode::ArrayChildren{}}}}}; @@ -3928,47 +3989,47 @@ int PipelineParserGen::parse() { yylhs.value.as<CNode>().objectChildren()[0].second.arrayChildren(); array.insert(array.end(), others.begin(), others.end()); } -#line 3690 "pipeline_parser_gen.cpp" +#line 3747 "pipeline_parser_gen.cpp" break; - case 281: -#line 1109 "pipeline_grammar.yy" + case 285: +#line 1129 "pipeline_grammar.yy" { yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = std::pair{KeyFieldname::formatArg, CNode{KeyValue::absentKey}}; } -#line 3698 "pipeline_parser_gen.cpp" +#line 3755 "pipeline_parser_gen.cpp" break; - case 282: -#line 1112 "pipeline_grammar.yy" + case 286: +#line 1132 "pipeline_grammar.yy" { yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = std::pair{ KeyFieldname::formatArg, YY_MOVE(yystack_[0].value.as<CNode>())}; } -#line 3706 "pipeline_parser_gen.cpp" +#line 3763 "pipeline_parser_gen.cpp" break; - case 283: -#line 1118 "pipeline_grammar.yy" + case 287: +#line 1138 "pipeline_grammar.yy" { yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = std::pair{KeyFieldname::timezoneArg, CNode{KeyValue::absentKey}}; } -#line 3714 "pipeline_parser_gen.cpp" +#line 3771 "pipeline_parser_gen.cpp" break; - case 284: -#line 1121 "pipeline_grammar.yy" + case 288: +#line 1141 "pipeline_grammar.yy" { yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = std::pair{ KeyFieldname::timezoneArg, YY_MOVE(yystack_[0].value.as<CNode>())}; } -#line 3722 "pipeline_parser_gen.cpp" +#line 3779 "pipeline_parser_gen.cpp" break; - case 285: -#line 1128 "pipeline_grammar.yy" + case 289: +#line 1148 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::dateFromString, @@ -3984,11 +4045,11 @@ int PipelineParserGen::parse() { YY_MOVE(yystack_[2] .value.as<std::pair<CNode::Fieldname, CNode>>())}}}}}; } -#line 3732 "pipeline_parser_gen.cpp" +#line 3789 "pipeline_parser_gen.cpp" break; - case 286: -#line 1137 "pipeline_grammar.yy" + case 290: +#line 1157 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::dateToString, @@ -4001,38 +4062,38 @@ int PipelineParserGen::parse() { YY_MOVE(yystack_[2] .value.as<std::pair<CNode::Fieldname, CNode>>())}}}}}; } -#line 3742 "pipeline_parser_gen.cpp" +#line 3799 "pipeline_parser_gen.cpp" break; - case 287: -#line 1145 "pipeline_grammar.yy" + case 291: +#line 1165 "pipeline_grammar.yy" { yylhs.value.as<std::vector<CNode>>() = CNode::ArrayChildren{}; } -#line 3750 "pipeline_parser_gen.cpp" +#line 3807 "pipeline_parser_gen.cpp" break; - case 288: -#line 1148 "pipeline_grammar.yy" + case 292: +#line 1168 "pipeline_grammar.yy" { yylhs.value.as<std::vector<CNode>>() = CNode::ArrayChildren{YY_MOVE(yystack_[0].value.as<CNode>())}; } -#line 3758 "pipeline_parser_gen.cpp" +#line 3815 "pipeline_parser_gen.cpp" break; - case 289: -#line 1151 "pipeline_grammar.yy" + case 293: +#line 1171 "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 3766 "pipeline_parser_gen.cpp" +#line 3823 "pipeline_parser_gen.cpp" break; - case 290: -#line 1158 "pipeline_grammar.yy" + case 294: +#line 1178 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::indexOfBytes, @@ -4043,11 +4104,11 @@ int PipelineParserGen::parse() { yylhs.value.as<CNode>().objectChildren()[0].second.arrayChildren(); array.insert(array.end(), others.begin(), others.end()); } -#line 3778 "pipeline_parser_gen.cpp" +#line 3835 "pipeline_parser_gen.cpp" break; - case 291: -#line 1169 "pipeline_grammar.yy" + case 295: +#line 1189 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::indexOfCP, @@ -4058,29 +4119,29 @@ int PipelineParserGen::parse() { yylhs.value.as<CNode>().objectChildren()[0].second.arrayChildren(); array.insert(array.end(), others.begin(), others.end()); } -#line 3790 "pipeline_parser_gen.cpp" +#line 3847 "pipeline_parser_gen.cpp" break; - case 292: -#line 1179 "pipeline_grammar.yy" + case 296: +#line 1199 "pipeline_grammar.yy" { yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = std::pair{KeyFieldname::charsArg, CNode{KeyValue::absentKey}}; } -#line 3798 "pipeline_parser_gen.cpp" +#line 3855 "pipeline_parser_gen.cpp" break; - case 293: -#line 1182 "pipeline_grammar.yy" + case 297: +#line 1202 "pipeline_grammar.yy" { yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = std::pair{ KeyFieldname::charsArg, YY_MOVE(yystack_[0].value.as<CNode>())}; } -#line 3806 "pipeline_parser_gen.cpp" +#line 3863 "pipeline_parser_gen.cpp" break; - case 294: -#line 1188 "pipeline_grammar.yy" + case 298: +#line 1208 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::ltrim, @@ -4089,11 +4150,11 @@ int PipelineParserGen::parse() { YY_MOVE(yystack_[4] .value.as<std::pair<CNode::Fieldname, CNode>>())}}}}}; } -#line 3816 "pipeline_parser_gen.cpp" +#line 3873 "pipeline_parser_gen.cpp" break; - case 295: -#line 1196 "pipeline_grammar.yy" + case 299: +#line 1216 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::rtrim, @@ -4102,11 +4163,11 @@ int PipelineParserGen::parse() { YY_MOVE(yystack_[4] .value.as<std::pair<CNode::Fieldname, CNode>>())}}}}}; } -#line 3826 "pipeline_parser_gen.cpp" +#line 3883 "pipeline_parser_gen.cpp" break; - case 296: -#line 1204 "pipeline_grammar.yy" + case 300: +#line 1224 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::trim, @@ -4115,29 +4176,29 @@ int PipelineParserGen::parse() { YY_MOVE(yystack_[4] .value.as<std::pair<CNode::Fieldname, CNode>>())}}}}}; } -#line 3836 "pipeline_parser_gen.cpp" +#line 3893 "pipeline_parser_gen.cpp" break; - case 297: -#line 1212 "pipeline_grammar.yy" + case 301: +#line 1232 "pipeline_grammar.yy" { yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = std::pair{KeyFieldname::optionsArg, CNode{KeyValue::absentKey}}; } -#line 3844 "pipeline_parser_gen.cpp" +#line 3901 "pipeline_parser_gen.cpp" break; - case 298: -#line 1215 "pipeline_grammar.yy" + case 302: +#line 1235 "pipeline_grammar.yy" { yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = std::pair{ KeyFieldname::optionsArg, YY_MOVE(yystack_[0].value.as<CNode>())}; } -#line 3852 "pipeline_parser_gen.cpp" +#line 3909 "pipeline_parser_gen.cpp" break; - case 299: -#line 1220 "pipeline_grammar.yy" + case 303: +#line 1240 "pipeline_grammar.yy" { // Note that the order of these arguments must match the constructor for the // regex expression. @@ -4146,38 +4207,38 @@ int PipelineParserGen::parse() { {KeyFieldname::regexArg, YY_MOVE(yystack_[1].value.as<CNode>())}, YY_MOVE(yystack_[3].value.as<std::pair<CNode::Fieldname, CNode>>())}}; } -#line 3864 "pipeline_parser_gen.cpp" +#line 3921 "pipeline_parser_gen.cpp" break; - case 300: -#line 1229 "pipeline_grammar.yy" + case 304: +#line 1249 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::regexFind, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3872 "pipeline_parser_gen.cpp" +#line 3929 "pipeline_parser_gen.cpp" break; - case 301: -#line 1235 "pipeline_grammar.yy" + case 305: +#line 1255 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::regexFindAll, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3880 "pipeline_parser_gen.cpp" +#line 3937 "pipeline_parser_gen.cpp" break; - case 302: -#line 1241 "pipeline_grammar.yy" + case 306: +#line 1261 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::regexMatch, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3888 "pipeline_parser_gen.cpp" +#line 3945 "pipeline_parser_gen.cpp" break; - case 303: -#line 1248 "pipeline_grammar.yy" + case 307: +#line 1268 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::replaceOne, @@ -4187,11 +4248,11 @@ int PipelineParserGen::parse() { {KeyFieldname::replacementArg, YY_MOVE(yystack_[2].value.as<CNode>())}}}}}}; } -#line 3899 "pipeline_parser_gen.cpp" +#line 3956 "pipeline_parser_gen.cpp" break; - case 304: -#line 1258 "pipeline_grammar.yy" + case 308: +#line 1278 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::replaceAll, @@ -4201,51 +4262,51 @@ int PipelineParserGen::parse() { {KeyFieldname::replacementArg, YY_MOVE(yystack_[2].value.as<CNode>())}}}}}}; } -#line 3910 "pipeline_parser_gen.cpp" +#line 3967 "pipeline_parser_gen.cpp" break; - case 305: -#line 1267 "pipeline_grammar.yy" + case 309: +#line 1287 "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 3919 "pipeline_parser_gen.cpp" +#line 3976 "pipeline_parser_gen.cpp" break; - case 306: -#line 1274 "pipeline_grammar.yy" + case 310: +#line 1294 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::strLenBytes, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3928 "pipeline_parser_gen.cpp" +#line 3985 "pipeline_parser_gen.cpp" break; - case 307: -#line 1281 "pipeline_grammar.yy" + case 311: +#line 1301 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::strLenCP, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3937 "pipeline_parser_gen.cpp" +#line 3994 "pipeline_parser_gen.cpp" break; - case 308: -#line 1289 "pipeline_grammar.yy" + case 312: +#line 1309 "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 3946 "pipeline_parser_gen.cpp" +#line 4003 "pipeline_parser_gen.cpp" break; - case 309: -#line 1297 "pipeline_grammar.yy" + case 313: +#line 1317 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::substr, @@ -4253,11 +4314,11 @@ int PipelineParserGen::parse() { YY_MOVE(yystack_[3].value.as<CNode>()), YY_MOVE(yystack_[2].value.as<CNode>())}}}}}; } -#line 3955 "pipeline_parser_gen.cpp" +#line 4012 "pipeline_parser_gen.cpp" break; - case 310: -#line 1305 "pipeline_grammar.yy" + case 314: +#line 1325 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::substrBytes, @@ -4265,11 +4326,11 @@ int PipelineParserGen::parse() { YY_MOVE(yystack_[3].value.as<CNode>()), YY_MOVE(yystack_[2].value.as<CNode>())}}}}}; } -#line 3964 "pipeline_parser_gen.cpp" +#line 4021 "pipeline_parser_gen.cpp" break; - case 311: -#line 1313 "pipeline_grammar.yy" + case 315: +#line 1333 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::substrCP, @@ -4277,440 +4338,440 @@ int PipelineParserGen::parse() { YY_MOVE(yystack_[3].value.as<CNode>()), YY_MOVE(yystack_[2].value.as<CNode>())}}}}}; } -#line 3973 "pipeline_parser_gen.cpp" +#line 4030 "pipeline_parser_gen.cpp" break; - case 312: -#line 1320 "pipeline_grammar.yy" + case 316: +#line 1340 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::toLower, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3981 "pipeline_parser_gen.cpp" +#line 4038 "pipeline_parser_gen.cpp" break; - case 313: -#line 1326 "pipeline_grammar.yy" + case 317: +#line 1346 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::toUpper, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 3989 "pipeline_parser_gen.cpp" +#line 4046 "pipeline_parser_gen.cpp" break; - case 314: -#line 1332 "pipeline_grammar.yy" + case 318: +#line 1352 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 3995 "pipeline_parser_gen.cpp" +#line 4052 "pipeline_parser_gen.cpp" break; - case 315: -#line 1332 "pipeline_grammar.yy" + case 319: +#line 1352 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 4001 "pipeline_parser_gen.cpp" +#line 4058 "pipeline_parser_gen.cpp" break; - case 316: -#line 1336 "pipeline_grammar.yy" + case 320: +#line 1356 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::constExpr, CNode{CNode::ArrayChildren{YY_MOVE(yystack_[2].value.as<CNode>())}}}}}; } -#line 4010 "pipeline_parser_gen.cpp" +#line 4067 "pipeline_parser_gen.cpp" break; - case 317: -#line 1343 "pipeline_grammar.yy" + case 321: +#line 1363 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::literal, CNode{CNode::ArrayChildren{YY_MOVE(yystack_[2].value.as<CNode>())}}}}}; } -#line 4019 "pipeline_parser_gen.cpp" +#line 4076 "pipeline_parser_gen.cpp" break; - case 318: -#line 1350 "pipeline_grammar.yy" + case 322: +#line 1370 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 4025 "pipeline_parser_gen.cpp" +#line 4082 "pipeline_parser_gen.cpp" break; - case 319: -#line 1350 "pipeline_grammar.yy" + case 323: +#line 1370 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 4031 "pipeline_parser_gen.cpp" +#line 4088 "pipeline_parser_gen.cpp" break; - case 320: -#line 1354 "pipeline_grammar.yy" + case 324: +#line 1374 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 4037 "pipeline_parser_gen.cpp" +#line 4094 "pipeline_parser_gen.cpp" break; - case 321: -#line 1354 "pipeline_grammar.yy" + case 325: +#line 1374 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 4043 "pipeline_parser_gen.cpp" +#line 4100 "pipeline_parser_gen.cpp" break; - case 322: -#line 1358 "pipeline_grammar.yy" + case 326: +#line 1378 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{YY_MOVE(yystack_[1].value.as<std::vector<CNode>>())}; } -#line 4051 "pipeline_parser_gen.cpp" +#line 4108 "pipeline_parser_gen.cpp" break; - case 323: -#line 1364 "pipeline_grammar.yy" + case 327: +#line 1384 "pipeline_grammar.yy" { } -#line 4057 "pipeline_parser_gen.cpp" +#line 4114 "pipeline_parser_gen.cpp" break; - case 324: -#line 1365 "pipeline_grammar.yy" + case 328: +#line 1385 "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 4066 "pipeline_parser_gen.cpp" +#line 4123 "pipeline_parser_gen.cpp" break; - case 325: -#line 1372 "pipeline_grammar.yy" + case 329: +#line 1392 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[1].value.as<CNode>()); } -#line 4074 "pipeline_parser_gen.cpp" +#line 4131 "pipeline_parser_gen.cpp" break; - case 326: -#line 1378 "pipeline_grammar.yy" + case 330: +#line 1398 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode::noopLeaf(); } -#line 4082 "pipeline_parser_gen.cpp" +#line 4139 "pipeline_parser_gen.cpp" break; - case 327: -#line 1381 "pipeline_grammar.yy" + case 331: +#line 1401 "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 4091 "pipeline_parser_gen.cpp" +#line 4148 "pipeline_parser_gen.cpp" break; - case 328: -#line 1388 "pipeline_grammar.yy" + case 332: +#line 1408 "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 4099 "pipeline_parser_gen.cpp" +#line 4156 "pipeline_parser_gen.cpp" break; - case 329: -#line 1395 "pipeline_grammar.yy" + case 333: +#line 1415 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 4105 "pipeline_parser_gen.cpp" +#line 4162 "pipeline_parser_gen.cpp" break; - case 330: -#line 1396 "pipeline_grammar.yy" + case 334: +#line 1416 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 4111 "pipeline_parser_gen.cpp" +#line 4168 "pipeline_parser_gen.cpp" break; - case 331: -#line 1397 "pipeline_grammar.yy" + case 335: +#line 1417 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 4117 "pipeline_parser_gen.cpp" +#line 4174 "pipeline_parser_gen.cpp" break; - case 332: -#line 1398 "pipeline_grammar.yy" + case 336: +#line 1418 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 4123 "pipeline_parser_gen.cpp" +#line 4180 "pipeline_parser_gen.cpp" break; - case 333: -#line 1399 "pipeline_grammar.yy" + case 337: +#line 1419 "pipeline_grammar.yy" { yylhs.value.as<CNode::Fieldname>() = YY_MOVE(yystack_[0].value.as<CNode::Fieldname>()); } -#line 4129 "pipeline_parser_gen.cpp" +#line 4186 "pipeline_parser_gen.cpp" break; - case 334: -#line 1402 "pipeline_grammar.yy" + case 338: +#line 1422 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 4135 "pipeline_parser_gen.cpp" +#line 4192 "pipeline_parser_gen.cpp" break; - case 335: -#line 1402 "pipeline_grammar.yy" + case 339: +#line 1422 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 4141 "pipeline_parser_gen.cpp" +#line 4198 "pipeline_parser_gen.cpp" break; - case 336: -#line 1402 "pipeline_grammar.yy" + case 340: +#line 1422 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 4147 "pipeline_parser_gen.cpp" +#line 4204 "pipeline_parser_gen.cpp" break; - case 337: -#line 1402 "pipeline_grammar.yy" + case 341: +#line 1422 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 4153 "pipeline_parser_gen.cpp" +#line 4210 "pipeline_parser_gen.cpp" break; - case 338: -#line 1402 "pipeline_grammar.yy" + case 342: +#line 1422 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 4159 "pipeline_parser_gen.cpp" +#line 4216 "pipeline_parser_gen.cpp" break; - case 339: -#line 1402 "pipeline_grammar.yy" + case 343: +#line 1422 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 4165 "pipeline_parser_gen.cpp" +#line 4222 "pipeline_parser_gen.cpp" break; - case 340: -#line 1402 "pipeline_grammar.yy" + case 344: +#line 1422 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 4171 "pipeline_parser_gen.cpp" +#line 4228 "pipeline_parser_gen.cpp" break; - case 341: -#line 1404 "pipeline_grammar.yy" + case 345: +#line 1424 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::cmp, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 4180 "pipeline_parser_gen.cpp" +#line 4237 "pipeline_parser_gen.cpp" break; - case 342: -#line 1409 "pipeline_grammar.yy" + case 346: +#line 1429 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::eq, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 4189 "pipeline_parser_gen.cpp" +#line 4246 "pipeline_parser_gen.cpp" break; - case 343: -#line 1414 "pipeline_grammar.yy" + case 347: +#line 1434 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::gt, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 4198 "pipeline_parser_gen.cpp" +#line 4255 "pipeline_parser_gen.cpp" break; - case 344: -#line 1419 "pipeline_grammar.yy" + case 348: +#line 1439 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::gte, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 4207 "pipeline_parser_gen.cpp" +#line 4264 "pipeline_parser_gen.cpp" break; - case 345: -#line 1424 "pipeline_grammar.yy" + case 349: +#line 1444 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::lt, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 4216 "pipeline_parser_gen.cpp" +#line 4273 "pipeline_parser_gen.cpp" break; - case 346: -#line 1429 "pipeline_grammar.yy" + case 350: +#line 1449 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::lte, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 4225 "pipeline_parser_gen.cpp" +#line 4282 "pipeline_parser_gen.cpp" break; - case 347: -#line 1434 "pipeline_grammar.yy" + case 351: +#line 1454 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::ne, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 4234 "pipeline_parser_gen.cpp" +#line 4291 "pipeline_parser_gen.cpp" break; - case 348: -#line 1440 "pipeline_grammar.yy" + case 352: +#line 1460 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 4240 "pipeline_parser_gen.cpp" +#line 4297 "pipeline_parser_gen.cpp" break; - case 349: -#line 1441 "pipeline_grammar.yy" + case 353: +#line 1461 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 4246 "pipeline_parser_gen.cpp" +#line 4303 "pipeline_parser_gen.cpp" break; - case 350: -#line 1442 "pipeline_grammar.yy" + case 354: +#line 1462 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 4252 "pipeline_parser_gen.cpp" +#line 4309 "pipeline_parser_gen.cpp" break; - case 351: -#line 1443 "pipeline_grammar.yy" + case 355: +#line 1463 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 4258 "pipeline_parser_gen.cpp" +#line 4315 "pipeline_parser_gen.cpp" break; - case 352: -#line 1444 "pipeline_grammar.yy" + case 356: +#line 1464 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 4264 "pipeline_parser_gen.cpp" +#line 4321 "pipeline_parser_gen.cpp" break; - case 353: -#line 1445 "pipeline_grammar.yy" + case 357: +#line 1465 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 4270 "pipeline_parser_gen.cpp" +#line 4327 "pipeline_parser_gen.cpp" break; - case 354: -#line 1446 "pipeline_grammar.yy" + case 358: +#line 1466 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 4276 "pipeline_parser_gen.cpp" +#line 4333 "pipeline_parser_gen.cpp" break; - case 355: -#line 1447 "pipeline_grammar.yy" + case 359: +#line 1467 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 4282 "pipeline_parser_gen.cpp" +#line 4339 "pipeline_parser_gen.cpp" break; - case 356: -#line 1448 "pipeline_grammar.yy" + case 360: +#line 1468 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 4288 "pipeline_parser_gen.cpp" +#line 4345 "pipeline_parser_gen.cpp" break; - case 357: -#line 1449 "pipeline_grammar.yy" + case 361: +#line 1469 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = YY_MOVE(yystack_[0].value.as<CNode>()); } -#line 4294 "pipeline_parser_gen.cpp" +#line 4351 "pipeline_parser_gen.cpp" break; - case 358: -#line 1454 "pipeline_grammar.yy" + case 362: +#line 1474 "pipeline_grammar.yy" { yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = std::pair{KeyFieldname::onErrorArg, CNode{KeyValue::absentKey}}; } -#line 4302 "pipeline_parser_gen.cpp" +#line 4359 "pipeline_parser_gen.cpp" break; - case 359: -#line 1457 "pipeline_grammar.yy" + case 363: +#line 1477 "pipeline_grammar.yy" { yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = std::pair{ KeyFieldname::onErrorArg, YY_MOVE(yystack_[0].value.as<CNode>())}; } -#line 4310 "pipeline_parser_gen.cpp" +#line 4367 "pipeline_parser_gen.cpp" break; - case 360: -#line 1464 "pipeline_grammar.yy" + case 364: +#line 1484 "pipeline_grammar.yy" { yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = std::pair{KeyFieldname::onNullArg, CNode{KeyValue::absentKey}}; } -#line 4318 "pipeline_parser_gen.cpp" +#line 4375 "pipeline_parser_gen.cpp" break; - case 361: -#line 1467 "pipeline_grammar.yy" + case 365: +#line 1487 "pipeline_grammar.yy" { yylhs.value.as<std::pair<CNode::Fieldname, CNode>>() = std::pair{ KeyFieldname::onNullArg, YY_MOVE(yystack_[0].value.as<CNode>())}; } -#line 4326 "pipeline_parser_gen.cpp" +#line 4383 "pipeline_parser_gen.cpp" break; - case 362: -#line 1474 "pipeline_grammar.yy" + case 366: +#line 1494 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::convert, @@ -4722,92 +4783,92 @@ int PipelineParserGen::parse() { YY_MOVE(yystack_[4] .value.as<std::pair<CNode::Fieldname, CNode>>())}}}}}; } -#line 4337 "pipeline_parser_gen.cpp" +#line 4394 "pipeline_parser_gen.cpp" break; - case 363: -#line 1483 "pipeline_grammar.yy" + case 367: +#line 1503 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::toBool, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 4345 "pipeline_parser_gen.cpp" +#line 4402 "pipeline_parser_gen.cpp" break; - case 364: -#line 1488 "pipeline_grammar.yy" + case 368: +#line 1508 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::toDate, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 4353 "pipeline_parser_gen.cpp" +#line 4410 "pipeline_parser_gen.cpp" break; - case 365: -#line 1493 "pipeline_grammar.yy" + case 369: +#line 1513 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::toDecimal, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 4361 "pipeline_parser_gen.cpp" +#line 4418 "pipeline_parser_gen.cpp" break; - case 366: -#line 1498 "pipeline_grammar.yy" + case 370: +#line 1518 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::toDouble, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 4369 "pipeline_parser_gen.cpp" +#line 4426 "pipeline_parser_gen.cpp" break; - case 367: -#line 1503 "pipeline_grammar.yy" + case 371: +#line 1523 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::toInt, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 4377 "pipeline_parser_gen.cpp" +#line 4434 "pipeline_parser_gen.cpp" break; - case 368: -#line 1508 "pipeline_grammar.yy" + case 372: +#line 1528 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::toLong, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 4385 "pipeline_parser_gen.cpp" +#line 4442 "pipeline_parser_gen.cpp" break; - case 369: -#line 1513 "pipeline_grammar.yy" + case 373: +#line 1533 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::toObjectId, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 4393 "pipeline_parser_gen.cpp" +#line 4450 "pipeline_parser_gen.cpp" break; - case 370: -#line 1518 "pipeline_grammar.yy" + case 374: +#line 1538 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::toString, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 4401 "pipeline_parser_gen.cpp" +#line 4458 "pipeline_parser_gen.cpp" break; - case 371: -#line 1523 "pipeline_grammar.yy" + case 375: +#line 1543 "pipeline_grammar.yy" { yylhs.value.as<CNode>() = CNode{CNode::ObjectChildren{ {KeyFieldname::type, YY_MOVE(yystack_[1].value.as<CNode>())}}}; } -#line 4409 "pipeline_parser_gen.cpp" +#line 4466 "pipeline_parser_gen.cpp" break; -#line 4413 "pipeline_parser_gen.cpp" +#line 4470 "pipeline_parser_gen.cpp" default: break; @@ -5122,52 +5183,52 @@ std::string PipelineParserGen::yysyntax_error_(const context& yyctx) const { } -const short PipelineParserGen::yypact_ninf_ = -584; +const short PipelineParserGen::yypact_ninf_ = -580; const signed char PipelineParserGen::yytable_ninf_ = -1; const short PipelineParserGen::yypact_[] = { - -64, -42, -54, 35, -38, -584, -584, -584, -584, -28, 13, 356, -10, 48, -4, -2, - 48, -584, 43, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, - -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, - -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, 715, -584, -584, -584, - -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, - -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, - -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, - -584, 715, -584, -584, -584, -584, 50, -584, -584, -584, -584, -584, -584, -584, -584, -584, - -584, -584, -584, -584, -584, 73, -584, 88, 27, -38, -584, -584, 715, -584, -584, -584, - -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, - -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, - -584, -584, -584, -584, -584, -584, -584, 451, 48, 16, -584, -584, 715, 77, 546, -584, - 734, 734, -584, -584, -584, -584, -584, 92, 116, -584, -584, -584, -584, -584, -584, -584, - -584, -584, 715, -584, -584, -584, -584, -584, -584, -584, 827, 641, -584, -584, -584, -584, - -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, - -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, - -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, - -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, - -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, - -584, -584, -584, -584, -584, -584, -584, -24, -584, -584, 827, -584, 108, 827, 69, 69, - 70, 827, 70, 72, 74, -584, -584, -584, 75, 70, 827, 827, 70, 70, 81, 89, - 91, 827, 93, 827, 70, 70, -584, 95, 99, 70, 100, 69, 102, -584, -584, -584, - -584, -584, 104, -584, 105, 827, 109, 827, 827, 113, 114, 120, 122, 827, 827, 827, - 827, 827, 827, 827, 827, 827, 827, -584, 124, 827, 874, 112, -584, -584, 127, 131, - 164, 827, 166, 167, 170, 827, 715, 196, 200, 202, 827, 175, 176, 177, 178, 181, - 827, 827, 715, 182, 827, 183, 185, 186, 217, 827, 827, 188, 827, 189, 827, 191, - 216, 194, 195, 225, 227, 827, 217, 827, 203, 827, 204, 206, 827, 827, 827, 827, - 208, 209, 210, 212, 213, 214, 215, 218, 219, 220, 217, 827, 222, -584, 827, -584, - -584, -584, -584, -584, -584, -584, -584, -584, 827, -584, -584, -584, 226, 228, 827, 827, - 827, 827, -584, -584, -584, -584, -584, 827, 827, 229, -584, 827, -584, -584, -584, 827, - 240, 827, 827, -584, 231, -584, 827, -584, 827, -584, -584, 827, 827, 827, 250, 827, - -584, 827, -584, -584, 827, 827, 827, 827, -584, -584, -584, -584, -584, -584, -584, -584, - -584, -584, 255, 827, -584, -584, 233, 234, 235, 256, 262, 262, 239, 827, 827, 241, - 243, -584, 827, 244, 827, 245, 247, 223, 264, 268, 248, 827, 249, 251, 827, 827, - 827, 252, 827, 254, -584, -584, -584, 827, 271, 827, 270, 270, 257, 827, 259, 260, - -584, 261, 263, 265, 269, -584, 267, 827, 274, 827, 827, 277, 278, 279, 280, 272, - 282, 283, 284, 285, 286, -584, 827, 275, -584, 827, 256, 271, -584, -584, 287, 288, - -584, 290, -584, 291, -584, -584, 827, 301, 310, -584, 293, -584, -584, 294, 296, 297, - -584, 298, -584, -584, 827, -584, 271, 303, -584, -584, -584, -584, 304, 827, 827, -584, - -584, -584, -584, -584, 305, 306, 308, -584, 309, 311, 312, 313, -584, 314, 315, -584, - -584, -584, -584}; + -71, -52, -44, 36, -36, -580, -580, -580, -580, -28, 18, 360, -16, 55, 0, 10, + 55, -580, 52, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, 625, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, 625, -580, -580, -580, -580, 61, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, 82, -580, 99, 33, -36, -580, -580, 625, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, 455, 55, 13, -580, -580, + 625, 85, 550, -580, 834, 834, -580, -580, -580, -580, -580, 86, 109, -580, -580, -580, + -580, -580, -580, -580, -580, -580, 625, -580, -580, -580, -580, -580, -580, -580, 645, 760, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -29, -580, -580, 645, -580, + 95, 645, 57, 57, 65, 645, 65, 70, 71, -580, -580, -580, 73, 65, 645, 645, + 65, 65, 74, 75, 76, 645, 77, 645, 65, 65, -580, 78, 81, 65, 83, 57, + 84, -580, -580, -580, -580, -580, 93, -580, 96, 645, 97, 645, 645, 100, 101, 106, + 107, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, -580, 112, 645, 881, 121, + -580, -580, 138, 152, 156, 645, 158, 167, 170, 645, 625, 195, 199, 201, 645, 174, + 175, 176, 178, 179, 645, 645, 625, 180, 645, 181, 182, 183, 215, 645, 645, 186, + 645, 189, 645, 190, 217, 191, 194, 221, 222, 645, 215, 645, 197, 645, 198, 200, + 645, 645, 645, 645, 202, 203, 207, 209, 210, 211, 212, 214, 216, 218, 215, 645, + 220, -580, 645, -580, -580, -580, -580, -580, -580, -580, -580, -580, 645, -580, -580, -580, + 224, 225, 645, 645, 645, 645, -580, -580, -580, -580, -580, 645, 645, 226, -580, 645, + -580, -580, -580, 645, 223, 645, 645, -580, 227, -580, 645, -580, 645, -580, -580, 645, + 645, 645, 241, 645, -580, 645, -580, -580, 645, 645, 645, 645, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, 245, 645, -580, -580, 228, 230, 233, 251, 260, 260, + 237, 645, 645, 238, 240, -580, 645, 242, 645, 243, 246, 258, 264, 266, 247, 645, + 249, 250, 645, 645, 645, 252, 645, 253, -580, -580, -580, 645, 272, 645, 269, 269, + 254, 645, 256, 257, -580, 259, 261, 262, 265, -580, 263, 645, 276, 645, 645, 267, + 268, 270, 271, 273, 274, 280, 275, 281, 282, -580, 645, 295, -580, 645, 251, 272, + -580, -580, 285, 286, -580, 287, -580, 288, -580, -580, 645, 283, 284, -580, 289, -580, + -580, 290, 291, 292, -580, 294, -580, -580, 645, -580, 272, 296, -580, -580, -580, -580, + 297, 645, 645, -580, -580, -580, -580, -580, 298, 300, 301, -580, 302, 305, 307, 308, + -580, 309, 310, -580, -580, -580, -580}; const short PipelineParserGen::yydefact_[] = { 0, 0, 0, 0, 5, 2, 59, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, @@ -5176,236 +5237,238 @@ const short PipelineParserGen::yydefact_[] = { 119, 100, 101, 0, 133, 134, 95, 120, 121, 122, 102, 103, 135, 123, 124, 104, 97, 96, 125, 136, 137, 138, 140, 139, 126, 141, 142, 127, 69, 72, 73, 74, 71, 70, 145, 143, 144, 146, 147, 148, 128, 106, 107, 108, 109, 110, 111, 149, 112, 113, 151, 150, 129, 114, 68, 65, 0, - 66, 67, 64, 60, 0, 173, 171, 167, 169, 166, 168, 170, 172, 18, 19, 20, 21, 23, 25, - 0, 22, 0, 0, 5, 175, 174, 323, 326, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 183, 184, 185, 186, 187, 192, 188, 189, 190, 193, 194, 63, 176, 177, 178, - 179, 191, 180, 181, 182, 318, 319, 320, 321, 61, 62, 16, 0, 0, 0, 8, 6, 323, 0, - 0, 24, 0, 0, 55, 56, 57, 54, 26, 0, 0, 324, 322, 325, 217, 330, 331, 332, 329, - 333, 0, 327, 49, 48, 47, 45, 41, 43, 195, 210, 40, 42, 44, 46, 36, 37, 38, 39, - 50, 51, 52, 29, 30, 31, 32, 33, 34, 35, 27, 53, 200, 201, 202, 218, 219, 203, 252, - 253, 254, 204, 314, 315, 207, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 279, 278, 205, 334, 335, 336, 337, 338, 339, 340, 206, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 28, 15, 0, 328, 197, 195, 198, 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, - 196, 208, 0, 0, 0, 0, 0, 0, 0, 195, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 292, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 292, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 292, 0, 0, 209, 0, 214, 215, 213, 216, 211, 17, 237, 235, 255, - 0, 236, 238, 341, 0, 0, 0, 0, 0, 0, 342, 240, 241, 343, 344, 0, 0, 0, 242, - 0, 244, 345, 346, 0, 0, 0, 0, 347, 0, 256, 0, 300, 0, 301, 302, 0, 0, 0, - 0, 0, 249, 0, 306, 307, 0, 0, 0, 0, 363, 364, 365, 366, 367, 368, 312, 369, 370, - 313, 0, 0, 371, 212, 0, 0, 0, 358, 281, 281, 0, 287, 287, 0, 0, 293, 0, 0, - 195, 0, 0, 297, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 199, 280, 316, - 0, 360, 0, 283, 283, 0, 288, 0, 0, 317, 0, 0, 0, 0, 257, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 359, 0, 0, 282, 0, 358, 360, 239, - 289, 0, 0, 243, 0, 245, 0, 247, 298, 0, 0, 0, 248, 0, 305, 308, 0, 0, 0, - 250, 0, 251, 361, 0, 284, 360, 0, 290, 291, 294, 246, 0, 0, 0, 295, 309, 310, 311, - 296, 0, 0, 0, 299, 0, 0, 0, 0, 286, 0, 0, 362, 285, 304, 303}; + 66, 67, 64, 60, 0, 175, 173, 169, 171, 168, 170, 172, 174, 18, 19, 20, 21, 23, 25, + 0, 22, 0, 0, 5, 177, 176, 327, 330, 152, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 153, 154, 187, 188, 189, 190, 191, 196, 192, 193, 194, 197, 198, 63, 178, + 179, 181, 182, 183, 195, 184, 185, 186, 322, 323, 324, 325, 180, 61, 62, 16, 0, 0, 0, + 8, 6, 327, 0, 0, 24, 0, 0, 55, 56, 57, 54, 26, 0, 0, 328, 326, 329, 221, + 334, 335, 336, 333, 337, 0, 331, 49, 48, 47, 45, 41, 43, 199, 214, 40, 42, 44, 46, + 36, 37, 38, 39, 50, 51, 52, 29, 30, 31, 32, 33, 34, 35, 27, 53, 204, 205, 206, + 222, 223, 207, 256, 257, 258, 208, 318, 319, 211, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 283, 282, 209, 338, 339, 340, 341, 342, + 343, 344, 210, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 28, 15, 0, 332, 201, 199, 202, 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, 200, 212, 0, 0, 0, 0, 0, 0, 0, 199, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 296, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 296, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 296, 0, 0, 213, 0, 218, 219, 217, 220, 215, + 17, 241, 239, 259, 0, 240, 242, 345, 0, 0, 0, 0, 0, 0, 346, 244, 245, 347, 348, + 0, 0, 0, 246, 0, 248, 349, 350, 0, 0, 0, 0, 351, 0, 260, 0, 304, 0, 305, + 306, 0, 0, 0, 0, 0, 253, 0, 310, 311, 0, 0, 0, 0, 367, 368, 369, 370, 371, + 372, 316, 373, 374, 317, 0, 0, 375, 216, 0, 0, 0, 362, 285, 285, 0, 291, 291, 0, + 0, 297, 0, 0, 199, 0, 0, 301, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 203, 284, 320, 0, 364, 0, 287, 287, 0, 292, 0, 0, 321, 0, 0, 0, 0, 261, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 363, 0, 0, 286, + 0, 362, 364, 243, 293, 0, 0, 247, 0, 249, 0, 251, 302, 0, 0, 0, 252, 0, 309, + 312, 0, 0, 0, 254, 0, 255, 365, 0, 288, 364, 0, 294, 295, 298, 250, 0, 0, 0, + 299, 313, 314, 315, 300, 0, 0, 0, 303, 0, 0, 0, 0, 290, 0, 0, 366, 289, 308, + 307}; const short PipelineParserGen::yypgoto_[] = { - -584, -584, -584, -177, -584, -174, -166, -171, -86, -584, -584, -584, -584, -584, -124, -122, - -116, -87, 2, -85, 10, -11, 12, -83, -76, -137, -153, -70, -68, -66, -584, -62, - -58, -55, -59, -584, -584, -584, -584, 161, -584, -584, -584, -584, -584, -584, -584, -584, - 144, 14, -310, -53, -244, -282, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, - -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -209, -584, -584, -584, - -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, - -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, - -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -584, -281, -583, -217, -203, - -408, -584, -306, 158, -173, -584, -584, 242, -584, -584, -17, -584}; + -580, -580, -580, -180, -580, -178, -167, -177, -88, -580, -580, -580, -580, -580, -147, -145, + -135, -123, -5, -117, 8, -10, 9, -112, -106, -136, -163, -580, -103, -101, -93, -580, + -83, -81, -79, -59, -580, -580, -580, -580, -580, 213, -580, -580, -580, -580, -580, -580, + -580, -580, 134, -3, -306, -60, -202, -292, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -216, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, + -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -580, -242, -579, + -176, -210, -408, -580, -316, 160, -175, -580, -580, 244, -580, -580, -17, -580}; const short PipelineParserGen::yydefgoto_[] = { - -1, 193, 446, 112, 113, 114, 115, 116, 209, 210, 198, 451, 211, 117, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 313, 177, - 178, 179, 190, 10, 18, 19, 20, 21, 22, 23, 24, 183, 238, 131, 314, 315, 386, 240, - 241, 378, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 415, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 552, 583, - 554, 586, 480, 568, 316, 189, 558, 7, 11, 180, 3, 5, 416, 136}; + -1, 197, 450, 112, 113, 114, 115, 116, 213, 214, 202, 455, 215, 117, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 317, + 180, 181, 182, 194, 183, 10, 18, 19, 20, 21, 22, 23, 24, 187, 242, 131, 318, 319, + 390, 244, 245, 382, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 419, 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, 310, 311, 312, + 556, 587, 558, 590, 484, 572, 320, 193, 562, 7, 11, 184, 3, 5, 420, 136}; const short PipelineParserGen::yytable_[] = { - 135, 176, 129, 188, 615, 129, 194, 382, 380, 195, 120, 387, 197, 205, 494, 127, 206, 196, 127, - 208, 396, 397, 6, 128, 207, 130, 128, 403, 130, 405, 134, 629, 200, 4, 514, 8, 383, 384, - 9, 231, 231, 12, 13, 14, 15, 16, 17, 424, 25, 426, 427, 188, 1, 2, 176, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 413, 118, 444, 224, 224, 225, 225, 132, 312, 133, 456, - 226, 226, 388, 137, 119, 176, 120, 460, 465, 395, 182, 125, 398, 399, 471, 472, 184, 121, 475, - 185, 406, 407, 122, 481, 482, 411, 484, 186, 486, 227, 227, 228, 228, 229, 229, 493, 202, 495, - 142, 497, 230, 230, 500, 501, 502, 503, 232, 232, 233, 233, 234, 234, 310, 176, 235, 235, 311, - 515, 236, 236, 517, 237, 237, 239, 239, 417, 418, 381, 218, 385, 518, 389, 452, 390, 394, 176, - 521, 522, 523, 524, 400, 123, 124, 125, 126, 525, 526, 453, 401, 528, 402, 454, 404, 529, 409, - 531, 532, 129, 410, 412, 534, 414, 535, 421, 423, 536, 537, 538, 425, 540, 127, 541, 428, 429, - 542, 543, 544, 545, 128, 430, 130, 431, 199, 443, 455, 447, 457, 458, 448, 547, 459, 449, 462, - 463, 464, 466, 467, 468, 469, 557, 557, 470, 474, 476, 562, 477, 478, 479, 483, 485, 564, 487, - 488, 572, 489, 490, 575, 576, 577, 491, 579, 492, 567, 496, 498, 581, 499, 584, 504, 505, 506, - 589, 507, 508, 509, 510, 530, 461, 511, 512, 513, 597, 516, 599, 600, 519, 539, 520, 527, 473, - 533, 546, 548, 551, 549, 550, 611, 553, 556, 613, 569, 560, 561, 563, 570, 565, 566, 571, 573, - 582, 574, 578, 620, 580, 585, 598, 450, 588, 590, 591, 612, 592, 187, 593, 379, 594, 628, 596, - 595, 614, 555, 605, 391, 392, 393, 632, 633, 601, 602, 603, 604, 606, 607, 621, 608, 609, 610, - 616, 617, 408, 618, 619, 622, 623, 624, 176, 625, 626, 627, 419, 420, 309, 422, 630, 631, 634, - 635, 176, 636, 637, 201, 638, 639, 640, 641, 642, 587, 559, 0, 181, 0, 0, 442, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 0, - 0, 46, 47, 48, 49, 50, 51, 52, 0, 53, 0, 0, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 0, 63, 64, 65, 66, 0, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 0, 0, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 0, - 0, 46, 47, 48, 49, 50, 51, 52, 0, 53, 0, 0, 191, 55, 56, 57, 58, 59, 192, - 61, 62, 0, 63, 64, 65, 66, 0, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 0, 0, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 0, - 0, 46, 47, 48, 49, 50, 51, 52, 0, 53, 0, 0, 203, 55, 56, 57, 58, 59, 204, - 61, 62, 0, 63, 64, 65, 66, 0, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 0, 0, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 317, 318, - 319, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 320, 0, - 0, 321, 322, 323, 324, 325, 326, 327, 0, 328, 0, 0, 0, 329, 330, 331, 332, 333, 0, - 334, 335, 0, 336, 337, 338, 339, 0, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, - 351, 352, 353, 354, 355, 356, 357, 0, 0, 0, 0, 0, 0, 0, 0, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 138, 139, 0, - 0, 0, 0, 0, 0, 0, 119, 0, 120, 0, 0, 0, 0, 0, 0, 0, 212, 213, 0, - 121, 0, 0, 0, 0, 122, 214, 0, 215, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 216, 0, 0, 0, 0, 217, 0, 0, 0, 0, 0, 140, 141, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 218, 219, 0, 0, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 123, 124, 125, 126, 153, 154, 155, 0, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 220, 221, 222, 223, 153, 154, 155, 138, 139, 0, 0, 0, - 0, 0, 0, 0, 119, 0, 120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 121, 0, - 0, 0, 0, 122, 0, 0, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 0, 0, 0, 0, 0, 0, 218, 219, 0, 0, 0, 0, 0, 0, 445, 0, - 0, 0, 0, 0, 204, 0, 0, 0, 0, 0, 0, 0, 0, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 123, 124, 125, 126, 153, 154, 155, 85, 86, 87, 88, 89, 90, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 111}; + 135, 179, 384, 129, 192, 120, 129, 198, 127, 199, 201, 127, 619, 134, 209, 386, 210, 212, 498, + 391, 200, 128, 130, 4, 128, 130, 204, 211, 400, 401, 387, 388, 6, 235, 235, 407, 8, 409, + 518, 633, 9, 12, 13, 14, 15, 16, 17, 1, 2, 228, 228, 229, 229, 25, 179, 428, 192, + 430, 431, 417, 118, 230, 230, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 231, 231, 448, + 132, 464, 316, 232, 232, 179, 125, 460, 233, 233, 133, 119, 137, 120, 234, 234, 469, 236, 236, + 237, 237, 186, 475, 476, 121, 188, 479, 238, 238, 122, 189, 485, 486, 190, 488, 142, 490, 239, + 239, 240, 240, 241, 241, 497, 206, 499, 314, 501, 392, 315, 504, 505, 506, 507, 385, 399, 222, + 179, 402, 403, 243, 243, 421, 422, 389, 519, 410, 411, 521, 393, 394, 415, 398, 404, 405, 406, + 408, 413, 522, 179, 414, 456, 416, 418, 525, 526, 527, 528, 123, 124, 125, 126, 425, 529, 530, + 427, 429, 532, 457, 432, 433, 533, 129, 535, 536, 434, 435, 127, 538, 203, 539, 447, 458, 540, + 541, 542, 459, 544, 461, 545, 128, 130, 546, 547, 548, 549, 451, 462, 452, 453, 463, 466, 467, + 468, 470, 471, 472, 551, 473, 474, 478, 480, 481, 482, 568, 483, 487, 561, 561, 489, 491, 493, + 566, 492, 494, 495, 496, 500, 502, 534, 503, 576, 508, 509, 579, 580, 581, 510, 583, 511, 512, + 513, 514, 585, 515, 588, 516, 543, 517, 593, 520, 550, 465, 523, 524, 531, 537, 552, 555, 601, + 553, 603, 604, 554, 477, 557, 560, 571, 564, 565, 573, 567, 574, 569, 615, 570, 575, 617, 577, + 578, 586, 582, 584, 589, 592, 594, 595, 602, 454, 596, 624, 597, 598, 600, 599, 625, 626, 605, + 606, 383, 607, 608, 609, 610, 632, 612, 395, 396, 397, 611, 616, 613, 614, 636, 637, 620, 621, + 622, 623, 627, 628, 629, 630, 412, 631, 313, 634, 635, 638, 179, 639, 640, 641, 423, 424, 642, + 426, 643, 644, 645, 646, 179, 618, 591, 191, 559, 205, 0, 0, 563, 0, 185, 0, 0, 0, + 0, 446, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 0, 0, 46, 47, 48, 49, 50, 51, 52, 0, 53, 0, 0, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 0, 63, 64, 65, 66, 0, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 0, 0, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 0, 0, 46, 47, 48, 49, 50, 51, 52, 0, 53, 0, 0, 195, 55, 56, + 57, 58, 59, 196, 61, 62, 0, 63, 64, 65, 66, 0, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 0, 0, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 0, 0, 46, 47, 48, 49, 50, 51, 52, 0, 53, 0, 0, 207, 55, 56, + 57, 58, 59, 208, 61, 62, 0, 63, 64, 65, 66, 0, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 0, 0, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 138, 139, 0, 0, 0, 0, 0, 0, 0, 119, 0, 120, 0, 0, 0, 0, 0, + 0, 0, 0, 138, 139, 121, 0, 0, 0, 0, 122, 0, 119, 0, 120, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 121, 0, 0, 0, 0, 122, 0, 0, 0, 0, 140, 141, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 222, 223, + 0, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 123, 124, 125, 126, 153, 154, 155, + 156, 157, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 123, 124, 125, 126, 153, 154, + 155, 156, 157, 321, 322, 323, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 324, 0, 0, 325, 326, 327, 328, 329, 330, 331, 0, 332, 0, 0, 0, 333, + 334, 335, 336, 337, 0, 338, 339, 0, 340, 341, 342, 343, 0, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 0, 0, 0, 0, 0, 0, 0, + 0, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, + 380, 381, 216, 217, 0, 0, 0, 0, 0, 0, 0, 218, 0, 219, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 220, 0, 0, 0, 0, 221, 0, 0, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 0, 0, 0, 0, 0, 0, 222, 223, 0, + 0, 0, 0, 0, 0, 449, 0, 0, 0, 0, 0, 208, 0, 0, 0, 0, 0, 0, 0, + 0, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 224, 225, 226, 227, 153, 154, 155, + 85, 86, 87, 88, 89, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 111}; const short PipelineParserGen::yycheck_[] = { - 17, 60, 13, 140, 587, 16, 183, 317, 314, 183, 34, 321, 183, 190, 422, 13, 190, 183, 16, - 190, 330, 331, 76, 13, 190, 13, 16, 337, 16, 339, 16, 614, 185, 75, 442, 0, 318, 319, - 76, 192, 193, 69, 70, 71, 72, 73, 74, 357, 35, 359, 360, 188, 116, 117, 113, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 347, 76, 377, 192, 193, 192, 193, 76, 210, 76, 385, - 192, 193, 322, 36, 32, 140, 34, 389, 394, 329, 36, 111, 332, 333, 400, 401, 19, 45, 404, - 7, 340, 341, 50, 409, 410, 345, 412, 76, 414, 192, 193, 192, 193, 192, 193, 421, 35, 423, - 98, 425, 192, 193, 428, 429, 430, 431, 192, 193, 192, 193, 192, 193, 36, 188, 192, 193, 16, - 443, 192, 193, 446, 192, 193, 192, 193, 350, 351, 35, 75, 75, 456, 75, 36, 75, 75, 210, - 462, 463, 464, 465, 75, 109, 110, 111, 112, 471, 472, 36, 75, 475, 75, 36, 75, 479, 75, - 481, 482, 184, 75, 75, 486, 75, 488, 75, 75, 491, 492, 493, 75, 495, 184, 497, 75, 75, - 500, 501, 502, 503, 184, 75, 184, 75, 184, 75, 36, 378, 36, 36, 378, 515, 36, 378, 12, - 9, 8, 36, 36, 36, 36, 525, 526, 36, 36, 36, 530, 36, 36, 6, 36, 36, 532, 36, - 12, 539, 36, 36, 542, 543, 544, 10, 546, 10, 15, 36, 36, 551, 36, 553, 36, 36, 36, - 557, 36, 36, 36, 36, 12, 390, 36, 36, 36, 567, 36, 569, 570, 35, 12, 35, 35, 402, - 35, 12, 35, 13, 36, 36, 582, 11, 35, 585, 12, 36, 35, 35, 12, 36, 35, 35, 35, - 14, 35, 35, 598, 35, 20, 17, 378, 36, 35, 35, 21, 36, 137, 36, 311, 36, 612, 36, - 35, 586, 523, 35, 325, 326, 327, 621, 622, 36, 36, 36, 36, 35, 35, 18, 36, 36, 36, - 36, 36, 342, 36, 36, 18, 36, 36, 390, 36, 36, 36, 352, 353, 193, 355, 36, 36, 36, - 36, 402, 36, 36, 188, 36, 36, 36, 36, 36, 555, 526, -1, 113, -1, -1, 375, 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, 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, -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, 23, 24, -1, - 45, -1, -1, -1, -1, 50, 32, -1, 34, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 45, -1, -1, -1, -1, 50, -1, -1, -1, -1, -1, 75, 76, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 75, 76, -1, -1, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, -1, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 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, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 97}; + 17, 60, 318, 13, 140, 34, 16, 187, 13, 187, 187, 16, 591, 16, 194, 321, 194, 194, 426, + 325, 187, 13, 13, 75, 16, 16, 189, 194, 334, 335, 322, 323, 76, 196, 197, 341, 0, 343, + 446, 618, 76, 69, 70, 71, 72, 73, 74, 118, 119, 196, 197, 196, 197, 35, 113, 361, 192, + 363, 364, 351, 76, 196, 197, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 196, 197, 381, + 76, 393, 214, 196, 197, 140, 111, 389, 196, 197, 76, 32, 36, 34, 196, 197, 398, 196, 197, + 196, 197, 36, 404, 405, 45, 19, 408, 196, 197, 50, 7, 413, 414, 76, 416, 98, 418, 196, + 197, 196, 197, 196, 197, 425, 35, 427, 36, 429, 326, 16, 432, 433, 434, 435, 35, 333, 75, + 192, 336, 337, 196, 197, 354, 355, 75, 447, 344, 345, 450, 75, 75, 349, 75, 75, 75, 75, + 75, 75, 460, 214, 75, 36, 75, 75, 466, 467, 468, 469, 109, 110, 111, 112, 75, 475, 476, + 75, 75, 479, 36, 75, 75, 483, 188, 485, 486, 75, 75, 188, 490, 188, 492, 75, 36, 495, + 496, 497, 36, 499, 36, 501, 188, 188, 504, 505, 506, 507, 382, 36, 382, 382, 36, 12, 9, + 8, 36, 36, 36, 519, 36, 36, 36, 36, 36, 36, 536, 6, 36, 529, 530, 36, 36, 36, + 534, 12, 36, 10, 10, 36, 36, 12, 36, 543, 36, 36, 546, 547, 548, 36, 550, 36, 36, + 36, 36, 555, 36, 557, 36, 12, 36, 561, 36, 12, 394, 35, 35, 35, 35, 35, 13, 571, + 36, 573, 574, 36, 406, 11, 35, 15, 36, 35, 12, 35, 12, 36, 586, 35, 35, 589, 35, + 35, 14, 35, 35, 20, 36, 35, 35, 17, 382, 36, 602, 36, 36, 36, 35, 18, 18, 36, + 36, 315, 36, 36, 35, 35, 616, 36, 329, 330, 331, 35, 21, 36, 36, 625, 626, 36, 36, + 36, 36, 36, 36, 36, 36, 346, 36, 197, 36, 36, 36, 394, 36, 36, 36, 356, 357, 36, + 359, 36, 36, 36, 36, 406, 590, 559, 137, 527, 192, -1, -1, 530, -1, 113, -1, -1, -1, + -1, 379, 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, 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, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 97}; const short PipelineParserGen::yystos_[] = { - 0, 116, 117, 254, 75, 255, 76, 251, 0, 76, 157, 252, 69, 70, 71, 72, 73, 74, 158, - 159, 160, 161, 162, 163, 164, 35, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 0, 118, 119, 258, 75, 259, 76, 255, 0, 76, 161, 256, 69, 70, 71, 72, 73, 74, 162, + 163, 164, 165, 166, 167, 168, 35, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 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, 97, 121, 122, - 123, 124, 125, 131, 76, 32, 34, 45, 50, 109, 110, 111, 112, 136, 138, 139, 140, 167, 76, - 76, 167, 256, 257, 36, 23, 24, 75, 76, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 113, 114, 115, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 253, 253, 36, 165, 19, 7, 76, 157, 143, 249, - 156, 36, 42, 119, 121, 123, 124, 125, 128, 167, 144, 249, 35, 36, 42, 121, 123, 124, 125, - 126, 127, 130, 23, 24, 32, 34, 45, 50, 75, 76, 109, 110, 111, 112, 132, 133, 134, 135, - 137, 141, 142, 144, 145, 146, 147, 149, 150, 151, 166, 169, 171, 172, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 195, 196, 197, 198, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 123, 124, + 125, 126, 127, 133, 76, 32, 34, 45, 50, 109, 110, 111, 112, 138, 140, 141, 142, 171, 76, + 76, 171, 260, 261, 36, 23, 24, 75, 76, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 113, 114, 115, 116, 117, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 160, 257, 257, 36, 169, 19, 7, + 76, 161, 145, 253, 159, 36, 42, 121, 123, 125, 126, 127, 130, 171, 146, 253, 35, 36, 42, + 123, 125, 126, 127, 128, 129, 132, 23, 24, 32, 34, 45, 50, 75, 76, 109, 110, 111, 112, + 134, 135, 136, 137, 139, 143, 144, 146, 148, 149, 150, 152, 153, 154, 170, 173, 175, 176, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 199, 200, 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, 166, 36, 16, 143, 152, 168, 169, 248, 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, 173, 139, - 248, 35, 168, 171, 171, 75, 170, 168, 170, 75, 75, 256, 256, 256, 75, 170, 168, 168, 170, - 170, 75, 75, 75, 168, 75, 168, 170, 170, 256, 75, 75, 170, 75, 171, 75, 194, 256, 194, - 194, 256, 256, 75, 256, 75, 168, 75, 168, 168, 75, 75, 75, 75, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 256, 75, 168, 36, 120, 121, 123, 125, 126, 129, 36, 36, 36, 36, - 168, 36, 36, 36, 248, 143, 12, 9, 8, 168, 36, 36, 36, 36, 36, 168, 168, 143, 36, - 168, 36, 36, 36, 6, 246, 168, 168, 36, 168, 36, 168, 36, 12, 36, 36, 10, 10, 168, - 246, 168, 36, 168, 36, 36, 168, 168, 168, 168, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 246, 168, 36, 168, 168, 35, 35, 168, 168, 168, 168, 168, 168, 35, 168, 168, 12, 168, - 168, 35, 168, 168, 168, 168, 168, 12, 168, 168, 168, 168, 168, 168, 12, 168, 35, 36, 36, - 13, 242, 11, 244, 244, 35, 168, 250, 250, 36, 35, 168, 35, 248, 36, 35, 15, 247, 12, - 12, 35, 168, 35, 35, 168, 168, 168, 35, 168, 35, 168, 14, 243, 168, 20, 245, 245, 36, - 168, 35, 35, 36, 36, 36, 35, 36, 168, 17, 168, 168, 36, 36, 36, 36, 35, 35, 35, - 36, 36, 36, 168, 21, 168, 242, 243, 36, 36, 36, 36, 168, 18, 18, 36, 36, 36, 36, - 36, 168, 243, 36, 36, 168, 168, 36, 36, 36, 36, 36, 36, 36, 36, 36}; + 237, 238, 239, 240, 241, 242, 243, 244, 245, 170, 36, 16, 145, 155, 172, 173, 252, 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, 177, 141, 252, 35, 172, 175, 175, 75, 174, 172, 174, 75, 75, 260, 260, 260, 75, + 174, 172, 172, 174, 174, 75, 75, 75, 172, 75, 172, 174, 174, 260, 75, 75, 174, 75, 175, + 75, 198, 260, 198, 198, 260, 260, 75, 260, 75, 172, 75, 172, 172, 75, 75, 75, 75, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 172, 260, 75, 172, 36, 122, 123, 125, 127, 128, 131, + 36, 36, 36, 36, 172, 36, 36, 36, 252, 145, 12, 9, 8, 172, 36, 36, 36, 36, 36, + 172, 172, 145, 36, 172, 36, 36, 36, 6, 250, 172, 172, 36, 172, 36, 172, 36, 12, 36, + 36, 10, 10, 172, 250, 172, 36, 172, 36, 36, 172, 172, 172, 172, 36, 36, 36, 36, 36, + 36, 36, 36, 36, 36, 250, 172, 36, 172, 172, 35, 35, 172, 172, 172, 172, 172, 172, 35, + 172, 172, 12, 172, 172, 35, 172, 172, 172, 172, 172, 12, 172, 172, 172, 172, 172, 172, 12, + 172, 35, 36, 36, 13, 246, 11, 248, 248, 35, 172, 254, 254, 36, 35, 172, 35, 252, 36, + 35, 15, 251, 12, 12, 35, 172, 35, 35, 172, 172, 172, 35, 172, 35, 172, 14, 247, 172, + 20, 249, 249, 36, 172, 35, 35, 36, 36, 36, 35, 36, 172, 17, 172, 172, 36, 36, 36, + 36, 35, 35, 35, 36, 36, 36, 172, 21, 172, 246, 247, 36, 36, 36, 36, 172, 18, 18, + 36, 36, 36, 36, 36, 172, 247, 36, 36, 172, 172, 36, 36, 36, 36, 36, 36, 36, 36, + 36}; const short PipelineParserGen::yyr1_[] = { - 0, 118, 254, 254, 255, 157, 157, 257, 256, 158, 158, 158, 158, 158, 158, 164, 159, 160, 167, - 167, 167, 167, 161, 162, 163, 165, 165, 128, 128, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 119, 119, 119, - 119, 251, 252, 252, 131, 131, 253, 122, 122, 122, 122, 125, 121, 121, 121, 121, 121, 121, 123, - 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 144, 145, 146, 147, 149, 150, 151, 132, 133, 134, 135, 137, 141, 142, 136, 136, 138, 138, 139, - 139, 140, 140, 148, 148, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 248, 248, 168, 168, 170, 169, 169, 169, 169, 169, 169, 169, 169, 171, - 172, 173, 173, 129, 120, 120, 120, 120, 126, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 175, 176, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 177, 177, 177, 178, 179, 180, 184, 184, 184, 184, 184, 184, 184, 184, - 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 185, 244, 244, 245, 245, - 186, 187, 250, 250, 250, 188, 189, 246, 246, 190, 197, 207, 247, 247, 194, 191, 192, 193, 195, - 196, 198, 199, 200, 201, 202, 203, 204, 205, 206, 181, 181, 182, 183, 143, 143, 153, 153, 154, - 249, 249, 155, 156, 156, 130, 127, 127, 127, 127, 127, 208, 208, 208, 208, 208, 208, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 242, 242, 243, - 243, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226}; + 0, 120, 258, 258, 259, 161, 161, 261, 260, 162, 162, 162, 162, 162, 162, 168, 163, 164, 171, + 171, 171, 171, 165, 166, 167, 169, 169, 130, 130, 170, 170, 170, 170, 170, 170, 170, 170, 170, + 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 121, 121, 121, + 121, 255, 256, 256, 133, 133, 257, 124, 124, 124, 124, 127, 123, 123, 123, 123, 123, 123, 125, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, + 146, 147, 160, 148, 149, 150, 152, 153, 154, 134, 135, 136, 137, 139, 143, 144, 138, 138, 140, + 140, 141, 141, 142, 142, 151, 151, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, + 155, 155, 155, 155, 155, 155, 155, 155, 155, 252, 252, 172, 172, 174, 173, 173, 173, 173, 173, + 173, 173, 173, 175, 176, 177, 177, 131, 122, 122, 122, 122, 128, 178, 178, 178, 178, 178, 178, + 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 179, 180, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 181, 181, 181, 182, 183, 184, 188, 188, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 189, + 248, 248, 249, 249, 190, 191, 254, 254, 254, 192, 193, 250, 250, 194, 201, 211, 251, 251, 198, + 195, 196, 197, 199, 200, 202, 203, 204, 205, 206, 207, 208, 209, 210, 185, 185, 186, 187, 145, + 145, 156, 156, 157, 253, 253, 158, 159, 159, 132, 129, 129, 129, 129, 129, 212, 212, 212, 212, + 212, 212, 212, 213, 214, 215, 216, 217, 218, 219, 220, 220, 220, 220, 220, 220, 220, 220, 220, + 220, 246, 246, 247, 247, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230}; 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, 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, 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, 3, 0, 4, 0, 2, 1, 1, 1, 1, 1, 1, 5, 3, 7, 1, 1, 1, 1, 2, 2, 4, 0, 2, 2, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 3, 0, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 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}; #if YYDEBUG || 1 @@ -5527,6 +5590,8 @@ const char* const PipelineParserGen::yytname_[] = {"\"EOF\"", "\"Timestamp\"", "\"minKey\"", "\"maxKey\"", + "\"$-prefixed string\"", + "\"$$-prefixed string\"", "START_PIPELINE", "START_MATCH", "$accept", @@ -5556,6 +5621,7 @@ const char* const PipelineParserGen::yytname_[] = {"\"EOF\"", "maxKey", "value", "string", + "fieldPath", "binary", "undefined", "objectId", @@ -5568,6 +5634,7 @@ const char* const PipelineParserGen::yytname_[] = {"\"EOF\"", "valueArray", "valueObject", "valueFields", + "variable", "stageList", "stage", "inhibitOptimization", @@ -5675,30 +5742,30 @@ const char* const PipelineParserGen::yytname_[] = {"\"EOF\"", #if YYDEBUG const short PipelineParserGen::yyrline_[] = { - 0, 279, 279, 280, 287, 293, 294, 302, 302, 305, 305, 305, 305, 305, 305, 308, - 318, 324, 334, 334, 334, 334, 338, 343, 348, 364, 367, 374, 377, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 397, 400, 403, 406, 409, 412, 415, - 418, 421, 424, 425, 426, 427, 436, 436, 436, 436, 440, 446, 449, 456, 459, 465, - 469, 469, 469, 469, 473, 481, 484, 487, 490, 493, 496, 505, 508, 511, 514, 517, - 520, 523, 526, 529, 532, 535, 538, 541, 544, 547, 550, 558, 561, 564, 567, 570, - 573, 576, 579, 582, 585, 588, 591, 594, 597, 600, 603, 606, 609, 612, 615, 618, - 621, 624, 627, 630, 633, 636, 639, 642, 645, 648, 651, 654, 657, 660, 663, 666, - 669, 672, 675, 678, 681, 684, 687, 690, 693, 696, 699, 702, 705, 708, 711, 714, - 717, 720, 723, 726, 729, 732, 735, 738, 745, 751, 757, 763, 769, 775, 781, 787, - 793, 799, 805, 811, 817, 823, 829, 832, 838, 841, 847, 850, 856, 859, 865, 868, - 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, - 890, 891, 892, 899, 900, 907, 907, 911, 916, 916, 916, 916, 916, 916, 917, 917, - 923, 931, 937, 940, 947, 954, 954, 954, 954, 958, 964, 964, 964, 964, 964, 964, - 964, 964, 964, 964, 964, 964, 964, 965, 965, 965, 965, 969, 976, 982, 987, 992, - 998, 1003, 1008, 1013, 1019, 1024, 1030, 1039, 1045, 1051, 1056, 1062, 1068, 1068, 1068, 1072, - 1079, 1086, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1094, 1094, 1094, 1094, 1094, 1094, 1094, - 1094, 1095, 1095, 1095, 1095, 1095, 1095, 1095, 1099, 1109, 1112, 1118, 1121, 1127, 1136, 1145, - 1148, 1151, 1157, 1168, 1179, 1182, 1188, 1196, 1204, 1212, 1215, 1220, 1229, 1235, 1241, 1247, - 1257, 1267, 1274, 1281, 1288, 1296, 1304, 1312, 1320, 1326, 1332, 1332, 1336, 1343, 1350, 1350, - 1354, 1354, 1358, 1364, 1365, 1372, 1378, 1381, 1388, 1395, 1396, 1397, 1398, 1399, 1402, 1402, - 1402, 1402, 1402, 1402, 1402, 1404, 1409, 1414, 1419, 1424, 1429, 1434, 1440, 1441, 1442, 1443, - 1444, 1445, 1446, 1447, 1448, 1449, 1454, 1457, 1464, 1467, 1473, 1483, 1488, 1493, 1498, 1503, - 1508, 1513, 1518, 1523}; + 0, 281, 281, 282, 289, 295, 296, 304, 304, 307, 307, 307, 307, 307, 307, 310, + 320, 326, 336, 336, 336, 336, 340, 345, 350, 366, 369, 376, 379, 385, 386, 387, + 388, 389, 390, 391, 392, 393, 394, 395, 396, 399, 402, 405, 408, 411, 414, 417, + 420, 423, 426, 427, 428, 429, 438, 438, 438, 438, 442, 448, 451, 458, 461, 467, + 471, 471, 471, 471, 475, 483, 486, 489, 492, 495, 498, 507, 510, 513, 516, 519, + 522, 525, 528, 531, 534, 537, 540, 543, 546, 549, 552, 560, 563, 566, 569, 572, + 575, 578, 581, 584, 587, 590, 593, 596, 599, 602, 605, 608, 611, 614, 617, 620, + 623, 626, 629, 632, 635, 638, 641, 644, 647, 650, 653, 656, 659, 662, 665, 668, + 671, 674, 677, 680, 683, 686, 689, 692, 695, 698, 701, 704, 707, 710, 713, 716, + 719, 722, 725, 728, 731, 734, 737, 740, 747, 752, 760, 769, 775, 781, 787, 793, + 799, 805, 811, 817, 823, 829, 835, 841, 847, 850, 856, 859, 865, 868, 874, 877, + 883, 886, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, + 906, 907, 908, 909, 910, 911, 912, 919, 920, 927, 927, 931, 936, 936, 936, 936, + 936, 936, 937, 937, 943, 951, 957, 960, 967, 974, 974, 974, 974, 978, 984, 984, + 984, 984, 984, 984, 984, 984, 984, 984, 984, 984, 984, 985, 985, 985, 985, 989, + 996, 1002, 1007, 1012, 1018, 1023, 1028, 1033, 1039, 1044, 1050, 1059, 1065, 1071, 1076, 1082, + 1088, 1088, 1088, 1092, 1099, 1106, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1114, 1114, 1114, + 1114, 1114, 1114, 1114, 1114, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1119, 1129, 1132, 1138, + 1141, 1147, 1156, 1165, 1168, 1171, 1177, 1188, 1199, 1202, 1208, 1216, 1224, 1232, 1235, 1240, + 1249, 1255, 1261, 1267, 1277, 1287, 1294, 1301, 1308, 1316, 1324, 1332, 1340, 1346, 1352, 1352, + 1356, 1363, 1370, 1370, 1374, 1374, 1378, 1384, 1385, 1392, 1398, 1401, 1408, 1415, 1416, 1417, + 1418, 1419, 1422, 1422, 1422, 1422, 1422, 1422, 1422, 1424, 1429, 1434, 1439, 1444, 1449, 1454, + 1460, 1461, 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1469, 1474, 1477, 1484, 1487, 1493, 1503, + 1508, 1513, 1518, 1523, 1528, 1533, 1538, 1543}; void PipelineParserGen::yy_stack_print_() const { *yycdebug_ << "Stack now"; @@ -5721,6 +5788,6 @@ void PipelineParserGen::yy_reduce_print_(int yyrule) const { #line 58 "pipeline_grammar.yy" } // namespace mongo -#line 5442 "pipeline_parser_gen.cpp" +#line 5502 "pipeline_parser_gen.cpp" -#line 1527 "pipeline_grammar.yy" +#line 1547 "pipeline_grammar.yy" diff --git a/src/mongo/db/cst/pipeline_parser_gen.hpp b/src/mongo/db/cst/pipeline_parser_gen.hpp index 2bb8e3a8c74..5edf0022f27 100644 --- a/src/mongo/db/cst/pipeline_parser_gen.hpp +++ b/src/mongo/db/cst/pipeline_parser_gen.hpp @@ -397,6 +397,7 @@ public: // maxKey // value // string + // fieldPath // binary // undefined // objectId @@ -409,6 +410,7 @@ public: // valueArray // valueObject // valueFields + // variable // stageList // stage // inhibitOptimization @@ -557,6 +559,8 @@ public: // "fieldname" // "string" + // "$-prefixed string" + // "$$-prefixed string" char dummy21[sizeof(std::string)]; // expressions @@ -718,8 +722,10 @@ public: TIMESTAMP = 113, // "Timestamp" MIN_KEY = 114, // "minKey" MAX_KEY = 115, // "maxKey" - START_PIPELINE = 116, // START_PIPELINE - START_MATCH = 117 // START_MATCH + DOLLAR_STRING = 116, // "$-prefixed string" + DOLLAR_DOLLAR_STRING = 117, // "$$-prefixed string" + START_PIPELINE = 118, // START_PIPELINE + START_MATCH = 119 // START_MATCH }; /// Backward compatibility alias (Bison 3.6). typedef token_kind_type yytokentype; @@ -734,7 +740,7 @@ public: /// Symbol kinds. struct symbol_kind { enum symbol_kind_type { - YYNTOKENS = 118, ///< Number of tokens. + YYNTOKENS = 120, ///< Number of tokens. S_YYEMPTY = -2, S_YYEOF = 0, // "EOF" S_YYerror = 1, // error @@ -852,148 +858,152 @@ public: S_TIMESTAMP = 113, // "Timestamp" S_MIN_KEY = 114, // "minKey" S_MAX_KEY = 115, // "maxKey" - S_START_PIPELINE = 116, // START_PIPELINE - S_START_MATCH = 117, // START_MATCH - S_YYACCEPT = 118, // $accept - S_projectionFieldname = 119, // projectionFieldname - S_expressionFieldname = 120, // expressionFieldname - S_stageAsUserFieldname = 121, // stageAsUserFieldname - S_filterFieldname = 122, // filterFieldname - S_argAsUserFieldname = 123, // argAsUserFieldname - S_aggExprAsUserFieldname = 124, // aggExprAsUserFieldname - S_invariableUserFieldname = 125, // invariableUserFieldname - S_idAsUserFieldname = 126, // idAsUserFieldname - S_valueFieldname = 127, // valueFieldname - S_projectField = 128, // projectField - S_expressionField = 129, // expressionField - S_valueField = 130, // valueField - S_filterField = 131, // filterField - S_dbPointer = 132, // dbPointer - S_javascript = 133, // javascript - S_symbol = 134, // symbol - S_javascriptWScope = 135, // javascriptWScope - S_int = 136, // int - S_timestamp = 137, // timestamp - S_long = 138, // long - S_double = 139, // double - S_decimal = 140, // decimal - S_minKey = 141, // minKey - S_maxKey = 142, // maxKey - S_value = 143, // value - S_string = 144, // string - S_binary = 145, // binary - S_undefined = 146, // undefined - S_objectId = 147, // objectId - S_bool = 148, // bool - S_date = 149, // date - S_null = 150, // null - S_regex = 151, // regex - S_simpleValue = 152, // simpleValue - S_compoundValue = 153, // compoundValue - S_valueArray = 154, // valueArray - S_valueObject = 155, // valueObject - S_valueFields = 156, // valueFields - S_stageList = 157, // stageList - S_stage = 158, // stage - S_inhibitOptimization = 159, // inhibitOptimization - S_unionWith = 160, // unionWith - S_skip = 161, // skip - S_limit = 162, // limit - S_project = 163, // project - S_sample = 164, // sample - S_projectFields = 165, // projectFields - S_projection = 166, // projection - S_num = 167, // num - S_expression = 168, // expression - S_compoundExpression = 169, // compoundExpression - S_exprFixedTwoArg = 170, // exprFixedTwoArg - S_expressionArray = 171, // expressionArray - S_expressionObject = 172, // expressionObject - S_expressionFields = 173, // expressionFields - S_maths = 174, // maths - S_add = 175, // add - S_atan2 = 176, // atan2 - S_boolExps = 177, // boolExps - S_and = 178, // and - S_or = 179, // or - S_not = 180, // not - S_literalEscapes = 181, // literalEscapes - S_const = 182, // const - S_literal = 183, // literal - S_stringExps = 184, // stringExps - S_concat = 185, // concat - S_dateFromString = 186, // dateFromString - S_dateToString = 187, // dateToString - S_indexOfBytes = 188, // indexOfBytes - S_indexOfCP = 189, // indexOfCP - S_ltrim = 190, // ltrim - S_regexFind = 191, // regexFind - S_regexFindAll = 192, // regexFindAll - S_regexMatch = 193, // regexMatch - S_regexArgs = 194, // regexArgs - S_replaceOne = 195, // replaceOne - S_replaceAll = 196, // replaceAll - S_rtrim = 197, // rtrim - S_split = 198, // split - S_strLenBytes = 199, // strLenBytes - S_strLenCP = 200, // strLenCP - S_strcasecmp = 201, // strcasecmp - S_substr = 202, // substr - S_substrBytes = 203, // substrBytes - S_substrCP = 204, // substrCP - S_toLower = 205, // toLower - S_toUpper = 206, // toUpper - S_trim = 207, // trim - S_compExprs = 208, // compExprs - S_cmp = 209, // cmp - S_eq = 210, // eq - S_gt = 211, // gt - S_gte = 212, // gte - S_lt = 213, // lt - S_lte = 214, // lte - S_ne = 215, // ne - S_typeExpression = 216, // typeExpression - S_convert = 217, // convert - S_toBool = 218, // toBool - S_toDate = 219, // toDate - S_toDecimal = 220, // toDecimal - S_toDouble = 221, // toDouble - S_toInt = 222, // toInt - S_toLong = 223, // toLong - S_toObjectId = 224, // toObjectId - S_toString = 225, // toString - S_type = 226, // type - S_abs = 227, // abs - S_ceil = 228, // ceil - S_divide = 229, // divide - S_exponent = 230, // exponent - S_floor = 231, // floor - S_ln = 232, // ln - S_log = 233, // log - S_logten = 234, // logten - S_mod = 235, // mod - S_multiply = 236, // multiply - S_pow = 237, // pow - S_round = 238, // round - S_sqrt = 239, // sqrt - S_subtract = 240, // subtract - S_trunc = 241, // trunc - S_onErrorArg = 242, // onErrorArg - S_onNullArg = 243, // onNullArg - S_formatArg = 244, // formatArg - S_timezoneArg = 245, // timezoneArg - S_charsArg = 246, // charsArg - S_optionsArg = 247, // optionsArg - S_expressions = 248, // expressions - S_values = 249, // values - S_exprZeroToTwo = 250, // exprZeroToTwo - S_matchExpression = 251, // matchExpression - S_filterFields = 252, // filterFields - S_filterVal = 253, // filterVal - S_start = 254, // start - S_pipeline = 255, // pipeline - S_START_ORDERED_OBJECT = 256, // START_ORDERED_OBJECT - S_257_1 = 257 // $@1 + S_DOLLAR_STRING = 116, // "$-prefixed string" + S_DOLLAR_DOLLAR_STRING = 117, // "$$-prefixed string" + S_START_PIPELINE = 118, // START_PIPELINE + S_START_MATCH = 119, // START_MATCH + S_YYACCEPT = 120, // $accept + S_projectionFieldname = 121, // projectionFieldname + S_expressionFieldname = 122, // expressionFieldname + S_stageAsUserFieldname = 123, // stageAsUserFieldname + S_filterFieldname = 124, // filterFieldname + S_argAsUserFieldname = 125, // argAsUserFieldname + S_aggExprAsUserFieldname = 126, // aggExprAsUserFieldname + S_invariableUserFieldname = 127, // invariableUserFieldname + S_idAsUserFieldname = 128, // idAsUserFieldname + S_valueFieldname = 129, // valueFieldname + S_projectField = 130, // projectField + S_expressionField = 131, // expressionField + S_valueField = 132, // valueField + S_filterField = 133, // filterField + S_dbPointer = 134, // dbPointer + S_javascript = 135, // javascript + S_symbol = 136, // symbol + S_javascriptWScope = 137, // javascriptWScope + S_int = 138, // int + S_timestamp = 139, // timestamp + S_long = 140, // long + S_double = 141, // double + S_decimal = 142, // decimal + S_minKey = 143, // minKey + S_maxKey = 144, // maxKey + S_value = 145, // value + S_string = 146, // string + S_fieldPath = 147, // fieldPath + S_binary = 148, // binary + S_undefined = 149, // undefined + S_objectId = 150, // objectId + S_bool = 151, // bool + S_date = 152, // date + S_null = 153, // null + S_regex = 154, // regex + S_simpleValue = 155, // simpleValue + S_compoundValue = 156, // compoundValue + S_valueArray = 157, // valueArray + S_valueObject = 158, // valueObject + S_valueFields = 159, // valueFields + S_variable = 160, // variable + S_stageList = 161, // stageList + S_stage = 162, // stage + S_inhibitOptimization = 163, // inhibitOptimization + S_unionWith = 164, // unionWith + S_skip = 165, // skip + S_limit = 166, // limit + S_project = 167, // project + S_sample = 168, // sample + S_projectFields = 169, // projectFields + S_projection = 170, // projection + S_num = 171, // num + S_expression = 172, // expression + S_compoundExpression = 173, // compoundExpression + S_exprFixedTwoArg = 174, // exprFixedTwoArg + S_expressionArray = 175, // expressionArray + S_expressionObject = 176, // expressionObject + S_expressionFields = 177, // expressionFields + S_maths = 178, // maths + S_add = 179, // add + S_atan2 = 180, // atan2 + S_boolExps = 181, // boolExps + S_and = 182, // and + S_or = 183, // or + S_not = 184, // not + S_literalEscapes = 185, // literalEscapes + S_const = 186, // const + S_literal = 187, // literal + S_stringExps = 188, // stringExps + S_concat = 189, // concat + S_dateFromString = 190, // dateFromString + S_dateToString = 191, // dateToString + S_indexOfBytes = 192, // indexOfBytes + S_indexOfCP = 193, // indexOfCP + S_ltrim = 194, // ltrim + S_regexFind = 195, // regexFind + S_regexFindAll = 196, // regexFindAll + S_regexMatch = 197, // regexMatch + S_regexArgs = 198, // regexArgs + S_replaceOne = 199, // replaceOne + S_replaceAll = 200, // replaceAll + S_rtrim = 201, // rtrim + S_split = 202, // split + S_strLenBytes = 203, // strLenBytes + S_strLenCP = 204, // strLenCP + S_strcasecmp = 205, // strcasecmp + S_substr = 206, // substr + S_substrBytes = 207, // substrBytes + S_substrCP = 208, // substrCP + S_toLower = 209, // toLower + S_toUpper = 210, // toUpper + S_trim = 211, // trim + S_compExprs = 212, // compExprs + S_cmp = 213, // cmp + S_eq = 214, // eq + S_gt = 215, // gt + S_gte = 216, // gte + S_lt = 217, // lt + S_lte = 218, // lte + S_ne = 219, // ne + S_typeExpression = 220, // typeExpression + S_convert = 221, // convert + S_toBool = 222, // toBool + S_toDate = 223, // toDate + S_toDecimal = 224, // toDecimal + S_toDouble = 225, // toDouble + S_toInt = 226, // toInt + S_toLong = 227, // toLong + S_toObjectId = 228, // toObjectId + S_toString = 229, // toString + S_type = 230, // type + S_abs = 231, // abs + S_ceil = 232, // ceil + S_divide = 233, // divide + S_exponent = 234, // exponent + S_floor = 235, // floor + S_ln = 236, // ln + S_log = 237, // log + S_logten = 238, // logten + S_mod = 239, // mod + S_multiply = 240, // multiply + S_pow = 241, // pow + S_round = 242, // round + S_sqrt = 243, // sqrt + S_subtract = 244, // subtract + S_trunc = 245, // trunc + S_onErrorArg = 246, // onErrorArg + S_onNullArg = 247, // onNullArg + S_formatArg = 248, // formatArg + S_timezoneArg = 249, // timezoneArg + S_charsArg = 250, // charsArg + S_optionsArg = 251, // optionsArg + S_expressions = 252, // expressions + S_values = 253, // values + S_exprZeroToTwo = 254, // exprZeroToTwo + S_matchExpression = 255, // matchExpression + S_filterFields = 256, // filterFields + S_filterVal = 257, // filterVal + S_start = 258, // start + S_pipeline = 259, // pipeline + S_START_ORDERED_OBJECT = 260, // START_ORDERED_OBJECT + S_261_1 = 261 // $@1 }; }; @@ -1046,131 +1056,133 @@ public: value.move<BSONSymbol>(std::move(that.value)); break; - case 132: // dbPointer - case 133: // javascript - case 134: // symbol - case 135: // javascriptWScope - case 136: // int - case 137: // timestamp - case 138: // long - case 139: // double - case 140: // decimal - case 141: // minKey - case 142: // maxKey - case 143: // value - case 144: // string - case 145: // binary - case 146: // undefined - case 147: // objectId - case 148: // bool - case 149: // date - case 150: // null - case 151: // regex - case 152: // simpleValue - case 153: // compoundValue - case 154: // valueArray - case 155: // valueObject - case 156: // valueFields - case 157: // stageList - case 158: // stage - case 159: // inhibitOptimization - case 160: // unionWith - case 161: // skip - case 162: // limit - case 163: // project - case 164: // sample - case 165: // projectFields - case 166: // projection - case 167: // num - case 168: // expression - case 169: // compoundExpression - case 170: // exprFixedTwoArg - case 171: // expressionArray - case 172: // expressionObject - case 173: // expressionFields - case 174: // maths - case 175: // add - case 176: // atan2 - case 177: // boolExps - case 178: // and - case 179: // or - case 180: // not - case 181: // literalEscapes - case 182: // const - case 183: // literal - case 184: // stringExps - case 185: // concat - case 186: // dateFromString - case 187: // dateToString - case 188: // indexOfBytes - case 189: // indexOfCP - case 190: // ltrim - case 191: // regexFind - case 192: // regexFindAll - case 193: // regexMatch - case 194: // regexArgs - case 195: // replaceOne - case 196: // replaceAll - case 197: // rtrim - case 198: // split - case 199: // strLenBytes - case 200: // strLenCP - case 201: // strcasecmp - case 202: // substr - case 203: // substrBytes - case 204: // substrCP - case 205: // toLower - case 206: // toUpper - case 207: // trim - case 208: // compExprs - case 209: // cmp - case 210: // eq - case 211: // gt - case 212: // gte - case 213: // lt - case 214: // lte - case 215: // ne - case 216: // typeExpression - case 217: // convert - case 218: // toBool - case 219: // toDate - case 220: // toDecimal - case 221: // toDouble - case 222: // toInt - case 223: // toLong - case 224: // toObjectId - case 225: // toString - case 226: // type - case 227: // abs - case 228: // ceil - case 229: // divide - case 230: // exponent - case 231: // floor - case 232: // ln - case 233: // log - case 234: // logten - case 235: // mod - case 236: // multiply - case 237: // pow - case 238: // round - case 239: // sqrt - case 240: // subtract - case 241: // trunc - case 251: // matchExpression - case 252: // filterFields - case 253: // filterVal + case 134: // dbPointer + case 135: // javascript + case 136: // symbol + case 137: // javascriptWScope + case 138: // int + case 139: // timestamp + case 140: // long + case 141: // double + case 142: // decimal + case 143: // minKey + case 144: // maxKey + case 145: // value + case 146: // string + case 147: // fieldPath + case 148: // binary + case 149: // undefined + case 150: // objectId + case 151: // bool + case 152: // date + case 153: // null + case 154: // regex + case 155: // simpleValue + case 156: // compoundValue + case 157: // valueArray + case 158: // valueObject + case 159: // valueFields + case 160: // variable + case 161: // stageList + case 162: // stage + case 163: // inhibitOptimization + case 164: // unionWith + case 165: // skip + case 166: // limit + case 167: // project + case 168: // sample + case 169: // projectFields + case 170: // projection + case 171: // num + case 172: // expression + case 173: // compoundExpression + case 174: // exprFixedTwoArg + case 175: // expressionArray + case 176: // expressionObject + case 177: // expressionFields + case 178: // maths + case 179: // add + case 180: // atan2 + case 181: // boolExps + case 182: // and + case 183: // or + case 184: // not + case 185: // literalEscapes + case 186: // const + case 187: // literal + case 188: // stringExps + case 189: // concat + case 190: // dateFromString + case 191: // dateToString + case 192: // indexOfBytes + case 193: // indexOfCP + case 194: // ltrim + case 195: // regexFind + case 196: // regexFindAll + case 197: // regexMatch + case 198: // regexArgs + case 199: // replaceOne + case 200: // replaceAll + case 201: // rtrim + case 202: // split + case 203: // strLenBytes + case 204: // strLenCP + case 205: // strcasecmp + case 206: // substr + case 207: // substrBytes + case 208: // substrCP + case 209: // toLower + case 210: // toUpper + case 211: // trim + case 212: // compExprs + case 213: // cmp + case 214: // eq + case 215: // gt + case 216: // gte + case 217: // lt + case 218: // lte + case 219: // ne + case 220: // typeExpression + case 221: // convert + case 222: // toBool + case 223: // toDate + case 224: // toDecimal + case 225: // toDouble + case 226: // toInt + case 227: // toLong + case 228: // toObjectId + case 229: // toString + case 230: // type + case 231: // abs + case 232: // ceil + case 233: // divide + case 234: // exponent + case 235: // floor + case 236: // ln + case 237: // log + case 238: // logten + case 239: // mod + case 240: // multiply + case 241: // pow + case 242: // round + case 243: // sqrt + case 244: // subtract + case 245: // trunc + case 255: // matchExpression + case 256: // filterFields + case 257: // filterVal value.move<CNode>(std::move(that.value)); break; - case 119: // projectionFieldname - case 120: // expressionFieldname - case 121: // stageAsUserFieldname - case 122: // filterFieldname - case 123: // argAsUserFieldname - case 124: // aggExprAsUserFieldname - case 125: // invariableUserFieldname - case 126: // idAsUserFieldname - case 127: // valueFieldname + case 121: // projectionFieldname + case 122: // expressionFieldname + case 123: // stageAsUserFieldname + case 124: // filterFieldname + case 125: // argAsUserFieldname + case 126: // aggExprAsUserFieldname + case 127: // invariableUserFieldname + case 128: // idAsUserFieldname + case 129: // valueFieldname value.move<CNode::Fieldname>(std::move(that.value)); break; @@ -1218,27 +1230,29 @@ public: value.move<long long>(std::move(that.value)); break; - case 128: // projectField - case 129: // expressionField - case 130: // valueField - case 131: // filterField - case 242: // onErrorArg - case 243: // onNullArg - case 244: // formatArg - case 245: // timezoneArg - case 246: // charsArg - case 247: // optionsArg + case 130: // projectField + case 131: // expressionField + case 132: // valueField + case 133: // filterField + case 246: // onErrorArg + case 247: // onNullArg + case 248: // formatArg + case 249: // timezoneArg + case 250: // charsArg + case 251: // optionsArg value.move<std::pair<CNode::Fieldname, CNode>>(std::move(that.value)); break; - case 97: // "fieldname" - case 98: // "string" + case 97: // "fieldname" + case 98: // "string" + case 116: // "$-prefixed string" + case 117: // "$$-prefixed string" value.move<std::string>(std::move(that.value)); break; - case 248: // expressions - case 249: // values - case 250: // exprZeroToTwo + case 252: // expressions + case 253: // values + case 254: // exprZeroToTwo value.move<std::vector<CNode>>(std::move(that.value)); break; @@ -1461,131 +1475,133 @@ public: value.template destroy<BSONSymbol>(); break; - case 132: // dbPointer - case 133: // javascript - case 134: // symbol - case 135: // javascriptWScope - case 136: // int - case 137: // timestamp - case 138: // long - case 139: // double - case 140: // decimal - case 141: // minKey - case 142: // maxKey - case 143: // value - case 144: // string - case 145: // binary - case 146: // undefined - case 147: // objectId - case 148: // bool - case 149: // date - case 150: // null - case 151: // regex - case 152: // simpleValue - case 153: // compoundValue - case 154: // valueArray - case 155: // valueObject - case 156: // valueFields - case 157: // stageList - case 158: // stage - case 159: // inhibitOptimization - case 160: // unionWith - case 161: // skip - case 162: // limit - case 163: // project - case 164: // sample - case 165: // projectFields - case 166: // projection - case 167: // num - case 168: // expression - case 169: // compoundExpression - case 170: // exprFixedTwoArg - case 171: // expressionArray - case 172: // expressionObject - case 173: // expressionFields - case 174: // maths - case 175: // add - case 176: // atan2 - case 177: // boolExps - case 178: // and - case 179: // or - case 180: // not - case 181: // literalEscapes - case 182: // const - case 183: // literal - case 184: // stringExps - case 185: // concat - case 186: // dateFromString - case 187: // dateToString - case 188: // indexOfBytes - case 189: // indexOfCP - case 190: // ltrim - case 191: // regexFind - case 192: // regexFindAll - case 193: // regexMatch - case 194: // regexArgs - case 195: // replaceOne - case 196: // replaceAll - case 197: // rtrim - case 198: // split - case 199: // strLenBytes - case 200: // strLenCP - case 201: // strcasecmp - case 202: // substr - case 203: // substrBytes - case 204: // substrCP - case 205: // toLower - case 206: // toUpper - case 207: // trim - case 208: // compExprs - case 209: // cmp - case 210: // eq - case 211: // gt - case 212: // gte - case 213: // lt - case 214: // lte - case 215: // ne - case 216: // typeExpression - case 217: // convert - case 218: // toBool - case 219: // toDate - case 220: // toDecimal - case 221: // toDouble - case 222: // toInt - case 223: // toLong - case 224: // toObjectId - case 225: // toString - case 226: // type - case 227: // abs - case 228: // ceil - case 229: // divide - case 230: // exponent - case 231: // floor - case 232: // ln - case 233: // log - case 234: // logten - case 235: // mod - case 236: // multiply - case 237: // pow - case 238: // round - case 239: // sqrt - case 240: // subtract - case 241: // trunc - case 251: // matchExpression - case 252: // filterFields - case 253: // filterVal + case 134: // dbPointer + case 135: // javascript + case 136: // symbol + case 137: // javascriptWScope + case 138: // int + case 139: // timestamp + case 140: // long + case 141: // double + case 142: // decimal + case 143: // minKey + case 144: // maxKey + case 145: // value + case 146: // string + case 147: // fieldPath + case 148: // binary + case 149: // undefined + case 150: // objectId + case 151: // bool + case 152: // date + case 153: // null + case 154: // regex + case 155: // simpleValue + case 156: // compoundValue + case 157: // valueArray + case 158: // valueObject + case 159: // valueFields + case 160: // variable + case 161: // stageList + case 162: // stage + case 163: // inhibitOptimization + case 164: // unionWith + case 165: // skip + case 166: // limit + case 167: // project + case 168: // sample + case 169: // projectFields + case 170: // projection + case 171: // num + case 172: // expression + case 173: // compoundExpression + case 174: // exprFixedTwoArg + case 175: // expressionArray + case 176: // expressionObject + case 177: // expressionFields + case 178: // maths + case 179: // add + case 180: // atan2 + case 181: // boolExps + case 182: // and + case 183: // or + case 184: // not + case 185: // literalEscapes + case 186: // const + case 187: // literal + case 188: // stringExps + case 189: // concat + case 190: // dateFromString + case 191: // dateToString + case 192: // indexOfBytes + case 193: // indexOfCP + case 194: // ltrim + case 195: // regexFind + case 196: // regexFindAll + case 197: // regexMatch + case 198: // regexArgs + case 199: // replaceOne + case 200: // replaceAll + case 201: // rtrim + case 202: // split + case 203: // strLenBytes + case 204: // strLenCP + case 205: // strcasecmp + case 206: // substr + case 207: // substrBytes + case 208: // substrCP + case 209: // toLower + case 210: // toUpper + case 211: // trim + case 212: // compExprs + case 213: // cmp + case 214: // eq + case 215: // gt + case 216: // gte + case 217: // lt + case 218: // lte + case 219: // ne + case 220: // typeExpression + case 221: // convert + case 222: // toBool + case 223: // toDate + case 224: // toDecimal + case 225: // toDouble + case 226: // toInt + case 227: // toLong + case 228: // toObjectId + case 229: // toString + case 230: // type + case 231: // abs + case 232: // ceil + case 233: // divide + case 234: // exponent + case 235: // floor + case 236: // ln + case 237: // log + case 238: // logten + case 239: // mod + case 240: // multiply + case 241: // pow + case 242: // round + case 243: // sqrt + case 244: // subtract + case 245: // trunc + case 255: // matchExpression + case 256: // filterFields + case 257: // filterVal value.template destroy<CNode>(); break; - case 119: // projectionFieldname - case 120: // expressionFieldname - case 121: // stageAsUserFieldname - case 122: // filterFieldname - case 123: // argAsUserFieldname - case 124: // aggExprAsUserFieldname - case 125: // invariableUserFieldname - case 126: // idAsUserFieldname - case 127: // valueFieldname + case 121: // projectionFieldname + case 122: // expressionFieldname + case 123: // stageAsUserFieldname + case 124: // filterFieldname + case 125: // argAsUserFieldname + case 126: // aggExprAsUserFieldname + case 127: // invariableUserFieldname + case 128: // idAsUserFieldname + case 129: // valueFieldname value.template destroy<CNode::Fieldname>(); break; @@ -1633,27 +1649,29 @@ public: value.template destroy<long long>(); break; - case 128: // projectField - case 129: // expressionField - case 130: // valueField - case 131: // filterField - case 242: // onErrorArg - case 243: // onNullArg - case 244: // formatArg - case 245: // timezoneArg - case 246: // charsArg - case 247: // optionsArg + case 130: // projectField + case 131: // expressionField + case 132: // valueField + case 133: // filterField + case 246: // onErrorArg + case 247: // onNullArg + case 248: // formatArg + case 249: // timezoneArg + case 250: // charsArg + case 251: // optionsArg value.template destroy<std::pair<CNode::Fieldname, CNode>>(); break; - case 97: // "fieldname" - case 98: // "string" + case 97: // "fieldname" + case 98: // "string" + case 116: // "$-prefixed string" + case 117: // "$$-prefixed string" value.template destroy<std::string>(); break; - case 248: // expressions - case 249: // values - case 250: // exprZeroToTwo + case 252: // expressions + case 253: // values + case 254: // exprZeroToTwo value.template destroy<std::vector<CNode>>(); break; @@ -2013,12 +2031,14 @@ public: #if 201103L <= YY_CPLUSPLUS symbol_type(int tok, std::string v, location_type l) : super_type(token_type(tok), std::move(v), std::move(l)) { - YY_ASSERT(tok == token::FIELDNAME || tok == token::STRING); + YY_ASSERT(tok == token::FIELDNAME || tok == token::STRING || + tok == token::DOLLAR_STRING || tok == token::DOLLAR_DOLLAR_STRING); } #else symbol_type(int tok, const std::string& v, const location_type& l) : super_type(token_type(tok), v, l) { - YY_ASSERT(tok == token::FIELDNAME || tok == token::STRING); + YY_ASSERT(tok == token::FIELDNAME || tok == token::STRING || + tok == token::DOLLAR_STRING || tok == token::DOLLAR_DOLLAR_STRING); } #endif }; @@ -3114,6 +3134,24 @@ public: } #endif #if 201103L <= YY_CPLUSPLUS + static symbol_type make_DOLLAR_STRING(std::string v, location_type l) { + return symbol_type(token::DOLLAR_STRING, std::move(v), std::move(l)); + } +#else + static symbol_type make_DOLLAR_STRING(const std::string& v, const location_type& l) { + return symbol_type(token::DOLLAR_STRING, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS + static symbol_type make_DOLLAR_DOLLAR_STRING(std::string v, location_type l) { + return symbol_type(token::DOLLAR_DOLLAR_STRING, std::move(v), std::move(l)); + } +#else + static symbol_type make_DOLLAR_DOLLAR_STRING(const std::string& v, const location_type& l) { + return symbol_type(token::DOLLAR_DOLLAR_STRING, v, l); + } +#endif +#if 201103L <= YY_CPLUSPLUS static symbol_type make_START_PIPELINE(location_type l) { return symbol_type(token::START_PIPELINE, std::move(l)); } @@ -3439,8 +3477,8 @@ private: /// Constants. enum { - yylast_ = 971, ///< Last index in yytable_. - yynnts_ = 140, ///< Number of nonterminal symbols. + yylast_ = 978, ///< Last index in yytable_. + yynnts_ = 142, ///< Number of nonterminal symbols. yyfinal_ = 8 ///< Termination state number. }; @@ -3483,131 +3521,133 @@ PipelineParserGen::basic_symbol<Base>::basic_symbol(const basic_symbol& that) value.copy<BSONSymbol>(YY_MOVE(that.value)); break; - case 132: // dbPointer - case 133: // javascript - case 134: // symbol - case 135: // javascriptWScope - case 136: // int - case 137: // timestamp - case 138: // long - case 139: // double - case 140: // decimal - case 141: // minKey - case 142: // maxKey - case 143: // value - case 144: // string - case 145: // binary - case 146: // undefined - case 147: // objectId - case 148: // bool - case 149: // date - case 150: // null - case 151: // regex - case 152: // simpleValue - case 153: // compoundValue - case 154: // valueArray - case 155: // valueObject - case 156: // valueFields - case 157: // stageList - case 158: // stage - case 159: // inhibitOptimization - case 160: // unionWith - case 161: // skip - case 162: // limit - case 163: // project - case 164: // sample - case 165: // projectFields - case 166: // projection - case 167: // num - case 168: // expression - case 169: // compoundExpression - case 170: // exprFixedTwoArg - case 171: // expressionArray - case 172: // expressionObject - case 173: // expressionFields - case 174: // maths - case 175: // add - case 176: // atan2 - case 177: // boolExps - case 178: // and - case 179: // or - case 180: // not - case 181: // literalEscapes - case 182: // const - case 183: // literal - case 184: // stringExps - case 185: // concat - case 186: // dateFromString - case 187: // dateToString - case 188: // indexOfBytes - case 189: // indexOfCP - case 190: // ltrim - case 191: // regexFind - case 192: // regexFindAll - case 193: // regexMatch - case 194: // regexArgs - case 195: // replaceOne - case 196: // replaceAll - case 197: // rtrim - case 198: // split - case 199: // strLenBytes - case 200: // strLenCP - case 201: // strcasecmp - case 202: // substr - case 203: // substrBytes - case 204: // substrCP - case 205: // toLower - case 206: // toUpper - case 207: // trim - case 208: // compExprs - case 209: // cmp - case 210: // eq - case 211: // gt - case 212: // gte - case 213: // lt - case 214: // lte - case 215: // ne - case 216: // typeExpression - case 217: // convert - case 218: // toBool - case 219: // toDate - case 220: // toDecimal - case 221: // toDouble - case 222: // toInt - case 223: // toLong - case 224: // toObjectId - case 225: // toString - case 226: // type - case 227: // abs - case 228: // ceil - case 229: // divide - case 230: // exponent - case 231: // floor - case 232: // ln - case 233: // log - case 234: // logten - case 235: // mod - case 236: // multiply - case 237: // pow - case 238: // round - case 239: // sqrt - case 240: // subtract - case 241: // trunc - case 251: // matchExpression - case 252: // filterFields - case 253: // filterVal + case 134: // dbPointer + case 135: // javascript + case 136: // symbol + case 137: // javascriptWScope + case 138: // int + case 139: // timestamp + case 140: // long + case 141: // double + case 142: // decimal + case 143: // minKey + case 144: // maxKey + case 145: // value + case 146: // string + case 147: // fieldPath + case 148: // binary + case 149: // undefined + case 150: // objectId + case 151: // bool + case 152: // date + case 153: // null + case 154: // regex + case 155: // simpleValue + case 156: // compoundValue + case 157: // valueArray + case 158: // valueObject + case 159: // valueFields + case 160: // variable + case 161: // stageList + case 162: // stage + case 163: // inhibitOptimization + case 164: // unionWith + case 165: // skip + case 166: // limit + case 167: // project + case 168: // sample + case 169: // projectFields + case 170: // projection + case 171: // num + case 172: // expression + case 173: // compoundExpression + case 174: // exprFixedTwoArg + case 175: // expressionArray + case 176: // expressionObject + case 177: // expressionFields + case 178: // maths + case 179: // add + case 180: // atan2 + case 181: // boolExps + case 182: // and + case 183: // or + case 184: // not + case 185: // literalEscapes + case 186: // const + case 187: // literal + case 188: // stringExps + case 189: // concat + case 190: // dateFromString + case 191: // dateToString + case 192: // indexOfBytes + case 193: // indexOfCP + case 194: // ltrim + case 195: // regexFind + case 196: // regexFindAll + case 197: // regexMatch + case 198: // regexArgs + case 199: // replaceOne + case 200: // replaceAll + case 201: // rtrim + case 202: // split + case 203: // strLenBytes + case 204: // strLenCP + case 205: // strcasecmp + case 206: // substr + case 207: // substrBytes + case 208: // substrCP + case 209: // toLower + case 210: // toUpper + case 211: // trim + case 212: // compExprs + case 213: // cmp + case 214: // eq + case 215: // gt + case 216: // gte + case 217: // lt + case 218: // lte + case 219: // ne + case 220: // typeExpression + case 221: // convert + case 222: // toBool + case 223: // toDate + case 224: // toDecimal + case 225: // toDouble + case 226: // toInt + case 227: // toLong + case 228: // toObjectId + case 229: // toString + case 230: // type + case 231: // abs + case 232: // ceil + case 233: // divide + case 234: // exponent + case 235: // floor + case 236: // ln + case 237: // log + case 238: // logten + case 239: // mod + case 240: // multiply + case 241: // pow + case 242: // round + case 243: // sqrt + case 244: // subtract + case 245: // trunc + case 255: // matchExpression + case 256: // filterFields + case 257: // filterVal value.copy<CNode>(YY_MOVE(that.value)); break; - case 119: // projectionFieldname - case 120: // expressionFieldname - case 121: // stageAsUserFieldname - case 122: // filterFieldname - case 123: // argAsUserFieldname - case 124: // aggExprAsUserFieldname - case 125: // invariableUserFieldname - case 126: // idAsUserFieldname - case 127: // valueFieldname + case 121: // projectionFieldname + case 122: // expressionFieldname + case 123: // stageAsUserFieldname + case 124: // filterFieldname + case 125: // argAsUserFieldname + case 126: // aggExprAsUserFieldname + case 127: // invariableUserFieldname + case 128: // idAsUserFieldname + case 129: // valueFieldname value.copy<CNode::Fieldname>(YY_MOVE(that.value)); break; @@ -3655,27 +3695,29 @@ PipelineParserGen::basic_symbol<Base>::basic_symbol(const basic_symbol& that) value.copy<long long>(YY_MOVE(that.value)); break; - case 128: // projectField - case 129: // expressionField - case 130: // valueField - case 131: // filterField - case 242: // onErrorArg - case 243: // onNullArg - case 244: // formatArg - case 245: // timezoneArg - case 246: // charsArg - case 247: // optionsArg + case 130: // projectField + case 131: // expressionField + case 132: // valueField + case 133: // filterField + case 246: // onErrorArg + case 247: // onNullArg + case 248: // formatArg + case 249: // timezoneArg + case 250: // charsArg + case 251: // optionsArg value.copy<std::pair<CNode::Fieldname, CNode>>(YY_MOVE(that.value)); break; - case 97: // "fieldname" - case 98: // "string" + case 97: // "fieldname" + case 98: // "string" + case 116: // "$-prefixed string" + case 117: // "$$-prefixed string" value.copy<std::string>(YY_MOVE(that.value)); break; - case 248: // expressions - case 249: // values - case 250: // exprZeroToTwo + case 252: // expressions + case 253: // values + case 254: // exprZeroToTwo value.copy<std::vector<CNode>>(YY_MOVE(that.value)); break; @@ -3724,131 +3766,133 @@ void PipelineParserGen::basic_symbol<Base>::move(basic_symbol& s) { value.move<BSONSymbol>(YY_MOVE(s.value)); break; - case 132: // dbPointer - case 133: // javascript - case 134: // symbol - case 135: // javascriptWScope - case 136: // int - case 137: // timestamp - case 138: // long - case 139: // double - case 140: // decimal - case 141: // minKey - case 142: // maxKey - case 143: // value - case 144: // string - case 145: // binary - case 146: // undefined - case 147: // objectId - case 148: // bool - case 149: // date - case 150: // null - case 151: // regex - case 152: // simpleValue - case 153: // compoundValue - case 154: // valueArray - case 155: // valueObject - case 156: // valueFields - case 157: // stageList - case 158: // stage - case 159: // inhibitOptimization - case 160: // unionWith - case 161: // skip - case 162: // limit - case 163: // project - case 164: // sample - case 165: // projectFields - case 166: // projection - case 167: // num - case 168: // expression - case 169: // compoundExpression - case 170: // exprFixedTwoArg - case 171: // expressionArray - case 172: // expressionObject - case 173: // expressionFields - case 174: // maths - case 175: // add - case 176: // atan2 - case 177: // boolExps - case 178: // and - case 179: // or - case 180: // not - case 181: // literalEscapes - case 182: // const - case 183: // literal - case 184: // stringExps - case 185: // concat - case 186: // dateFromString - case 187: // dateToString - case 188: // indexOfBytes - case 189: // indexOfCP - case 190: // ltrim - case 191: // regexFind - case 192: // regexFindAll - case 193: // regexMatch - case 194: // regexArgs - case 195: // replaceOne - case 196: // replaceAll - case 197: // rtrim - case 198: // split - case 199: // strLenBytes - case 200: // strLenCP - case 201: // strcasecmp - case 202: // substr - case 203: // substrBytes - case 204: // substrCP - case 205: // toLower - case 206: // toUpper - case 207: // trim - case 208: // compExprs - case 209: // cmp - case 210: // eq - case 211: // gt - case 212: // gte - case 213: // lt - case 214: // lte - case 215: // ne - case 216: // typeExpression - case 217: // convert - case 218: // toBool - case 219: // toDate - case 220: // toDecimal - case 221: // toDouble - case 222: // toInt - case 223: // toLong - case 224: // toObjectId - case 225: // toString - case 226: // type - case 227: // abs - case 228: // ceil - case 229: // divide - case 230: // exponent - case 231: // floor - case 232: // ln - case 233: // log - case 234: // logten - case 235: // mod - case 236: // multiply - case 237: // pow - case 238: // round - case 239: // sqrt - case 240: // subtract - case 241: // trunc - case 251: // matchExpression - case 252: // filterFields - case 253: // filterVal + case 134: // dbPointer + case 135: // javascript + case 136: // symbol + case 137: // javascriptWScope + case 138: // int + case 139: // timestamp + case 140: // long + case 141: // double + case 142: // decimal + case 143: // minKey + case 144: // maxKey + case 145: // value + case 146: // string + case 147: // fieldPath + case 148: // binary + case 149: // undefined + case 150: // objectId + case 151: // bool + case 152: // date + case 153: // null + case 154: // regex + case 155: // simpleValue + case 156: // compoundValue + case 157: // valueArray + case 158: // valueObject + case 159: // valueFields + case 160: // variable + case 161: // stageList + case 162: // stage + case 163: // inhibitOptimization + case 164: // unionWith + case 165: // skip + case 166: // limit + case 167: // project + case 168: // sample + case 169: // projectFields + case 170: // projection + case 171: // num + case 172: // expression + case 173: // compoundExpression + case 174: // exprFixedTwoArg + case 175: // expressionArray + case 176: // expressionObject + case 177: // expressionFields + case 178: // maths + case 179: // add + case 180: // atan2 + case 181: // boolExps + case 182: // and + case 183: // or + case 184: // not + case 185: // literalEscapes + case 186: // const + case 187: // literal + case 188: // stringExps + case 189: // concat + case 190: // dateFromString + case 191: // dateToString + case 192: // indexOfBytes + case 193: // indexOfCP + case 194: // ltrim + case 195: // regexFind + case 196: // regexFindAll + case 197: // regexMatch + case 198: // regexArgs + case 199: // replaceOne + case 200: // replaceAll + case 201: // rtrim + case 202: // split + case 203: // strLenBytes + case 204: // strLenCP + case 205: // strcasecmp + case 206: // substr + case 207: // substrBytes + case 208: // substrCP + case 209: // toLower + case 210: // toUpper + case 211: // trim + case 212: // compExprs + case 213: // cmp + case 214: // eq + case 215: // gt + case 216: // gte + case 217: // lt + case 218: // lte + case 219: // ne + case 220: // typeExpression + case 221: // convert + case 222: // toBool + case 223: // toDate + case 224: // toDecimal + case 225: // toDouble + case 226: // toInt + case 227: // toLong + case 228: // toObjectId + case 229: // toString + case 230: // type + case 231: // abs + case 232: // ceil + case 233: // divide + case 234: // exponent + case 235: // floor + case 236: // ln + case 237: // log + case 238: // logten + case 239: // mod + case 240: // multiply + case 241: // pow + case 242: // round + case 243: // sqrt + case 244: // subtract + case 245: // trunc + case 255: // matchExpression + case 256: // filterFields + case 257: // filterVal value.move<CNode>(YY_MOVE(s.value)); break; - case 119: // projectionFieldname - case 120: // expressionFieldname - case 121: // stageAsUserFieldname - case 122: // filterFieldname - case 123: // argAsUserFieldname - case 124: // aggExprAsUserFieldname - case 125: // invariableUserFieldname - case 126: // idAsUserFieldname - case 127: // valueFieldname + case 121: // projectionFieldname + case 122: // expressionFieldname + case 123: // stageAsUserFieldname + case 124: // filterFieldname + case 125: // argAsUserFieldname + case 126: // aggExprAsUserFieldname + case 127: // invariableUserFieldname + case 128: // idAsUserFieldname + case 129: // valueFieldname value.move<CNode::Fieldname>(YY_MOVE(s.value)); break; @@ -3896,27 +3940,29 @@ void PipelineParserGen::basic_symbol<Base>::move(basic_symbol& s) { value.move<long long>(YY_MOVE(s.value)); break; - case 128: // projectField - case 129: // expressionField - case 130: // valueField - case 131: // filterField - case 242: // onErrorArg - case 243: // onNullArg - case 244: // formatArg - case 245: // timezoneArg - case 246: // charsArg - case 247: // optionsArg + case 130: // projectField + case 131: // expressionField + case 132: // valueField + case 133: // filterField + case 246: // onErrorArg + case 247: // onNullArg + case 248: // formatArg + case 249: // timezoneArg + case 250: // charsArg + case 251: // optionsArg value.move<std::pair<CNode::Fieldname, CNode>>(YY_MOVE(s.value)); break; - case 97: // "fieldname" - case 98: // "string" + case 97: // "fieldname" + case 98: // "string" + case 116: // "$-prefixed string" + case 117: // "$$-prefixed string" value.move<std::string>(YY_MOVE(s.value)); break; - case 248: // expressions - case 249: // values - case 250: // exprZeroToTwo + case 252: // expressions + case 253: // values + case 254: // exprZeroToTwo value.move<std::vector<CNode>>(YY_MOVE(s.value)); break; @@ -3960,7 +4006,7 @@ inline PipelineParserGen::symbol_kind_type PipelineParserGen::by_kind::type_get( #line 58 "pipeline_grammar.yy" } // namespace mongo -#line 4900 "pipeline_parser_gen.hpp" +#line 4956 "pipeline_parser_gen.hpp" #endif // !YY_YY_PIPELINE_PARSER_GEN_HPP_INCLUDED diff --git a/src/mongo/db/pipeline/SConscript b/src/mongo/db/pipeline/SConscript index 31e47662a07..887fb93486b 100644 --- a/src/mongo/db/pipeline/SConscript +++ b/src/mongo/db/pipeline/SConscript @@ -55,6 +55,15 @@ env.Library( ) env.Library( + target='variable_validation', + source=[ + "variable_validation.cpp", + ], + LIBDEPS=[ + '$BUILD_DIR/mongo/base', + ] +) +env.Library( target='expression_context', source=[ 'expression.cpp', @@ -80,6 +89,7 @@ env.Library( '$BUILD_DIR/mongo/util/summation', 'aggregation_request', 'dependencies', + 'variable_validation', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/vector_clock', diff --git a/src/mongo/db/pipeline/document_source_graph_lookup_test.cpp b/src/mongo/db/pipeline/document_source_graph_lookup_test.cpp index 5d4fe741a6c..c59ed9c2ea4 100644 --- a/src/mongo/db/pipeline/document_source_graph_lookup_test.cpp +++ b/src/mongo/db/pipeline/document_source_graph_lookup_test.cpp @@ -87,17 +87,17 @@ TEST_F(DocumentSourceGraphLookUpTest, expCtx->setResolvedNamespaces(StringMap<ExpressionContext::ResolvedNamespace>{ {fromNs.coll().toString(), {fromNs, std::vector<BSONObj>()}}}); expCtx->mongoProcessInterface = std::make_shared<MockMongoInterface>(std::move(fromContents)); - auto graphLookupStage = - DocumentSourceGraphLookUp::create(expCtx, - fromNs, - "results", - "from", - "to", - ExpressionFieldPath::create(expCtx.get(), "_id"), - boost::none, - boost::none, - boost::none, - boost::none); + auto graphLookupStage = DocumentSourceGraphLookUp::create( + expCtx, + fromNs, + "results", + "from", + "to", + ExpressionFieldPath::deprecatedCreate(expCtx.get(), "_id"), + boost::none, + boost::none, + boost::none, + boost::none); graphLookupStage->setSource(inputMock.get()); ASSERT_THROWS_CODE(graphLookupStage->getNext(), AssertionException, 40271); } @@ -116,17 +116,17 @@ TEST_F(DocumentSourceGraphLookUpTest, expCtx->setResolvedNamespaces(StringMap<ExpressionContext::ResolvedNamespace>{ {fromNs.coll().toString(), {fromNs, std::vector<BSONObj>()}}}); expCtx->mongoProcessInterface = std::make_shared<MockMongoInterface>(std::move(fromContents)); - auto graphLookupStage = - DocumentSourceGraphLookUp::create(expCtx, - fromNs, - "results", - "from", - "to", - ExpressionFieldPath::create(expCtx.get(), "_id"), - boost::none, - boost::none, - boost::none, - boost::none); + auto graphLookupStage = DocumentSourceGraphLookUp::create( + expCtx, + fromNs, + "results", + "from", + "to", + ExpressionFieldPath::deprecatedCreate(expCtx.get(), "_id"), + boost::none, + boost::none, + boost::none, + boost::none); graphLookupStage->setSource(inputMock.get()); ASSERT_THROWS_CODE(graphLookupStage->getNext(), AssertionException, 40271); @@ -146,17 +146,17 @@ TEST_F(DocumentSourceGraphLookUpTest, {fromNs.coll().toString(), {fromNs, std::vector<BSONObj>()}}}); expCtx->mongoProcessInterface = std::make_shared<MockMongoInterface>(std::move(fromContents)); auto unwindStage = DocumentSourceUnwind::create(expCtx, "results", false, boost::none); - auto graphLookupStage = - DocumentSourceGraphLookUp::create(expCtx, - fromNs, - "results", - "from", - "to", - ExpressionFieldPath::create(expCtx.get(), "_id"), - boost::none, - boost::none, - boost::none, - unwindStage); + auto graphLookupStage = DocumentSourceGraphLookUp::create( + expCtx, + fromNs, + "results", + "from", + "to", + ExpressionFieldPath::deprecatedCreate(expCtx.get(), "_id"), + boost::none, + boost::none, + boost::none, + unwindStage); graphLookupStage->setSource(inputMock.get()); ASSERT_THROWS_CODE(graphLookupStage->getNext(), AssertionException, 40271); @@ -189,17 +189,17 @@ TEST_F(DocumentSourceGraphLookUpTest, expCtx->setResolvedNamespaces(StringMap<ExpressionContext::ResolvedNamespace>{ {fromNs.coll().toString(), {fromNs, std::vector<BSONObj>()}}}); expCtx->mongoProcessInterface = std::make_shared<MockMongoInterface>(std::move(fromContents)); - auto graphLookupStage = - DocumentSourceGraphLookUp::create(expCtx, - fromNs, - "results", - "from", - "to", - ExpressionFieldPath::create(expCtx.get(), "_id"), - boost::none, - boost::none, - boost::none, - boost::none); + auto graphLookupStage = DocumentSourceGraphLookUp::create( + expCtx, + fromNs, + "results", + "from", + "to", + ExpressionFieldPath::deprecatedCreate(expCtx.get(), "_id"), + boost::none, + boost::none, + boost::none, + boost::none); graphLookupStage->setSource(inputMock.get()); graphLookupStage->setSource(inputMock.get()); @@ -253,17 +253,17 @@ TEST_F(DocumentSourceGraphLookUpTest, ShouldPropagatePauses) { expCtx->setResolvedNamespaces(StringMap<ExpressionContext::ResolvedNamespace>{ {fromNs.coll().toString(), {fromNs, std::vector<BSONObj>()}}}); expCtx->mongoProcessInterface = std::make_shared<MockMongoInterface>(std::move(fromContents)); - auto graphLookupStage = - DocumentSourceGraphLookUp::create(expCtx, - fromNs, - "results", - "from", - "to", - ExpressionFieldPath::create(expCtx.get(), "startPoint"), - boost::none, - boost::none, - boost::none, - boost::none); + auto graphLookupStage = DocumentSourceGraphLookUp::create( + expCtx, + fromNs, + "results", + "from", + "to", + ExpressionFieldPath::deprecatedCreate(expCtx.get(), "startPoint"), + boost::none, + boost::none, + boost::none, + boost::none); graphLookupStage->setSource(inputMock.get()); @@ -329,17 +329,17 @@ TEST_F(DocumentSourceGraphLookUpTest, ShouldPropagatePausesWhileUnwinding) { auto unwindStage = DocumentSourceUnwind::create( expCtx, "results", preserveNullAndEmptyArrays, includeArrayIndex); - auto graphLookupStage = - DocumentSourceGraphLookUp::create(expCtx, - fromNs, - "results", - "from", - "to", - ExpressionFieldPath::create(expCtx.get(), "startPoint"), - boost::none, - boost::none, - boost::none, - unwindStage); + auto graphLookupStage = DocumentSourceGraphLookUp::create( + expCtx, + fromNs, + "results", + "from", + "to", + ExpressionFieldPath::deprecatedCreate(expCtx.get(), "startPoint"), + boost::none, + boost::none, + boost::none, + unwindStage); graphLookupStage->setSource(inputMock.get()); @@ -388,17 +388,17 @@ TEST_F(DocumentSourceGraphLookUpTest, GraphLookupShouldReportAsFieldIsModified) {fromNs.coll().toString(), {fromNs, std::vector<BSONObj>()}}}); expCtx->mongoProcessInterface = std::make_shared<MockMongoInterface>(std::deque<DocumentSource::GetNextResult>{}); - auto graphLookupStage = - DocumentSourceGraphLookUp::create(expCtx, - fromNs, - "results", - "from", - "to", - ExpressionFieldPath::create(expCtx.get(), "startPoint"), - boost::none, - boost::none, - boost::none, - boost::none); + auto graphLookupStage = DocumentSourceGraphLookUp::create( + expCtx, + fromNs, + "results", + "from", + "to", + ExpressionFieldPath::deprecatedCreate(expCtx.get(), "startPoint"), + boost::none, + boost::none, + boost::none, + boost::none); auto modifiedPaths = graphLookupStage->getModifiedPaths(); ASSERT(modifiedPaths.type == DocumentSource::GetModPathsReturn::Type::kFiniteSet); @@ -415,17 +415,17 @@ TEST_F(DocumentSourceGraphLookUpTest, GraphLookupShouldReportFieldsModifiedByAbs std::make_shared<MockMongoInterface>(std::deque<DocumentSource::GetNextResult>{}); auto unwindStage = DocumentSourceUnwind::create(expCtx, "results", false, std::string("arrIndex")); - auto graphLookupStage = - DocumentSourceGraphLookUp::create(expCtx, - fromNs, - "results", - "from", - "to", - ExpressionFieldPath::create(expCtx.get(), "startPoint"), - boost::none, - boost::none, - boost::none, - unwindStage); + auto graphLookupStage = DocumentSourceGraphLookUp::create( + expCtx, + fromNs, + "results", + "from", + "to", + ExpressionFieldPath::deprecatedCreate(expCtx.get(), "startPoint"), + boost::none, + boost::none, + boost::none, + unwindStage); auto modifiedPaths = graphLookupStage->getModifiedPaths(); ASSERT(modifiedPaths.type == DocumentSource::GetModPathsReturn::Type::kFiniteSet); @@ -455,8 +455,8 @@ TEST_F(DocumentSourceGraphLookUpTest, GraphLookupWithComparisonExpressionForStar "to", ExpressionCompare::create(expCtx.get(), ExpressionCompare::GT, - ExpressionFieldPath::create(expCtx.get(), "a"), - ExpressionFieldPath::create(expCtx.get(), "b")), + ExpressionFieldPath::deprecatedCreate(expCtx.get(), "a"), + ExpressionFieldPath::deprecatedCreate(expCtx.get(), "b")), boost::none, boost::none, boost::none, @@ -510,17 +510,17 @@ TEST_F(DocumentSourceGraphLookUpTest, ShouldExpandArraysAtEndOfConnectFromField) expCtx->setResolvedNamespaces(StringMap<ExpressionContext::ResolvedNamespace>{ {fromNs.coll().toString(), {fromNs, std::vector<BSONObj>()}}}); expCtx->mongoProcessInterface = std::make_shared<MockMongoInterface>(std::move(fromContents)); - auto graphLookupStage = - DocumentSourceGraphLookUp::create(expCtx, - fromNs, - "results", - "to", - "_id", - ExpressionFieldPath::create(expCtx.get(), "startVal"), - boost::none, - boost::none, - boost::none, - boost::none); + auto graphLookupStage = DocumentSourceGraphLookUp::create( + expCtx, + fromNs, + "results", + "to", + "_id", + ExpressionFieldPath::deprecatedCreate(expCtx.get(), "startVal"), + boost::none, + boost::none, + boost::none, + boost::none); graphLookupStage->setSource(inputMock.get()); graphLookupStage->setSource(inputMock.get()); @@ -583,17 +583,17 @@ TEST_F(DocumentSourceGraphLookUpTest, ShouldNotExpandArraysWithinArraysAtEndOfCo expCtx->setResolvedNamespaces(StringMap<ExpressionContext::ResolvedNamespace>{ {fromNs.coll().toString(), {fromNs, std::vector<BSONObj>()}}}); expCtx->mongoProcessInterface = std::make_shared<MockMongoInterface>(std::move(fromContents)); - auto graphLookupStage = - DocumentSourceGraphLookUp::create(expCtx, - fromNs, - "results", - "connectedTo", - "coordinate", - ExpressionFieldPath::create(expCtx.get(), "startVal"), - boost::none, - boost::none, - boost::none, - boost::none); + auto graphLookupStage = DocumentSourceGraphLookUp::create( + expCtx, + fromNs, + "results", + "connectedTo", + "coordinate", + ExpressionFieldPath::deprecatedCreate(expCtx.get(), "startVal"), + boost::none, + boost::none, + boost::none, + boost::none); graphLookupStage->setSource(inputMock.get()); graphLookupStage->setSource(inputMock.get()); diff --git a/src/mongo/db/pipeline/document_source_group.cpp b/src/mongo/db/pipeline/document_source_group.cpp index cf31fd10c6e..d53ca4fb3cf 100644 --- a/src/mongo/db/pipeline/document_source_group.cpp +++ b/src/mongo/db/pipeline/document_source_group.cpp @@ -826,7 +826,7 @@ DocumentSourceGroup::rewriteGroupAsTransformOnFirstDocument() const { // The _id field can be specified either as a fieldpath (ex. _id: "$a") or as a singleton // object (ex. _id: {v: "$a"}). if (_idFieldNames.empty()) { - idField = ExpressionFieldPath::create(pExpCtx.get(), groupId); + idField = ExpressionFieldPath::deprecatedCreate(pExpCtx.get(), groupId); } else { invariant(_idFieldNames.size() == 1); idField = ExpressionObject::create(pExpCtx.get(), diff --git a/src/mongo/db/pipeline/document_source_lookup.cpp b/src/mongo/db/pipeline/document_source_lookup.cpp index 25fe9668ce0..94a4071d4ad 100644 --- a/src/mongo/db/pipeline/document_source_lookup.cpp +++ b/src/mongo/db/pipeline/document_source_lookup.cpp @@ -42,6 +42,7 @@ #include "mongo/db/pipeline/document_source_merge_gen.h" #include "mongo/db/pipeline/expression.h" #include "mongo/db/pipeline/expression_context.h" +#include "mongo/db/pipeline/variable_validation.h" #include "mongo/db/query/query_knobs_gen.h" #include "mongo/platform/overflow_arithmetic.h" #include "mongo/util/fail_point.h" @@ -158,7 +159,7 @@ DocumentSourceLookUp::DocumentSourceLookUp(NamespaceString fromNs, for (auto&& varElem : letVariables) { const auto varName = varElem.fieldNameStringData(); - Variables::validateNameForUserWrite(varName); + variableValidation::validateNameForUserWrite(varName); _letVariables.emplace_back( varName.toString(), diff --git a/src/mongo/db/pipeline/document_source_merge.cpp b/src/mongo/db/pipeline/document_source_merge.cpp index 2dd399d6fce..2b8223d8753 100644 --- a/src/mongo/db/pipeline/document_source_merge.cpp +++ b/src/mongo/db/pipeline/document_source_merge.cpp @@ -40,6 +40,7 @@ #include "mongo/db/curop_failpoint_helpers.h" #include "mongo/db/ops/write_ops.h" #include "mongo/db/pipeline/document_path_support.h" +#include "mongo/db/pipeline/variable_validation.h" #include "mongo/logv2/log.h" namespace mongo { @@ -370,7 +371,7 @@ DocumentSourceMerge::DocumentSourceMerge(NamespaceString outputNs, for (auto&& varElem : *letVariables) { const auto varName = varElem.fieldNameStringData(); - Variables::validateNameForUserWrite(varName); + variableValidation::validateNameForUserWrite(varName); _letVariables->emplace( varName.toString(), diff --git a/src/mongo/db/pipeline/expression.cpp b/src/mongo/db/pipeline/expression.cpp index 71d24d13528..c6c0823eee7 100644 --- a/src/mongo/db/pipeline/expression.cpp +++ b/src/mongo/db/pipeline/expression.cpp @@ -45,6 +45,7 @@ #include "mongo/db/hasher.h" #include "mongo/db/jsobj.h" #include "mongo/db/pipeline/expression_context.h" +#include "mongo/db/pipeline/variable_validation.h" #include "mongo/db/query/datetime/date_time_support.h" #include "mongo/platform/bits.h" #include "mongo/platform/decimal128.h" @@ -2045,8 +2046,8 @@ Expression::ComputedPaths ExpressionObject::getComputedPaths(const std::string& /* --------------------- ExpressionFieldPath --------------------------- */ // this is the old deprecated version only used by tests not using variables -intrusive_ptr<ExpressionFieldPath> ExpressionFieldPath::create(ExpressionContext* const expCtx, - const string& fieldPath) { +intrusive_ptr<ExpressionFieldPath> ExpressionFieldPath::deprecatedCreate( + ExpressionContext* const expCtx, const string& fieldPath) { return new ExpressionFieldPath(expCtx, "CURRENT." + fieldPath, Variables::kRootId); } @@ -2066,7 +2067,7 @@ intrusive_ptr<ExpressionFieldPath> ExpressionFieldPath::parse(ExpressionContext* const StringData rawSD = raw; const StringData fieldPath = rawSD.substr(2); // strip off $$ const StringData varName = fieldPath.substr(0, fieldPath.find('.')); - Variables::validateNameForUserRead(varName); + variableValidation::validateNameForUserRead(varName); auto varId = vps.getVariable(varName); return new ExpressionFieldPath(expCtx, fieldPath.toString(), varId); } else { @@ -2076,6 +2077,18 @@ intrusive_ptr<ExpressionFieldPath> ExpressionFieldPath::parse(ExpressionContext* } } +intrusive_ptr<ExpressionFieldPath> ExpressionFieldPath::createPathFromString( + ExpressionContext* const expCtx, const string& raw, const VariablesParseState& vps) { + return new ExpressionFieldPath(expCtx, "CURRENT." + raw, vps.getVariable("CURRENT")); +} +intrusive_ptr<ExpressionFieldPath> ExpressionFieldPath::createVarFromString( + ExpressionContext* const expCtx, const string& raw, const VariablesParseState& vps) { + const auto rawSD = StringData{raw}; + const StringData varName = rawSD.substr(0, rawSD.find('.')); + auto varId = vps.getVariable(varName); + return new ExpressionFieldPath(expCtx, raw, varId); +} + ExpressionFieldPath::ExpressionFieldPath(ExpressionContext* const expCtx, const string& theFieldPath, Variables::Id variable) @@ -2249,7 +2262,7 @@ intrusive_ptr<Expression> ExpressionFilter::parse(ExpressionContext* const expCt // If "as" is not specified, then use "this" by default. auto varName = asElem.eoo() ? "this" : asElem.str(); - Variables::validateNameForUserWrite(varName); + variableValidation::validateNameForUserWrite(varName); Variables::Id varId = vpsSub.defineVariable(varName); // Parse "cond", has access to "as" variable. @@ -2379,7 +2392,7 @@ intrusive_ptr<Expression> ExpressionLet::parse(ExpressionContext* const expCtx, std::vector<Variables::Id> orderedVariableIds; for (auto&& varElem : varsObj) { const string varName = varElem.fieldName(); - Variables::validateNameForUserWrite(varName); + variableValidation::validateNameForUserWrite(varName); Variables::Id id = vpsSub.defineVariable(varName); orderedVariableIds.push_back(id); @@ -2491,7 +2504,7 @@ intrusive_ptr<Expression> ExpressionMap::parse(ExpressionContext* const expCtx, // If "as" is not specified, then use "this" by default. auto varName = asElem.eoo() ? "this" : asElem.str(); - Variables::validateNameForUserWrite(varName); + variableValidation::validateNameForUserWrite(varName); Variables::Id varId = vpsSub.defineVariable(varName); // parse "in" diff --git a/src/mongo/db/pipeline/expression.h b/src/mongo/db/pipeline/expression.h index a21f4c8bd39..fc6f16c0eb8 100644 --- a/src/mongo/db/pipeline/expression.h +++ b/src/mongo/db/pipeline/expression.h @@ -1384,13 +1384,19 @@ public: indicator @returns the newly created field path expression */ - static boost::intrusive_ptr<ExpressionFieldPath> create(ExpressionContext* const expCtx, - const std::string& fieldPath); + static boost::intrusive_ptr<ExpressionFieldPath> deprecatedCreate( + ExpressionContext* const expCtx, const std::string& fieldPath); - /// Like create(), but works with the raw std::string from the user with the "$" prefixes. + // Parse from the raw std::string from the user with the "$" prefixes. static boost::intrusive_ptr<ExpressionFieldPath> parse(ExpressionContext* const expCtx, const std::string& raw, const VariablesParseState& vps); + // Create from a non-prefixed string. Assumes path not variable. + static boost::intrusive_ptr<ExpressionFieldPath> createPathFromString( + ExpressionContext* const expCtx, const std::string& raw, const VariablesParseState& vps); + // Create from a non-prefixed string. Assumes variable not path. + static boost::intrusive_ptr<ExpressionFieldPath> createVarFromString( + ExpressionContext* const expCtx, const std::string& raw, const VariablesParseState& vps); /** * Returns true if this expression logically represents the path 'dottedPath'. For example, if diff --git a/src/mongo/db/pipeline/expression_field_path_test.cpp b/src/mongo/db/pipeline/expression_field_path_test.cpp index 14064134b9d..9fa73620dfe 100644 --- a/src/mongo/db/pipeline/expression_field_path_test.cpp +++ b/src/mongo/db/pipeline/expression_field_path_test.cpp @@ -68,7 +68,7 @@ class Invalid { public: void run() { auto expCtx = ExpressionContextForTest{}; - ASSERT_THROWS(ExpressionFieldPath::create(&expCtx, ""), AssertionException); + ASSERT_THROWS(ExpressionFieldPath::deprecatedCreate(&expCtx, ""), AssertionException); } }; @@ -104,7 +104,7 @@ TEST(FieldPath, RemoveOptimizesToMissingValue) { TEST(FieldPath, NoOptimizationOnNormalPath) { auto expCtx = ExpressionContextForTest{}; - intrusive_ptr<Expression> expression = ExpressionFieldPath::create(&expCtx, "a"); + intrusive_ptr<Expression> expression = ExpressionFieldPath::deprecatedCreate(&expCtx, "a"); // An attempt to optimize returns the Expression itself. ASSERT_EQUALS(expression, expression->optimize()); } @@ -205,7 +205,8 @@ class Dependencies { public: void run() { auto expCtx = ExpressionContextForTest{}; - intrusive_ptr<Expression> expression = ExpressionFieldPath::create(&expCtx, "a.b"); + intrusive_ptr<Expression> expression = + ExpressionFieldPath::deprecatedCreate(&expCtx, "a.b"); DepsTracker dependencies; expression->addDependencies(&dependencies); ASSERT_EQUALS(1U, dependencies.fields.size()); @@ -220,7 +221,7 @@ class Missing { public: void run() { auto expCtx = ExpressionContextForTest{}; - intrusive_ptr<Expression> expression = ExpressionFieldPath::create(&expCtx, "a"); + intrusive_ptr<Expression> expression = ExpressionFieldPath::deprecatedCreate(&expCtx, "a"); ASSERT_BSONOBJ_BINARY_EQ(fromjson("{}"), toBson(expression->evaluate({}, &expCtx.variables))); } @@ -231,7 +232,7 @@ class Present { public: void run() { auto expCtx = ExpressionContextForTest{}; - intrusive_ptr<Expression> expression = ExpressionFieldPath::create(&expCtx, "a"); + intrusive_ptr<Expression> expression = ExpressionFieldPath::deprecatedCreate(&expCtx, "a"); ASSERT_BSONOBJ_BINARY_EQ( fromjson("{'':123}"), toBson(expression->evaluate(fromBson(BSON("a" << 123)), &expCtx.variables))); @@ -243,7 +244,8 @@ class NestedBelowNull { public: void run() { auto expCtx = ExpressionContextForTest{}; - intrusive_ptr<Expression> expression = ExpressionFieldPath::create(&expCtx, "a.b"); + intrusive_ptr<Expression> expression = + ExpressionFieldPath::deprecatedCreate(&expCtx, "a.b"); ASSERT_BSONOBJ_BINARY_EQ( fromjson("{}"), toBson(expression->evaluate(fromBson(fromjson("{a:null}")), &expCtx.variables))); @@ -255,7 +257,8 @@ class NestedBelowUndefined { public: void run() { auto expCtx = ExpressionContextForTest{}; - intrusive_ptr<Expression> expression = ExpressionFieldPath::create(&expCtx, "a.b"); + intrusive_ptr<Expression> expression = + ExpressionFieldPath::deprecatedCreate(&expCtx, "a.b"); ASSERT_BSONOBJ_BINARY_EQ( fromjson("{}"), toBson(expression->evaluate(fromBson(fromjson("{a:undefined}")), &expCtx.variables))); @@ -267,7 +270,8 @@ class NestedBelowMissing { public: void run() { auto expCtx = ExpressionContextForTest{}; - intrusive_ptr<Expression> expression = ExpressionFieldPath::create(&expCtx, "a.b"); + intrusive_ptr<Expression> expression = + ExpressionFieldPath::deprecatedCreate(&expCtx, "a.b"); ASSERT_BSONOBJ_BINARY_EQ( fromjson("{}"), toBson(expression->evaluate(fromBson(fromjson("{z:1}")), &expCtx.variables))); @@ -279,7 +283,8 @@ class NestedBelowInt { public: void run() { auto expCtx = ExpressionContextForTest{}; - intrusive_ptr<Expression> expression = ExpressionFieldPath::create(&expCtx, "a.b"); + intrusive_ptr<Expression> expression = + ExpressionFieldPath::deprecatedCreate(&expCtx, "a.b"); ASSERT_BSONOBJ_BINARY_EQ( fromjson("{}"), toBson(expression->evaluate(fromBson(BSON("a" << 2)), &expCtx.variables))); @@ -291,7 +296,8 @@ class NestedValue { public: void run() { auto expCtx = ExpressionContextForTest{}; - intrusive_ptr<Expression> expression = ExpressionFieldPath::create(&expCtx, "a.b"); + intrusive_ptr<Expression> expression = + ExpressionFieldPath::deprecatedCreate(&expCtx, "a.b"); ASSERT_BSONOBJ_BINARY_EQ(BSON("" << 55), toBson(expression->evaluate(fromBson(BSON("a" << BSON("b" << 55))), &expCtx.variables))); @@ -303,7 +309,8 @@ class NestedBelowEmptyObject { public: void run() { auto expCtx = ExpressionContextForTest{}; - intrusive_ptr<Expression> expression = ExpressionFieldPath::create(&expCtx, "a.b"); + intrusive_ptr<Expression> expression = + ExpressionFieldPath::deprecatedCreate(&expCtx, "a.b"); ASSERT_BSONOBJ_BINARY_EQ( fromjson("{}"), toBson(expression->evaluate(fromBson(BSON("a" << BSONObj())), &expCtx.variables))); @@ -315,7 +322,8 @@ class NestedBelowEmptyArray { public: void run() { auto expCtx = ExpressionContextForTest{}; - intrusive_ptr<Expression> expression = ExpressionFieldPath::create(&expCtx, "a.b"); + intrusive_ptr<Expression> expression = + ExpressionFieldPath::deprecatedCreate(&expCtx, "a.b"); ASSERT_BSONOBJ_BINARY_EQ( BSON("" << BSONArray()), toBson(expression->evaluate(fromBson(BSON("a" << BSONArray())), &expCtx.variables))); @@ -327,7 +335,8 @@ class NestedBelowArrayWithNull { public: void run() { auto expCtx = ExpressionContextForTest{}; - intrusive_ptr<Expression> expression = ExpressionFieldPath::create(&expCtx, "a.b"); + intrusive_ptr<Expression> expression = + ExpressionFieldPath::deprecatedCreate(&expCtx, "a.b"); ASSERT_BSONOBJ_BINARY_EQ( fromjson("{'':[]}"), toBson(expression->evaluate(fromBson(fromjson("{a:[null]}")), &expCtx.variables))); @@ -339,7 +348,8 @@ class NestedBelowArrayWithUndefined { public: void run() { auto expCtx = ExpressionContextForTest{}; - intrusive_ptr<Expression> expression = ExpressionFieldPath::create(&expCtx, "a.b"); + intrusive_ptr<Expression> expression = + ExpressionFieldPath::deprecatedCreate(&expCtx, "a.b"); ASSERT_BSONOBJ_BINARY_EQ( fromjson("{'':[]}"), toBson(expression->evaluate(fromBson(fromjson("{a:[undefined]}")), &expCtx.variables))); @@ -351,7 +361,8 @@ class NestedBelowArrayWithInt { public: void run() { auto expCtx = ExpressionContextForTest{}; - intrusive_ptr<Expression> expression = ExpressionFieldPath::create(&expCtx, "a.b"); + intrusive_ptr<Expression> expression = + ExpressionFieldPath::deprecatedCreate(&expCtx, "a.b"); ASSERT_BSONOBJ_BINARY_EQ( fromjson("{'':[]}"), toBson(expression->evaluate(fromBson(fromjson("{a:[1]}")), &expCtx.variables))); @@ -363,7 +374,8 @@ class NestedWithinArray { public: void run() { auto expCtx = ExpressionContextForTest{}; - intrusive_ptr<Expression> expression = ExpressionFieldPath::create(&expCtx, "a.b"); + intrusive_ptr<Expression> expression = + ExpressionFieldPath::deprecatedCreate(&expCtx, "a.b"); ASSERT_BSONOBJ_BINARY_EQ( fromjson("{'':[9]}"), toBson(expression->evaluate(fromBson(fromjson("{a:[{b:9}]}")), &expCtx.variables))); @@ -375,7 +387,8 @@ class MultipleArrayValues { public: void run() { auto expCtx = ExpressionContextForTest{}; - intrusive_ptr<Expression> expression = ExpressionFieldPath::create(&expCtx, "a.b"); + intrusive_ptr<Expression> expression = + ExpressionFieldPath::deprecatedCreate(&expCtx, "a.b"); ASSERT_BSONOBJ_BINARY_EQ( fromjson("{'':[9,20]}"), toBson(expression->evaluate( @@ -389,7 +402,8 @@ class ExpandNestedArrays { public: void run() { auto expCtx = ExpressionContextForTest{}; - intrusive_ptr<Expression> expression = ExpressionFieldPath::create(&expCtx, "a.b.c"); + intrusive_ptr<Expression> expression = + ExpressionFieldPath::deprecatedCreate(&expCtx, "a.b.c"); ASSERT_BSONOBJ_BINARY_EQ( fromjson("{'':[[1,2],3,[4],[[5]],[6,7]]}"), toBson(expression->evaluate(fromBson(fromjson("{a:[{b:[{c:1},{c:2}]}," @@ -406,7 +420,8 @@ class AddToBsonObj { public: void run() { auto expCtx = ExpressionContextForTest{}; - intrusive_ptr<Expression> expression = ExpressionFieldPath::create(&expCtx, "a.b.c"); + intrusive_ptr<Expression> expression = + ExpressionFieldPath::deprecatedCreate(&expCtx, "a.b.c"); ASSERT_BSONOBJ_BINARY_EQ(BSON("foo" << "$a.b.c"), BSON("foo" << expression->serialize(false))); @@ -418,7 +433,8 @@ class AddToBsonArray { public: void run() { auto expCtx = ExpressionContextForTest{}; - intrusive_ptr<Expression> expression = ExpressionFieldPath::create(&expCtx, "a.b.c"); + intrusive_ptr<Expression> expression = + ExpressionFieldPath::deprecatedCreate(&expCtx, "a.b.c"); BSONArrayBuilder bab; bab << expression->serialize(false); ASSERT_BSONOBJ_BINARY_EQ(BSON_ARRAY("$a.b.c"), bab.arr()); diff --git a/src/mongo/db/pipeline/expression_nary_test.cpp b/src/mongo/db/pipeline/expression_nary_test.cpp index 3b709c4c7ae..3d284235335 100644 --- a/src/mongo/db/pipeline/expression_nary_test.cpp +++ b/src/mongo/db/pipeline/expression_nary_test.cpp @@ -208,7 +208,8 @@ TEST_F(ExpressionNaryTest, AddedConstantOperandIsSerialized) { } TEST_F(ExpressionNaryTest, AddedFieldPathOperandIsSerialized) { - _notAssociativeNorCommutative->addOperand(ExpressionFieldPath::create(&expCtx, "ab.c")); + _notAssociativeNorCommutative->addOperand( + ExpressionFieldPath::deprecatedCreate(&expCtx, "ab.c")); assertContents(_notAssociativeNorCommutative, BSON_ARRAY("$ab.c")); } @@ -222,7 +223,8 @@ TEST_F(ExpressionNaryTest, ValidateConstantExpressionDependency) { } TEST_F(ExpressionNaryTest, ValidateFieldPathExpressionDependency) { - _notAssociativeNorCommutative->addOperand(ExpressionFieldPath::create(&expCtx, "ab.c")); + _notAssociativeNorCommutative->addOperand( + ExpressionFieldPath::deprecatedCreate(&expCtx, "ab.c")); assertDependencies(_notAssociativeNorCommutative, BSON_ARRAY("ab.c")); } diff --git a/src/mongo/db/pipeline/expression_object_test.cpp b/src/mongo/db/pipeline/expression_object_test.cpp index 5b339bf911b..7246e9569e3 100644 --- a/src/mongo/db/pipeline/expression_object_test.cpp +++ b/src/mongo/db/pipeline/expression_object_test.cpp @@ -211,10 +211,11 @@ TEST(ExpressionObjectEvaluate, ShouldEvaluateEachField) { TEST(ExpressionObjectEvaluate, OrderOfFieldsInOutputShouldMatchOrderInSpecification) { auto expCtx = ExpressionContextForTest{}; - auto object = ExpressionObject::create(&expCtx, - {{"a", ExpressionFieldPath::create(&expCtx, "a")}, - {"b", ExpressionFieldPath::create(&expCtx, "b")}, - {"c", ExpressionFieldPath::create(&expCtx, "c")}}); + auto object = + ExpressionObject::create(&expCtx, + {{"a", ExpressionFieldPath::deprecatedCreate(&expCtx, "a")}, + {"b", ExpressionFieldPath::deprecatedCreate(&expCtx, "b")}, + {"c", ExpressionFieldPath::deprecatedCreate(&expCtx, "c")}}); ASSERT_VALUE_EQ( Value(Document{{"a", "A"_sd}, {"b", "B"_sd}, {"c", "C"_sd}}), object->evaluate(Document{{"c", "C"_sd}, {"a", "A"_sd}, {"b", "B"_sd}, {"_id", "ID"_sd}}, @@ -223,10 +224,10 @@ TEST(ExpressionObjectEvaluate, OrderOfFieldsInOutputShouldMatchOrderInSpecificat TEST(ExpressionObjectEvaluate, ShouldRemoveFieldsThatHaveMissingValues) { auto expCtx = ExpressionContextForTest{}; - auto object = - ExpressionObject::create(&expCtx, - {{"a", ExpressionFieldPath::create(&expCtx, "a.b")}, - {"b", ExpressionFieldPath::create(&expCtx, "missing")}}); + auto object = ExpressionObject::create( + &expCtx, + {{"a", ExpressionFieldPath::deprecatedCreate(&expCtx, "a.b")}, + {"b", ExpressionFieldPath::deprecatedCreate(&expCtx, "missing")}}); ASSERT_VALUE_EQ(Value(Document{}), object->evaluate(Document(), &(expCtx.variables))); ASSERT_VALUE_EQ(Value(Document{}), object->evaluate(Document{{"a", 1}}, &(expCtx.variables))); } @@ -236,9 +237,10 @@ TEST(ExpressionObjectEvaluate, ShouldEvaluateFieldsWithinNestedObject) { auto object = ExpressionObject::create( &expCtx, {{"a", - ExpressionObject::create(&expCtx, - {{"b", ExpressionConstant::create(&expCtx, Value{1})}, - {"c", ExpressionFieldPath::create(&expCtx, "_id")}})}}); + ExpressionObject::create( + &expCtx, + {{"b", ExpressionConstant::create(&expCtx, Value{1})}, + {"c", ExpressionFieldPath::deprecatedCreate(&expCtx, "_id")}})}}); ASSERT_VALUE_EQ(Value(Document{{"a", Document{{"b", 1}}}}), object->evaluate(Document(), &(expCtx.variables))); ASSERT_VALUE_EQ(Value(Document{{"a", Document{{"b", 1}, {"c", "ID"_sd}}}}), @@ -247,8 +249,8 @@ TEST(ExpressionObjectEvaluate, ShouldEvaluateFieldsWithinNestedObject) { TEST(ExpressionObjectEvaluate, ShouldEvaluateToEmptyDocumentIfAllFieldsAreMissing) { auto expCtx = ExpressionContextForTest{}; - auto object = - ExpressionObject::create(&expCtx, {{"a", ExpressionFieldPath::create(&expCtx, "missing")}}); + auto object = ExpressionObject::create( + &expCtx, {{"a", ExpressionFieldPath::deprecatedCreate(&expCtx, "missing")}}); ASSERT_VALUE_EQ(Value(Document{}), object->evaluate(Document(), &(expCtx.variables))); auto objectWithNestedObject = ExpressionObject::create(&expCtx, {{"nested", object}}); @@ -271,8 +273,8 @@ TEST(ExpressionObjectDependencies, ConstantValuesShouldNotBeAddedToDependencies) TEST(ExpressionObjectDependencies, FieldPathsShouldBeAddedToDependencies) { auto expCtx = ExpressionContextForTest{}; - auto object = - ExpressionObject::create(&expCtx, {{"x", ExpressionFieldPath::create(&expCtx, "c.d")}}); + auto object = ExpressionObject::create( + &expCtx, {{"x", ExpressionFieldPath::deprecatedCreate(&expCtx, "c.d")}}); DepsTracker deps; object->addDependencies(&deps); ASSERT_EQ(deps.fields.size(), 1UL); diff --git a/src/mongo/db/pipeline/expression_test.cpp b/src/mongo/db/pipeline/expression_test.cpp index 5288fe96c00..e1eeb44d3d2 100644 --- a/src/mongo/db/pipeline/expression_test.cpp +++ b/src/mongo/db/pipeline/expression_test.cpp @@ -548,7 +548,7 @@ class Dependencies { public: void run() { auto expCtx = ExpressionContextForTest{}; - intrusive_ptr<Expression> nested = ExpressionFieldPath::create(&expCtx, "a.b"); + intrusive_ptr<Expression> nested = ExpressionFieldPath::deprecatedCreate(&expCtx, "a.b"); intrusive_ptr<Expression> expression = ExpressionCoerceToBool::create(&expCtx, nested); DepsTracker dependencies; expression->addDependencies(&dependencies); @@ -564,8 +564,8 @@ class AddToBsonObj { public: void run() { auto expCtx = ExpressionContextForTest{}; - intrusive_ptr<Expression> expression = - ExpressionCoerceToBool::create(&expCtx, ExpressionFieldPath::create(&expCtx, "foo")); + intrusive_ptr<Expression> expression = ExpressionCoerceToBool::create( + &expCtx, ExpressionFieldPath::deprecatedCreate(&expCtx, "foo")); // serialized as $and because CoerceToBool isn't an ExpressionNary ASSERT_BSONOBJ_BINARY_EQ(fromjson("{field:{$and:['$foo']}}"), toBsonObj(expression)); @@ -582,8 +582,8 @@ class AddToBsonArray { public: void run() { auto expCtx = ExpressionContextForTest{}; - intrusive_ptr<Expression> expression = - ExpressionCoerceToBool::create(&expCtx, ExpressionFieldPath::create(&expCtx, "foo")); + intrusive_ptr<Expression> expression = ExpressionCoerceToBool::create( + &expCtx, ExpressionFieldPath::deprecatedCreate(&expCtx, "foo")); // serialized as $and because CoerceToBool isn't an ExpressionNary ASSERT_BSONOBJ_BINARY_EQ(BSON_ARRAY(fromjson("{$and:['$foo']}")), toBsonArray(expression)); diff --git a/src/mongo/db/pipeline/variable_validation.cpp b/src/mongo/db/pipeline/variable_validation.cpp new file mode 100644 index 00000000000..a0b29b2f59e --- /dev/null +++ b/src/mongo/db/pipeline/variable_validation.cpp @@ -0,0 +1,82 @@ +/** + * Copyright (C) 2020-present MongoDB, Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the Server Side Public License, version 1, + * as published by MongoDB, Inc. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * Server Side Public License for more details. + * + * You should have received a copy of the Server Side Public License + * along with this program. If not, see + * <http://www.mongodb.com/licensing/server-side-public-license>. + * + * As a special exception, the copyright holders give permission to link the + * code of portions of this program with the OpenSSL library under certain + * conditions as described in each individual source file and distribute + * linked combinations including the program with the OpenSSL library. You + * must comply with the Server Side Public License in all respects for + * all of the code used other than as permitted herein. If you modify file(s) + * with this exception, you may extend this exception to your version of the + * file(s), but you are not obligated to do so. If you do not wish to do so, + * delete this exception statement from your version. If you delete this + * exception statement from all source files in the program, then also delete + * it in the license file. + */ + +#include "mongo/base/error_codes.h" +#include "mongo/util/str.h" + +namespace mongo::variableValidation { +void validateName(StringData varName, + std::function<bool(char)> prefixPred, + std::function<bool(char)> suffixPred, + int prefixLen) { + uassert(16866, "empty variable names are not allowed", !varName.empty()); + for (int i = 0; i < prefixLen; ++i) + if (!prefixPred(varName[i])) + uasserted(16867, + str::stream() + << "'" << varName + << "' starts with an invalid character for a user variable name"); + + for (size_t i = prefixLen; i < varName.size(); i++) + if (!suffixPred(varName[i])) + uasserted(16868, + str::stream() << "'" << varName << "' contains an invalid character " + << "for a variable name: '" << varName[i] << "'"); +} + +void validateNameForUserWrite(StringData varName) { + // System variables users allowed to write to (currently just one) + if (varName == "CURRENT") { + return; + } + validateName(varName, + [](char ch) -> bool { + return (ch >= 'a' && ch <= 'z') || (ch & '\x80'); // non-ascii + }, + [](char ch) -> bool { + return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || + (ch >= '0' && ch <= '9') || (ch == '_') || (ch & '\x80'); // non-ascii + }, + 1); +} + +void validateNameForUserRead(StringData varName) { + validateName(varName, + [](char ch) -> bool { + return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || + (ch & '\x80'); // non-ascii + }, + [](char ch) -> bool { + return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || + (ch >= '0' && ch <= '9') || (ch == '_') || (ch & '\x80'); // non-ascii + }, + 1); +} + +} // namespace mongo::variableValidation diff --git a/src/mongo/db/pipeline/variable_validation.h b/src/mongo/db/pipeline/variable_validation.h new file mode 100644 index 00000000000..a11b1df49cd --- /dev/null +++ b/src/mongo/db/pipeline/variable_validation.h @@ -0,0 +1,40 @@ +/** + * 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 + + +namespace mongo::variableValidation { +void validateNameForUserWrite(StringData varName); +void validateNameForUserRead(StringData varName); +void validateName(StringData varName, + std::function<bool(char)> prefixPred, + std::function<bool(char)> suffixPred, + int prefixLen); +} // namespace mongo::variableValidation diff --git a/src/mongo/db/pipeline/variables.cpp b/src/mongo/db/pipeline/variables.cpp index 485569152d1..28d8e135271 100644 --- a/src/mongo/db/pipeline/variables.cpp +++ b/src/mongo/db/pipeline/variables.cpp @@ -32,6 +32,7 @@ #include "mongo/db/client.h" #include "mongo/db/logical_clock.h" #include "mongo/db/pipeline/expression.h" +#include "mongo/db/pipeline/variable_validation.h" #include "mongo/platform/basic.h" #include "mongo/platform/random.h" #include "mongo/util/str.h" @@ -88,54 +89,6 @@ const std::map<StringData, std::function<void(const Value&)>> Variables::kSystem value.getType() == BSONType::Bool); }}}; -void Variables::validateName(StringData varName, - std::function<bool(char)> prefixPred, - std::function<bool(char)> suffixPred, - int prefixLen) { - uassert(16866, "empty variable names are not allowed", !varName.empty()); - for (int i = 0; i < prefixLen; ++i) - if (!prefixPred(varName[i])) - uasserted(16867, - str::stream() - << "'" << varName - << "' starts with an invalid character for a user variable name"); - - for (size_t i = prefixLen; i < varName.size(); i++) - if (!suffixPred(varName[i])) - uasserted(16868, - str::stream() << "'" << varName << "' contains an invalid character " - << "for a variable name: '" << varName[i] << "'"); -} - -void Variables::validateNameForUserWrite(StringData varName) { - // System variables users allowed to write to (currently just one) - if (varName == "CURRENT") { - return; - } - validateName(varName, - [](char ch) -> bool { - return (ch >= 'a' && ch <= 'z') || (ch & '\x80'); // non-ascii - }, - [](char ch) -> bool { - return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || - (ch >= '0' && ch <= '9') || (ch == '_') || (ch & '\x80'); // non-ascii - }, - 1); -} - -void Variables::validateNameForUserRead(StringData varName) { - validateName(varName, - [](char ch) -> bool { - return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || - (ch & '\x80'); // non-ascii - }, - [](char ch) -> bool { - return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || - (ch >= '0' && ch <= '9') || (ch == '_') || (ch & '\x80'); // non-ascii - }, - 1); -} - void Variables::setValue(Id id, const Value& value, bool isConstant) { uassert(17199, "can't use Variables::setValue to set a reserved builtin variable", id >= 0); @@ -236,7 +189,7 @@ void Variables::setDefaultRuntimeConstants(OperationContext* opCtx) { void Variables::seedVariablesWithLetParameters(ExpressionContext* const expCtx, const BSONObj letParams) { for (auto&& elem : letParams) { - Variables::validateNameForUserWrite(elem.fieldName()); + variableValidation::validateNameForUserWrite(elem.fieldName()); auto expr = Expression::parseOperand(expCtx, elem, expCtx->variablesParseState); uassert(4890500, @@ -287,7 +240,7 @@ void Variables::copyToExpCtx(const VariablesParseState& vps, ExpressionContext* } Variables::Id VariablesParseState::defineVariable(StringData name) { - // Caller should have validated before hand by using Variables::validateNameForUserWrite. + // Caller should have validated before hand by using variableValidationvalidateNameForUserWrite. massert(17275, "Can't redefine a non-user-writable variable", Variables::kBuiltinVarNameToId.find(name) == Variables::kBuiltinVarNameToId.end()); diff --git a/src/mongo/db/pipeline/variables.h b/src/mongo/db/pipeline/variables.h index 6cf5256a640..b200d04e115 100644 --- a/src/mongo/db/pipeline/variables.h +++ b/src/mongo/db/pipeline/variables.h @@ -73,8 +73,6 @@ public: Variables() = default; - static void validateNameForUserWrite(StringData varName); - static void validateNameForUserRead(StringData varName); static bool isUserDefinedVariable(Variables::Id id) { return id >= 0; } @@ -199,11 +197,6 @@ private: void setValue(Id id, const Value& value, bool isConstant); - static void validateName(StringData varName, - std::function<bool(char)> prefixPred, - std::function<bool(char)> suffixPred, - int prefixLen); - static auto getBuiltinVariableName(Variables::Id variable) { for (auto& [name, id] : kBuiltinVarNameToId) { if (variable == id) { diff --git a/src/mongo/db/update/pipeline_executor.cpp b/src/mongo/db/update/pipeline_executor.cpp index fec64dccdf5..910470f994d 100644 --- a/src/mongo/db/update/pipeline_executor.cpp +++ b/src/mongo/db/update/pipeline_executor.cpp @@ -35,6 +35,7 @@ #include "mongo/db/bson/dotted_path_support.h" #include "mongo/db/pipeline/document_source_queue.h" #include "mongo/db/pipeline/lite_parsed_pipeline.h" +#include "mongo/db/pipeline/variable_validation.h" #include "mongo/db/update/document_diff_calculator.h" #include "mongo/db/update/object_replace_executor.h" #include "mongo/db/update/storage_validation.h" @@ -62,7 +63,7 @@ PipelineExecutor::PipelineExecutor(const boost::intrusive_ptr<ExpressionContext> if (constants) { for (auto&& constElem : *constants) { const auto constName = constElem.fieldNameStringData(); - Variables::validateNameForUserRead(constName); + variableValidation::validateNameForUserRead(constName); auto varId = _expCtx->variablesParseState.defineVariable(constName); _expCtx->variables.setConstantValue(varId, Value(constElem)); |