'Parses a SystemDrive environment variable.'

def Parse(self, stat, _):

    if isinstance(stat, rdf_client.StatEntry):
        value = stat.registry_data.GetValue()
    elif isinstance(stat, rdfvalue.RDFString):
        value = stat
    if (not value):
        raise parsers.ParseError(('Invalid    value    for    key    %s' % stat.pathspec.path))
    systemdrive = value[0:2]
    if re.match('^[A-Za-z]:$', systemdrive):
        (yield rdfvalue.RDFString(systemdrive))
    else:
        raise parsers.ParseError(('Bad    drive    letter    for    key    %s' % stat.pathspec.path))
