protected void buildLR0Machine() {
		AssemblyProduction sp = grammar.productionsOf(grammar.getStart()).iterator().next();
		AssemblyParseStateItem startItem = new AssemblyParseStateItem(sp, 0);
		AssemblyParseState startState = new AssemblyParseState(grammar, startItem);
		states.add(startState);

		// I'm using a counting loop purposefully
		// Want to add things and process them later
		for (int curState = 0; curState < states.size(); curState++) {
			// perform a "read" or "goto" on each item, adding it to the kernel of its destination state
			// NOTE: destination state is keyed ONLY from curState and symbol read
			AssemblyParseState state = states.get(curState);
			// Since we work with one state at a time, we need only key on symbol read
			Map<AssemblySymbol, AssemblyParseState> go =
				LazyMap.lazyMap(new LinkedHashMap<AssemblySymbol, AssemblyParseState>(),
					() -> new AssemblyParseState(grammar));
			// Advance each item, and add the result to the kernel
			// NOTE: We must advance from the closure of the current state
			for (AssemblyParseStateItem item : state.getClosure()) {
				AssemblySymbol sym = item.getNext();
				if (sym != null) {
					AssemblyParseStateItem ni = item.read();
					go.get(sym).getKernel().add(ni);
				}
			}
			// Now, add the appropriate entries to the transition table
			for (Map.Entry<AssemblySymbol, AssemblyParseState> ent : go.entrySet()) {
				int newStateNum = addLR0State(ent.getValue());
				table.put(curState, ent.getKey(), newStateNum);
			}
		}
	}
Construct a LALR(1) parser from the given grammar

@param grammar the grammar
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/assembler/sleigh/parse/AssemblyParser.java