private static void initializeStructureFromContext(Structure structure,
			DataTypeProviderContext context, int dataLength) {

		DataTypeComponent[] dataComps = context.getDataTypeComponents(0, dataLength - 1);

		if (dataComps.length == 0) {
			throw new IllegalArgumentException("No data type components found");
		}

		// adopt pack settings from parent - things could move as a result
		DataType parent = dataComps[0].getParent();
		if (parent instanceof Composite) {
			Composite c = (Composite) parent;
			structure.setPackingEnabled(c.isPackingEnabled());
			if (c.getPackingType() == PackingType.EXPLICIT) {
				structure.setExplicitPackingValue(c.getExplicitPackingValue());
			}
		}

		for (DataTypeComponent dataComp : dataComps) {
			structure.add(dataComp.getDataType(), dataComp.getLength(), dataComp.getFieldName(),
				dataComp.getComment());
		}
	}
Creates a {@link StructureDataType} instance, which is inside of
another structure, based upon the information provided.  The instance
will not be placed in memory.

@param  program The program to which the structure will belong.
@param  address The address of the structure.
@param  fromPath The path to the first element in the parent structure
        that will be in the new structure.
@param  toPath The path to the last element in the parent structure
        that will be in the new structure.
@param  structureName the name of the structure to create
@param  makeUniqueName True indicates that the provided name should be
        altered as necessary in order to make it unique in the program.
@return A new structure not yet added to memory.
@throws IllegalArgumentException for the following conditions:
        <ul>
             <li>if <code>structureName</code> is <code>null</code></li>
             <li>if the component at <code>fromPath</code> or the component
                 at <code>toPath</code> are null</li>
             <li>if there is not data to add to the structure</li>
             <li>if the parent data type is not a structure</li>
        </ul>
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/StructureFactory.java