protected Stream<AssemblyResolvedPatterns> resolveRemainingChildren(
			AssemblyResolvedPatterns fromRight, Collection<AssemblyResolvedError> errors,
			List<AbstractAssemblyState> children) {

		// Need to resolve children (as they apply context changes) from right to left
		if (children.isEmpty()) {
			return Stream.of(fromRight);
		}

		AbstractAssemblyState rightMost = children.get(children.size() - 1);
		return rightMost.resolve(fromRight, errors).flatMap(fromChild -> {
			return resolveRemainingChildren(fromChild, errors,
				children.subList(0, children.size() - 1));
		});
	}
A recursive function from resolving all children right-to-left and accumulating the patterns

<p>
This pops the right-most child in {@code children}, resolves it, and then recurses, passing
the accumulated patterns in as {@code fromRight} with the remaining children.
{@link Stream#flatMap(java.util.function.Function)} makes this somewhat fluent, given the
possibility of multiple resolutions.

@param fromRight the assembly pattern as accumulated from the right sibling. If this is the
           right-most sibling, then this is the pattern accumulated from the parent's right
           sibling, as so on. If no such sibling exists, it is the unrestricted (empty)
           pattern.
@param errors a place to collect errors
@param children the remaining children to resolve
@return the stream of accumulated patterns
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/assembler/sleigh/sem/AssemblyConstructState.java