public static List<CaseBlock> precompute(List<Case> cases) {
ArrayList<CaseBlock> blocks = new ArrayList<CaseBlock>(cases.size());
for (int i = 0; i < cases.size(); i++) {
Case c = cases.get(i);
if (isConcreteSyntaxPattern(c)) {
ConcreteBlock b = new ConcreteBlock();
b.add(c);
for (int j = i + 1; j < cases.size(); j++) {
Case d = cases.get(j);
if (isConcreteSyntaxPattern(d) && !isIUPTRPattern(d)) {
b.add(d);
i++;
} else {
break;
}
}
blocks.add(b);
} else if (isIUPTRPattern(c)) {
blocks.add(new DefaultBlock(c));
} else if (isConstantTreePattern(c)) {
NodeCaseBlock b = new NodeCaseBlock();
b.add(c);
for (int j = i + 1; j < cases.size(); j++) {
Case d = cases.get(j);
if (isConstantTreePattern(d) && !isIUPTRPattern(d)) {
b.add(d);
i++;
} else {
break;