'Parse capability lookup strings.
Strings prefixed with $ are capability lookups in the
form \'$variable\' where \'variable\' is an attribute in the
BackendState class.  If $variable is a dictionary, you may
use: $variable.dictkey'

def _parse_string(self, string, backend_state):

    if (not string):
        return None
    if (not string.startswith('$')):
        return string
    path = string[1:].split('.')
    obj = getattr(backend_state, path[0], None)
    if (obj is None):
        return None
    for item in path[1:]:
        obj = obj.get(item)
        if (obj is None):
            return None
    return obj
