MCPcopy Create free account
hub / github.com/alibaba/euler / APISampleNode

Function APISampleNode

euler/parser/attribute_calculator.cc:391–412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

389}
390
391bool APISampleNode(TreeNode* t) {
392 // SAMPLE_NODE
393 std::vector<TreeNode*> children = t->GetChildren();
394 for (const std::string& v : children[0]->GetProp()->GetValues()) {
395 t->GetProp()->AddValue(v);
396 }
397 // SAMPLE_NODE CONDITION
398 if (children.size() == 2 && children[1]->GetType() == "CONDITION") {
399 for (Prop* p : children[1]->GetProp()->GetNestingValues()) {
400 t->GetProp()->AddNestingValue(p);
401 }
402 } else if (children.size() == 2 &&
403 children[1]->GetType() == "AS") { // SAMPLE_NODE AS
404 t->SetOpAlias(children[1]->GetProp()->GetValues()[0]);
405 } else if (children.size() == 3) { // SAMPLE_NODE CONDITION AS
406 for (Prop* p : children[1]->GetProp()->GetNestingValues()) {
407 t->GetProp()->AddNestingValue(p);
408 }
409 t->SetOpAlias(children[2]->GetProp()->GetValues()[0]);
410 }
411 return true;
412}
413
414bool APISampleNWithTypes(TreeNode* t) {
415 // SAMPLE_N_WITH_TYPES

Callers

nothing calls this directly

Calls 9

GetChildrenMethod · 0.80
GetValuesMethod · 0.80
GetPropMethod · 0.80
AddValueMethod · 0.80
GetNestingValuesMethod · 0.80
AddNestingValueMethod · 0.80
SetOpAliasMethod · 0.80
sizeMethod · 0.45
GetTypeMethod · 0.45

Tested by

no test coverage detected