!7 p-exp { jtattoo(); S input = first(mL("Monolog examples")); TextNode root = new(input); processNode_recursive(root, 10); showFrame(jDynamicTree(root, func(CTNode n) -> Collection { n.children })); } svoid processNode_recursive(CTNode n, int depthCounter) { if (n == null || depthCounter <= 0) ret; processNode(n); for (CTNode child : n.children) processNode_recursive(child, depthCounter-1); } svoid processNode(CTNode n) { if (n instanceof TextNode) { TextNode tn = cast n; OpNode op = new("javaTokPlusCurly_dontKeep"); if (n.add(op)) op.add(TokNode(javaTokPlusCurly_dontKeep(tn.text))); } if (n instanceof TokNode) { TokNode tn = cast n; if (containsSubList(tn.tok, ll("=", "", ">"))) { OpNode op = new("splitAtDoubleArrow"); if (n.add(op)) op.add(ObjectNode(splitAtDoubleArrow(tn.tok))); } L l = indicesOfSubList(tn.tok, ll("&", "", "&")); if (nempty(l)) { OpNode op = new("split at &&"); if (n.add(op)) for (L subTok : splitAroundSubListIndices(tn.tok, l, 3)) op.add(TokNode(subTok)); } } if (n instanceof ObjectNode) { ObjectNode on = cast n; O o = on.obj; if (o instanceof S) n.add(TextNode((S) o)); Collection c; if (on.obj instanceof Collection && l((c = (Collection) on.obj)) == 2) { OpNode op = new("Split Collection"); if (n.add(op)) for (O e : c) op.add(ObjectNode(e)); } } }