protected AssemblyExtendedProduction extend(AssemblyProduction prod, int start) {
		AssemblySentential<AssemblyExtendedNonTerminal> extR = new AssemblySentential<>();
		int curState = start;
		for (AssemblySymbol sym : prod.getRHS()) {
			int nextState = table.get(curState, sym);
			if (sym instanceof AssemblyTerminal) {
				extR.addSymbol(sym);
			}
			else if (sym instanceof AssemblyNonTerminal) {
				extR.addSymbol(new AssemblyExtendedNonTerminal(curState, (AssemblyNonTerminal) sym,
					nextState));
			}
			else {
				throw new AssertionError(
					"Internal error: all AssemblySymbols must be either terminal or non-terminal");
			}
			curState = nextState;
		}
		AssemblyNonTerminal lhs = prod.getLHS();
		int nextState = -1;
		if (!lhs.equals(grammar.getStart())) {
			nextState = table.get(start, prod.getLHS());
		}
		AssemblyExtendedNonTerminal extL =
			new AssemblyExtendedNonTerminal(start, prod.getLHS(), nextState);
		return new AssemblyExtendedProduction(extL, extR, curState, prod);
	}
Extend a production, using the given LR0 start state

@param prod the production to extend
@param start the starting LR0 state
@return the extended production, if the start state is valid for it
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/assembler/sleigh/parse/AssemblyParser.java