| 1567 | } |
| 1568 | |
| 1569 | bool DUContext::SearchItem::match(const QualifiedIdentifier& id, int offset) const |
| 1570 | { |
| 1571 | if (id.isEmpty()) { |
| 1572 | if (identifier.isEmpty() && next.isEmpty()) |
| 1573 | return true; |
| 1574 | else |
| 1575 | return false; |
| 1576 | } |
| 1577 | |
| 1578 | if (id.at(offset) != identifier) //The identifier is different |
| 1579 | return false; |
| 1580 | |
| 1581 | if (offset == id.count() - 1) { |
| 1582 | if (next.isEmpty()) |
| 1583 | return true; //match |
| 1584 | else |
| 1585 | return false; //id is too short |
| 1586 | } |
| 1587 | |
| 1588 | for (int a = 0; a < next.size(); ++a) |
| 1589 | if (next[a]->match(id, offset + 1)) |
| 1590 | return true; |
| 1591 | |
| 1592 | return false; |
| 1593 | } |
| 1594 | |
| 1595 | bool DUContext::SearchItem::isEmpty() const |
| 1596 | { |