protected void buildExtendedGrammar() {
		extendedGrammar = new AssemblyExtendedGrammar();
		extendedGrammar.setStartName(grammar.getStartName());
		for (int curState = 0; curState < states.size(); curState++) {
			AssemblyParseState state = states.get(curState);
			for (AssemblyParseStateItem item : state.getClosure()) {
				if (item.getPos() == 0) {
					AssemblyExtendedProduction ext = extend(item.getProduction(), curState);
					extendedGrammar.addProduction(ext);
				}
			}
		}
	}
Add a newly-constructed LR0 state, and return it's assigned number

<p>
If the state already exists, this just returns its previously assigned number

@param state the newly-constructed state
@return the assigned number
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/assembler/sleigh/parse/AssemblyParser.java