MCPcopy Create free account
hub / github.com/Whiley/WhileyCompiler / getParents

Method getParents

src/main/java/wycc/util/AbstractHeap.java:121–136  ·  view source on GitHub ↗
(Item child, Class<T> kind)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

getMethod · 0.95
sizeMethod · 0.95
sizeMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected