public KLabel getCellFragmentLabel(KLabel cellLabel) { Sort s = labels.getCodomain(cellLabel); return cfg.getCellFragmentLabel(s); }
public Sort getCellSort(KLabel cellLabel) { Sort s = labels.getCodomain(cellLabel); return cfg.isCell(s) ? s : null; }
public boolean isCellCollection(KLabel klabel) { Sort s = labels.getCodomain(klabel); return cfg.isCellCollection(s); }
public List<Sort> getChildren(KLabel label) { return cfg.getChildren(labels.getCodomain(label)); }
public ConfigurationInfo.Multiplicity getMultiplicity(KLabel label) { return cfg.getMultiplicity(labels.getCodomain(label)); } public ConfigurationInfo.Multiplicity getMultiplicity(Sort sort) {
public boolean isLeafCell(KLabel klabel) { return cfg.isLeafCell(labels.getCodomain(klabel)); } public boolean isParentCell(KLabel klabel) {
public Sort leafCellType(KLabel label) { return cfg.leafCellType(labels.getCodomain(label)); } public List<Sort> getChildren(KLabel label) {
public int getLevel(KLabel label) { return cfg.getLevel(labels.getCodomain(label)); }
public KLabel getParent(KLabel klabel) { return getParent(labels.getCodomain(klabel)); }
public Sort getCellSort(K k) { if (k instanceof KApply) { return labels.getCodomain(((KApply) k).klabel()); } else if (k instanceof KVariable) { return k.att().get(Sort.class); } else { throw new AssertionError("expected KApply or KVariable, found " + k.getClass().getSimpleName()); } }
private boolean isCell(K k) { return k instanceof KApply && cfg.isCell(labelInfo.getCodomain(((KApply) k).klabel())); } }
public boolean isParentCell(KLabel klabel) { return isCell(klabel) && cfg.isParentCell(labels.getCodomain(klabel)); }
public boolean isCell(KLabel klabel) { Sort s = labels.getCodomain(klabel); return cfg.isCell(s) && cfg.getCellLabel(s).equals(klabel); } public boolean isLeafCell(KLabel klabel) {
private void filterRequired(Set<Sort> required, K item) { if (item instanceof KApply) { required.remove(labelInfo.getCodomain(((KApply) item).klabel())); } else if (item instanceof KVariable) { if (item.att().contains(Sort.class)) { Sort sort = item.att().get(Sort.class); if (cfg.cfg.isCell(sort)) { required.remove(sort); } else { required.clear(); } } else { required.clear(); } } } }