| 119 | } |
| 120 | |
| 121 | @Override |
| 122 | public <T extends Item> List<T> getParents(Item child, Class<T> kind) { |
| 123 | List<T> parents = new ArrayList<>(); |
| 124 | for (int i = 0; i != syntacticItems.size(); ++i) { |
| 125 | Item parent = syntacticItems.get(i); |
| 126 | if(kind.isInstance(parent)) { |
| 127 | for(int j=0;j!=parent.size();++j) { |
| 128 | if(parent.get(j) == child) { |
| 129 | parents.add((T) parent); |
| 130 | } |
| 131 | } |
| 132 | } |
| 133 | } |
| 134 | // |
| 135 | return parents; |
| 136 | } |
| 137 | |
| 138 | /** |
| 139 | * Get first ancestor of a syntactic item matching the given kind. If no item |