120 if (name.
label().empty()) {
return true; }
143 if (t->name().label() == name.
label()) {
149 for (
auto& i:
_o3_prm_->interfaces()) {
150 if (i->name().label() == name.
label()) {
156 for (
auto& c:
_o3_prm_->classes()) {
157 if (c->name().label() == name.
label()) {
163 auto lookup =
"." + name.
label();
165 auto matches = std::vector< std::string >();
168 for (
auto t:
_prm_->types()) {
170 if (!found.exists(t->name())) {
171 found.insert(t->name());
172 matches.push_back(t->name());
178 if (
endsWith(t->name().label(), lookup)) {
179 if (!found.exists(t->name().label())) {
180 found.insert(t->name().label());
181 matches.push_back(t->name().label());
187 for (
auto i:
_prm_->interfaces()) {
189 if (!found.exists(i->name())) {
190 found.insert(i->name());
191 matches.push_back(i->name());
196 for (
auto& i:
_o3_prm_->interfaces()) {
197 if (
endsWith(i->name().label(), lookup)) {
198 if (!found.exists(i->name().label())) {
199 found.insert(i->name().label());
200 matches.push_back(i->name().label());
206 for (
auto c:
_prm_->classes()) {
208 if (!found.exists(c->name())) {
209 found.insert(c->name());
210 matches.push_back(c->name());
215 for (
auto& c:
_o3_prm_->classes()) {
216 if (
endsWith(c->name().label(), lookup)) {
217 if (!found.exists(c->name().label())) {
218 found.insert(c->name().label());
219 matches.push_back(c->name().label());
224 if (matches.size() == 1) {
226 name.
label() = matches.back();
229 }
else if (matches.size() == 0) {
232 O3PRM_TYPE_NOT_FOUND(name, *
_errors_);
238 O3PRM_TYPE_AMBIGUOUS(name, matches, *
_errors_);
246 if (name.
label().empty()) {
return true; }
262 if (t->name().label() == name.
label()) {
270 auto lookup =
"." + name.
label();
272 auto matches = std::vector< std::string >();
275 for (
auto t:
_prm_->types()) {
277 if (!found.exists(t->name())) {
278 found.insert(t->name());
279 matches.push_back(t->name());
286 if (
endsWith(t->name().label(), lookup)) {
287 if (!found.exists(t->name().label())) {
288 found.insert(t->name().label());
289 matches.push_back(t->name().label());
294 if (matches.size() == 1) {
296 name.
label() = matches.back();
299 }
else if (matches.size() == 0) {
302 O3PRM_TYPE_NOT_FOUND(name, *
_errors_);
308 O3PRM_TYPE_AMBIGUOUS(name, matches, *
_errors_);
316 if (name.
label().empty()) {
return true; }
330 for (
auto& i:
_o3_prm_->interfaces()) {
331 if (i->name().label() == name.
label()) {
339 auto lookup =
"." + name.
label();
341 auto matches = std::vector< std::string >();
344 for (
auto i:
_prm_->interfaces()) {
346 if (!found.exists(i->name())) {
347 found.insert(i->name());
348 matches.push_back(i->name());
354 for (
auto& i:
_o3_prm_->interfaces()) {
355 if (
endsWith(i->name().label(), lookup)) {
356 if (!found.exists(i->name().label())) {
357 found.insert(i->name().label());
358 matches.push_back(i->name().label());
363 if (matches.size() == 1) {
366 name.
label() = matches.back();
369 }
else if (matches.size() == 0) {
372 O3PRM_INTERFACE_NOT_FOUND(name, *
_errors_);
378 O3PRM_INTERFACE_AMBIGUOUS(name, matches, *
_errors_);
386 if (name.
label().empty()) {
return true; }
400 for (
auto& c:
_o3_prm_->classes()) {
401 if (c->name().label() == name.
label()) {
409 auto lookup =
"." + name.
label();
410 auto matches = std::vector< std::string >();
414 for (
auto c:
_prm_->classes()) {
416 if (!found.exists(c->name())) {
417 found.insert(c->name());
418 matches.push_back(c->name());
424 for (
auto& c:
_o3_prm_->classes()) {
425 if (
endsWith(c->name().label(), lookup)) {
426 if (!found.exists(c->name().label())) {
427 found.insert(c->name().label());
428 matches.push_back(c->name().label());
433 if (matches.size() == 1) {
436 name.
label() = matches.back();
439 }
else if (matches.size() == 0) {
442 O3PRM_CLASS_NOT_FOUND(name, *
_errors_);
448 O3PRM_CLASS_AMBIGUOUS(name, matches, *
_errors_);
456 if (name.
label().empty()) {
return true; }
469 for (
auto& i:
_o3_prm_->interfaces()) {
470 if (i->name().label() == name.
label()) {
477 for (
auto& c:
_o3_prm_->classes()) {
478 if (c->name().label() == name.
label()) {
486 auto lookup =
"." + name.
label();
488 auto matches = std::vector< std::string >();
491 for (
auto i:
_prm_->interfaces()) {
493 if (!found.exists(i->name())) {
494 found.insert(i->name());
495 matches.push_back(i->name());
501 for (
auto& i:
_o3_prm_->interfaces()) {
502 if (
endsWith(i->name().label(), lookup)) {
503 if (!found.exists(i->name().label())) {
504 found.insert(i->name().label());
505 matches.push_back(i->name().label());
511 for (
auto c:
_prm_->classes()) {
513 if (!found.exists(c->name())) {
514 found.insert(c->name());
515 matches.push_back(c->name());
521 for (
auto& c:
_o3_prm_->classes()) {
522 if (
endsWith(c->name().label(), lookup)) {
523 if (!found.exists(c->name().label())) {
524 found.insert(c->name().label());
525 matches.push_back(c->name().label());
530 if (matches.size() == 1) {
533 name.
label() = matches.back();
536 }
else if (matches.size() == 0) {
539 O3PRM_REFERENCE_NOT_FOUND(name, *
_errors_);
545 O3PRM_REFERENCE_AMBIGUOUS(name, matches, *
_errors_);