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

Function APISampleNWithTypes

euler/parser/attribute_calculator.cc:414–435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

412}
413
414bool APISampleNWithTypes(TreeNode* t) {
415 // SAMPLE_N_WITH_TYPES
416 std::vector<TreeNode*> children = t->GetChildren();
417 for (const std::string& v : children[0]->GetProp()->GetValues()) {
418 t->GetProp()->AddValue(v);
419 }
420 // SAMPLE_N_WITH_TYPES CONDITION
421 if (children.size() == 2 && children[1]->GetType() == "CONDITION") {
422 for (Prop* p : children[1]->GetProp()->GetNestingValues()) {
423 t->GetProp()->AddNestingValue(p);
424 }
425 } else if (children.size() == 2 &&
426 children[1]->GetType() == "AS") { // SAMPLE_N_WITH_TYPES AS
427 t->SetOpAlias(children[1]->GetProp()->GetValues()[0]);
428 } else if (children.size() == 3) { // SAMPLE_N_WITH_TYPES CONDITION AS
429 for (Prop* p : children[1]->GetProp()->GetNestingValues()) {
430 t->GetProp()->AddNestingValue(p);
431 }
432 t->SetOpAlias(children[2]->GetProp()->GetValues()[0]);
433 }
434 return true;
435}
436
437// NestingValues存放condition。第一个域是DNF,第二个域是PostProcess
438// Values存放V附带的value

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