!7 p-exp { S s = "a horse is an animal"; new AI_BottomUpParser1 p; p.splitSplittables = false; p.productionsText = [[ + = ]]; p.parse(javaTokNPunctuation(s)); p.printWordsAndGroups(); for (AI_BottomUpParser1.Word g : p.groups()) { //printStruct(subList(p.cnc, g.wordFrom*2+1, g.wordTo*2)); tokPrepend(p.cnc, g.wordFrom*2+1, "{"); tokAppend(p.cnc, g.wordTo*2-1, "}"); } print(join(p.cnc)); }