Following method is something of a kludge as no easy way at the moment to tell when a build has failed. @param item @param visited @return
(Syntactic.Item item, BitSet visited)
| 155 | * @return |
| 156 | */ |
| 157 | public static boolean findSyntaxErrors(Syntactic.Item item, BitSet visited) { |
| 158 | int index = item.getIndex(); |
| 159 | // Check whether already visited this item |
| 160 | if(!visited.get(index)) { |
| 161 | visited.set(index); |
| 162 | // Check whether this item has a marker associated with it. |
| 163 | if (item instanceof WyilFile.Attr.SyntaxError) { |
| 164 | // At least one marked associated with item. |
| 165 | return true; |
| 166 | } |
| 167 | // Recursive children looking for other syntactic markers |
| 168 | for (int i = 0; i != item.size(); ++i) { |
| 169 | if(findSyntaxErrors(item.get(i), visited)) { |
| 170 | return true; |
| 171 | } |
| 172 | } |
| 173 | } |
| 174 | // |
| 175 | return false; |
| 176 | } |
| 177 | } |