/** Walk all the included declarations and accumulate the set of referenced groups */ protected void computegroups() { // 1. variables for (int i = 0; i < variables.size(); i++) { DapVariable var = variables.get(i); List<DapGroup> path = var.getGroupPath(); for (DapGroup group : path) { if (!this.groups.contains(group)) this.groups.add(group); } } // 2. Dimensions for (DapDimension dim : this.dimrefs) { if (!dim.isShared()) continue; List<DapGroup> path = dim.getGroupPath(); for (DapGroup group : path) { if (!this.groups.contains(group)) this.groups.add(group); } } // 2. enumerations for (DapEnum en : this.enums) { List<DapGroup> path = en.getGroupPath(); for (DapGroup group : path) { if (!this.groups.contains(group)) this.groups.add(group); } } }