sS ai_groupUsingProductions(S s, AI_BottomUpParser1 p) { p.splitSplittables = false; p.parse(javaTokNPunctuation(s)); for (AI_BottomUpParser1.Word g : p.groups()) { int i = g.wordFrom*2+1, j = g.wordTo*2-1; if (endsWith(get(p.cnc, i), "{") && startsWith(get(p.cnc, j), "}")) continue; tokPrepend(p.cnc, i, "{"); tokAppend(p.cnc, j, "}"); } ret join(p.cnc); }