77 const std::vector<const openvdb::ax::ast::Node*>& b,
const bool allowEmpty =
false)
79 if (!allowEmpty && (a.empty() || b.empty()))
return false;
80 if (a.size() != b.size())
return false;
81 const size_t size = a.size();
82 for (
size_t i = 0; i < size; ++i) {
83 if ((a[i] ==
nullptr) ^ (b[i] ==
nullptr))
return false;
84 if (a[i] ==
nullptr)
continue;
85 if (a[i]->nodetype() != b[i]->nodetype())
return false;
91 if (a[i]->nodetype() == openvdb::ax::ast::Node::AssignExpressionNode) {
92 if (
static_cast<const openvdb::ax::ast::AssignExpression*
>(a[i])->operation() !=
93 static_cast<const openvdb::ax::ast::AssignExpression*
>(b[i])->operation()) {
97 else if (a[i]->nodetype() == openvdb::ax::ast::Node::BinaryOperatorNode) {
98 if (
static_cast<const openvdb::ax::ast::BinaryOperator*
>(a[i])->operation() !=
99 static_cast<const openvdb::ax::ast::BinaryOperator*
>(b[i])->operation()) {
103 else if (a[i]->nodetype() == openvdb::ax::ast::Node::CrementNode) {
104 if (
static_cast<const openvdb::ax::ast::Crement*
>(a[i])->operation() !=
105 static_cast<const openvdb::ax::ast::Crement*
>(b[i])->operation()) {
108 if (
static_cast<const openvdb::ax::ast::Crement*
>(a[i])->post() !=
109 static_cast<const openvdb::ax::ast::Crement*
>(b[i])->post()) {
113 else if (a[i]->nodetype() == openvdb::ax::ast::Node::CastNode) {
114 if (
static_cast<const openvdb::ax::ast::Cast*
>(a[i])->type() !=
115 static_cast<const openvdb::ax::ast::Cast*
>(b[i])->type()) {
119 else if (a[i]->nodetype() == openvdb::ax::ast::Node::FunctionCallNode) {
120 if (
static_cast<const openvdb::ax::ast::FunctionCall*
>(a[i])->name() !=
121 static_cast<const openvdb::ax::ast::FunctionCall*
>(b[i])->name()) {
125 else if (a[i]->nodetype() == openvdb::ax::ast::Node::LoopNode) {
126 if (
static_cast<const openvdb::ax::ast::Loop*
>(a[i])->loopType() !=
127 static_cast<const openvdb::ax::ast::Loop*
>(b[i])->loopType()) {
131 else if (a[i]->nodetype() == openvdb::ax::ast::Node::KeywordNode) {
132 if (
static_cast<const openvdb::ax::ast::Keyword*
>(a[i])->keyword() !=
133 static_cast<const openvdb::ax::ast::Keyword*
>(b[i])->keyword()) {
137 else if (a[i]->nodetype() == openvdb::ax::ast::Node::AttributeNode) {
138 if (
static_cast<const openvdb::ax::ast::Attribute*
>(a[i])->type() !=
139 static_cast<const openvdb::ax::ast::Attribute*
>(b[i])->type()) {
142 if (
static_cast<const openvdb::ax::ast::Attribute*
>(a[i])->name() !=
143 static_cast<const openvdb::ax::ast::Attribute*
>(b[i])->name()) {
146 if (
static_cast<const openvdb::ax::ast::Attribute*
>(a[i])->inferred() !=
147 static_cast<const openvdb::ax::ast::Attribute*
>(b[i])->inferred()) {
151 else if (a[i]->nodetype() == openvdb::ax::ast::Node::ExternalVariableNode) {
152 if (
static_cast<const openvdb::ax::ast::ExternalVariable*
>(a[i])->type() !=
153 static_cast<const openvdb::ax::ast::ExternalVariable*
>(b[i])->type()) {
156 if (
static_cast<const openvdb::ax::ast::ExternalVariable*
>(a[i])->name() !=
157 static_cast<const openvdb::ax::ast::ExternalVariable*
>(b[i])->name()) {
161 else if (a[i]->nodetype() == openvdb::ax::ast::Node::DeclareLocalNode) {
162 if (
static_cast<const openvdb::ax::ast::DeclareLocal*
>(a[i])->type() !=
163 static_cast<const openvdb::ax::ast::DeclareLocal*
>(b[i])->type()) {
167 else if (a[i]->nodetype() == openvdb::ax::ast::Node::LocalNode) {
168 if (
static_cast<const openvdb::ax::ast::Local*
>(a[i])->name() !=
169 static_cast<const openvdb::ax::ast::Local*
>(b[i])->name()) {
174 else if (a[i]->nodetype() == openvdb::ax::ast::Node::ValueBoolNode) {
175 if (
static_cast<const openvdb::ax::ast::Value<bool>*
>(a[i])->value() !=
176 static_cast<const openvdb::ax::ast::Value<bool>*
>(b[i])->value()) {
180 else if (a[i]->nodetype() == openvdb::ax::ast::Node::ValueInt16Node) {
181 if (
static_cast<const openvdb::ax::ast::Value<int16_t>*
>(a[i])->value() !=
182 static_cast<const openvdb::ax::ast::Value<int16_t>*
>(b[i])->value()) {
186 else if (a[i]->nodetype() == openvdb::ax::ast::Node::ValueInt32Node) {
187 if (
static_cast<const openvdb::ax::ast::Value<int32_t>*
>(a[i])->value() !=
188 static_cast<const openvdb::ax::ast::Value<int32_t>*
>(b[i])->value()) {
192 else if (a[i]->nodetype() == openvdb::ax::ast::Node::ValueInt64Node) {
193 if (
static_cast<const openvdb::ax::ast::Value<int64_t>*
>(a[i])->value() !=
194 static_cast<const openvdb::ax::ast::Value<int64_t>*
>(b[i])->value()) {
198 else if (a[i]->nodetype() == openvdb::ax::ast::Node::ValueFloatNode) {
199 if (
static_cast<const openvdb::ax::ast::Value<float>*
>(a[i])->value() !=
200 static_cast<const openvdb::ax::ast::Value<float>*
>(b[i])->value()) {
204 else if (a[i]->nodetype() == openvdb::ax::ast::Node::ValueDoubleNode) {
205 if (
static_cast<const openvdb::ax::ast::Value<double>*
>(a[i])->value() !=
206 static_cast<const openvdb::ax::ast::Value<double>*
>(b[i])->value()) {
210 else if (a[i]->nodetype() == openvdb::ax::ast::Node::ValueStrNode) {
211 if (
static_cast<const openvdb::ax::ast::Value<std::string>*
>(a[i])->value() !=
212 static_cast<const openvdb::ax::ast::Value<std::string>*
>(b[i])->value()) {