private void parseSpaces(Decoder decoder) throws DecoderException {
		Set<String> truncatedSpaceNames = description.getTruncatedSpaceNames();
		int truncatedSpaceCnt = truncatedSpaceNames.size();
		int el = decoder.openElement(ELEM_SPACES);
		String defname = decoder.readString(ATTRIB_DEFAULTSPACE);
		spacetable = new LinkedHashMap<>();
		// Slot zero is always the constant space
		AddressSpace constspc = new GenericAddressSpace(SpaceNames.CONSTANT_SPACE_NAME, 64,
			AddressSpace.TYPE_CONSTANT, SpaceNames.CONSTANT_SPACE_INDEX);
		spacetable.put(SpaceNames.CONSTANT_SPACE_NAME, constspc);
		default_space = null;
		int subel = decoder.peekElement();
		if (subel == ELEM_SPACE_OTHER.id()) {		// tag must be present
			decoder.openElement();
			decoder.closeElementSkipping(subel);	// We don't process it
			// Instead the ProgramAddressFactory maps in the static OTHER_SPACE automatically 
		}
		else {
			throw new SleighException(".sla file missing required OTHER space tag");
		}
		while (decoder.peekElement() != 0) {
			int wordsize = 1;
			String name = null;
			int index = 0;
			int delay = -1;
			int size = 0;
			subel = decoder.openElement();
			int attrib = decoder.getNextAttributeId();
			while (attrib != 0) {
				if (attrib == ATTRIB_NAME.id()) {
					name = decoder.readString();
				}
				else if (attrib == ATTRIB_INDEX.id()) {
					index = (int) decoder.readSignedInteger();
				}
				else if (attrib == ATTRIB_DELAY.id()) {
					delay = (int) decoder.readSignedInteger();
				}
				else if (attrib == ATTRIB_SIZE.id()) {
					size = (int) decoder.readSignedInteger();
				}
				else if (attrib == ATTRIB_WORDSIZE.id()) {
					wordsize = (int) decoder.readSignedInteger();
				}
				attrib = decoder.getNextAttributeId();
			}
			int type;
			if (subel == ELEM_SPACE.id()) {
				if (delay > 0) {
					type = AddressSpace.TYPE_RAM;
				}
				else {
					type = AddressSpace.TYPE_REGISTER;
				}
			}
			else if (subel == ELEM_SPACE_UNIQUE.id()) {
				type = AddressSpace.TYPE_UNIQUE;
			}
			else {
				throw new SleighException("Sleigh cannot match new space definition to old type");
			}

			boolean truncateSpace = truncatedSpaceNames.contains(name);
			if (truncateSpace && type != AddressSpace.TYPE_RAM) {
				throw new SleighException("Non-ram space does not support truncation: " + name);
			}

			AddressSpace spc;
			if (getSegmentedSpace().equals(name)) {
				if (truncateSpace && type != AddressSpace.TYPE_RAM) {
					throw new SleighException(
						"Segmented space does not support truncation: " + name);
				}
				if (segmentType.equals("protected")) {
					spc = new ProtectedAddressSpace(name, index);
				}
				else {
					spc = new SegmentedAddressSpace(name, index);
				}
			}
			else {
				if (truncateSpace) {
					int truncatedSize = description.getTruncatedSpaceSize(name);
					if (truncatedSize <= 0 || truncatedSize >= size) {
						throw new SleighException("Invalid space truncation: " + name + ":" + size +
							" -> " + truncatedSize);
					}
					size = truncatedSize;
					--truncatedSpaceCnt;
				}
				spc = new GenericAddressSpace(name, 8 * size, wordsize, type, index);
			}
			spacetable.put(name, spc);
			decoder.closeElement(subel);
		}
		if (truncatedSpaceCnt > 0) {
			throw new SleighException(
				"One or more truncated spaced not applied: " + description.getLanguageID());
		}
		default_space = spacetable.get(defname);
		defaultDataSpace = default_space;
		defaultPointerWordSize = defaultDataSpace.getAddressableUnitSize();
		buildAddressSpaceFactory();
		decoder.closeElement(el);
		decoder.setAddressFactory(addressFactory);
	}
Returns the source file indexer
@return indexer
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/plugin/processors/sleigh/SleighLanguage.java