Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::RecursiveFunctionExpressionMatcher Class Reference
Inheritance diagram for duckdb::RecursiveFunctionExpressionMatcher:
Collaboration diagram for duckdb::RecursiveFunctionExpressionMatcher:

Public Member Functions

 RecursiveFunctionExpressionMatcher (vector< unique_ptr< FunctionExpressionMatcher > > func_matchers)
bool Match (Expression &expr, vector< reference< Expression > > &bindings) override
Public Member Functions inherited from duckdb::ExpressionMatcher
 ExpressionMatcher (ExpressionClass type=ExpressionClass::INVALID)

Private Member Functions

void RecursiveMatch (FunctionExpressionMatcher *func_matcher, Expression &expr, vector< reference< Expression > > &bindings)

Private Attributes

vector< unique_ptr< FunctionExpressionMatcher > > func_matchers

Additional Inherited Members

Public Attributes inherited from duckdb::ExpressionMatcher
ExpressionClass expr_class
 The ExpressionClass of the to-be-matched expression. ExpressionClass::INVALID for ANY.
unique_ptr< ExpressionTypeMatcher > expr_type
 Matcher for the ExpressionType of the operator (nullptr for ANY).
unique_ptr< TypeMatcher > type
 Matcher for the return_type of the expression (nullptr for ANY).

Constructor & Destructor Documentation

◆ RecursiveFunctionExpressionMatcher()

duckdb::RecursiveFunctionExpressionMatcher::RecursiveFunctionExpressionMatcher ( vector< unique_ptr< FunctionExpressionMatcher > > func_matchers)
inlineexplicit
320010 : func_matchers(std::move(func_matchers)) {
320011 }

Member Function Documentation

◆ Match()

bool duckdb::RecursiveFunctionExpressionMatcher::Match ( Expression & expr,
vector< reference< Expression > > & bindings )
inlineoverridevirtual

Checks if the given expression matches this ExpressionMatcher. If it does, the expression is appended to the bindings list and true is returned. Otherwise, false is returned.

Reimplemented from duckdb::ExpressionMatcher.

320012 {
320013 FunctionExpressionMatcher *target_matcher = nullptr;
320014 for (const auto &matcher : func_matchers) {
320015 if (matcher->Match(expr, bindings)) {
320016 target_matcher = matcher.get();
320017 break;
320018 }
320019 }
320020 if (target_matcher == nullptr) {
320021 return false;
320022 }
320023 bindings.clear();
320024 RecursiveMatch(target_matcher, expr, bindings);
320025 bindings.push_back(expr);
320026 return true;
320027 }

◆ RecursiveMatch()

void duckdb::RecursiveFunctionExpressionMatcher::RecursiveMatch ( FunctionExpressionMatcher * func_matcher,
Expression & expr,
vector< reference< Expression > > & bindings )
inlineprivate
320031 {
320032 vector<reference<Expression>> curr_bindings;
320033 if (func_matcher->Match(expr, curr_bindings)) {
320034 auto &func_expr = expr.Cast<BoundFunctionExpression>();
320035 for (auto &child : func_expr.children) {
320036 RecursiveMatch(func_matcher, *(child.get()), bindings);
320037 }
320038 } else {
320039 bindings.push_back(expr);
320040 }
320041 }

The documentation for this class was generated from the following file: