@classmethod
def _parse(cls, spec, cmdline_type):
    """
        Parse an adapter specification for a non-linked adapter (without '...')

        Allow:
        'back' and ADAPTER
        'back' and ADAPTERX
        'back' and ADAPTER$
        'front' and ADAPTER
        'front' and XADAPTER
        'front' and ^ADAPTER
        'anywhere' and ADAPTER
        """
    if cmdline_type not in ('front', 'back', 'anywhere'):
        raise ValueError('cmdline_type must be front, back or anywhere')
    error = ValueError(
        'You cannot use multiple placement restrictions for an adapter at the same time. Choose one of ^ADAPTER, ADAPTER$, XADAPTER or ADAPTERX'
        )
    spec, middle, parameters_spec = spec.partition(';')
    name, spec = cls._extract_name(spec)
    spec = spec.strip()
    parameters = cls._parse_parameters(parameters_spec)
    spec = cls.expand_braces(spec)
    if len(spec.strip('X')) == 0:
        return name, None, spec, {}
    front_restriction = None
    if spec.startswith('^'):
        front_restriction = 'anchored'
        spec = spec[1:]
    if spec.upper().startswith('X'):
        if front_restriction is not None:
            raise error
        front_restriction = 'noninternal'
        spec = spec.lstrip('xX')
    back_restriction = None
    if spec.endswith('$'):
        back_restriction = 'anchored'
        spec = spec[:-1]
    if spec.upper().endswith('X'):
        if back_restriction is not None:
            raise error
        back_restriction = 'noninternal'
        spec = spec.rstrip('xX')
    n_placement_restrictions = int(bool(front_restriction)) + int(bool(
        back_restriction))
    if n_placement_restrictions > 1:
        raise error
    if cmdline_type == 'front' and back_restriction:
        raise ValueError(
            "Allowed placement restrictions for a 5' adapter are XADAPTER and ^ADAPTER"
            )
    if cmdline_type == 'back' and front_restriction:
        raise ValueError(
            "Allowed placement restrictions for a 3' adapter are ADAPTERX and ADAPTER$"
            )
    assert front_restriction is None or back_restriction is None
    if front_restriction is not None:
        restriction = front_restriction
    else:
        restriction = back_restriction
    if cmdline_type == 'anywhere' and restriction is not None:
        raise ValueError(
            "Placement restrictions (with X, ^, $) not supported for 'anywhere' (-b) adapters"
            )
    return name, restriction, spec, parameters
