SliceInterfacePortReference.fromString constructor

SliceInterfacePortReference.fromString(
  1. InterfaceReference<PairInterface> interfaceReference,
  2. String portAccessString
)

Creates a slice reference from a port access string.

Parses the portAccessString to extract slicing and indexing information, then creates the appropriate slice reference. The string can include array indexing and slicing syntax.

Implementation

factory SliceInterfacePortReference.fromString(
  InterfaceReference interfaceReference,
  String portAccessString,
) {
  final components =
      SlicePortReference.extractPortAccessSliceComponents(portAccessString);

  return SliceInterfacePortReference(
    interfaceReference.module,
    components.portName,
    interfaceReference: interfaceReference,
    dimensionAccess: components.dimensionAccess,
    sliceUpperIndex: components.sliceUpperIndex,
    sliceLowerIndex: components.sliceLowerIndex,
  );
}