!7 sclass BottomUpParser > DynSCP { start { dm_useLocallyCopiedMechLists(); set flag NoFancyMechParsing. } void update(S s) { temp enter(); final new AI_BottomUpParser1 parser; parser.parse(s); AI_BottomUpParser1.Word w = parser.fullGroup(); if (w == null) ret; final L productions = ai_buParser_parseWeightedProductions(); print("Have " + n2(productions, "production")); class ChooseCategory { AI_BottomUpParser1.Word word; L categories; *(AI_BottomUpParser1.Word *word, L *categories) {} toString { ret word.text() + " (" + n2(categories, "category", "categories") + ")"; } } class HaveCategory { AI_BottomUpParser1.Word word; S category; *(AI_BottomUpParser1.Word *word, S *category) {} toString { ret word.text() + " as " + category; } } ChooseCategory root = new(w, asList(w.classes)); setComponent(jDynamicTree(root, func(O e) -> L { if (e instanceof ChooseCategory) ret map(e.word.classes, func(S cat) { HaveCategory(e.word, cat) }); null; })); } }