public static void matchTree(Tree tree, int type, Consumer<List<Tree>> onChildren) {
		if (tree.getType() != type) {
			throw new MismatchException();
		}
		onChildren.accept(getChildren(tree));
	}
Match the given tree to a given pattern

@param tree the (sub-)tree to match, actually its root node
@param type the expected type of the given node
@param onChildren actions (usually sub-matching) to perform on the children
Ghidra/Framework/Emulation/src/main/java/ghidra/pcode/exec/SleighUtils.java