28 #ifndef NODEINSERTPOLICY_H
29 #define NODEINSERTPOLICY_H
32 namespace jmespath {
namespace parser {
53 template <
typename T,
typename
55 std::is_base_of<ast::BinaryExpressionNode, T>::value
56 && !std::is_same<ast::SubexpressionNode, T>::value,
int>::type = 0>
60 node.rightExpression = targetNode;
64 template <
typename T,
typename
66 std::is_same<ast::NotExpressionNode, T>::value,
int>::type = 0>
70 node.expression = targetNode;
74 template <
typename T,
typename
76 (!std::is_base_of<ast::BinaryExpressionNode, T>::value
77 && !std::is_same<ast::NotExpressionNode, T>::value
78 && std::is_assignable<ast::ExpressionNode, T>::value)
79 || std::is_same<ast::SubexpressionNode, T>::value,
int>::type = 0>
88 #endif // NODEINSERTPOLICY_H
The NodeInsertPolicy class is a functor for inserting a given node into the AST.
Definition: nodeinsertpolicy.h:38
void result_type
The result type of the functor.
Definition: nodeinsertpolicy.h:44
void operator()(ast::ExpressionNode &targetNode, T &node) const
Inserts the given node into the AST at the location of the targetNode.
Definition: nodeinsertpolicy.h:57
The ExpressionNode class represents a JMESPath expression.
Definition: expressionnode.h:56