def field(name):
    """Return a string for accessing the field called 'name'.  This can
       be either a field in a context, or a field in the target object. """
    if '.' in name:
        return name.replace(".", "_ctx->")
    else:
        return "obj->" + name