protected void exhaust(Set<AssemblyParseMachine> results, Deque<AssemblyParseMachine> visited) {
		try (DbgCtx dc = DBG.start("Exhausting machine " + id)) {
			DBG.println("Machine: " + this);
			AssemblyParseMachine loop = findLoop(this, visited);
			if (loop != null) {
				DBG.println("Pruned. Loop of " + loop.id);
				return;
			}
			try (DequePush<?> push = DequePush.push(visited, this)) {
				if (error != ERROR_NONE) {
					throw new AssertionError("INTERNAL: Tried to step a machine with errors");
				}
				if (accepted) {
					// Gratuitous inputs should be detected by getTree
					throw new AssertionError("INTERNAL: Tried to step an accepted machine");
				}
				Collection<AssemblyTerminal> terms = parser.actions.getExpected(stack.peek());
				if (terms.isEmpty()) {
					throw new RuntimeException("Encountered a state with no actions");
				}
				Set<AssemblyTerminal> unmatched = new TreeSet<>(terms);
				for (AssemblyTerminal t : terms) {
					for (AssemblyParseToken tok : t.match(buffer, pos, parser.grammar, symbols)) {
						unmatched.remove(t);
						assert buffer.regionMatches(pos, tok.getString(), 0,
							tok.getString().length());
						consume(t, tok, results, visited);
					}
				}
				if (!unmatched.isEmpty()) {
					AssemblyParseMachine m = copy();
					final Collection<AssemblyTerminal> newExpected;
					if (m.lastTok == null ||
						!(m.lastTok instanceof TruncatedWhiteSpaceParseToken)) {
						newExpected = unmatched;
					}
					else {
						newExpected = new TreeSet<>();
						newExpected.add(AssemblySentential.WHITE_SPACE);
					}
					DBG.println("Syntax Error: ");
					DBG.println("  Expected: " + newExpected);
					DBG.println("  Got: " + buffer.substring(pos));
					m.error = ERROR_SYNTAX;
					m.got = buffer.substring(pos);
					m.expected = newExpected;
					results.add(m);
					return;
				}
			}
		}
	}
Parse (or continue parsing) all possible trees from this machine state

@param results a place to store all the parsing results
@param visited a collection of machine states already visited
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/assembler/sleigh/parse/AssemblyParseMachine.java