resolve the slots one by one to slot_to_reg instructions using the
 type information inferred from their names / type hierachy
7508
def sym_to_risc(compiler , source)
      slots = @slots.dup
      raise "Not Message #{object}" unless @known_object == :message
      left = Risc.message_reg
      left = left.resolve_and_add( slots.shift , compiler)
      reg = compiler.current.register
      while( !slots.empty? )
        left = left.resolve_and_add( slots.shift , compiler)
      end
      return reg
    end
1165076
def resolve_selector_type(self):
        
        resolved_selector_type_list = []
        for current_selector in self._effective_selector_list:
            resolved_selector_type_list.append(self.get_type(current_selector))

        set_ = set(resolved_selector_type_list)

        # VALIDATE THAT ALL SELECTOR ARE OF THE SAME TYPE
        if len(set_) != 1:
            raise Exception("""
                If you provide a list of selector then
                all selectors must be of the same type
            """)
        else:
            return set_.pop()
690064
def resolve(accessor: hexdi.core.clstype) -> __gentype__.T:
    
    return hexdi.core.get_root_container().resolve(accessor=accessor)
384796
def resolve_child_module_registries_lineage(registry):
    

    children = [registry]
    while isinstance(registry, BaseChildModuleRegistry):
        if registry.parent in children:
            # this should never normally occur under normal usage where
            # classes have been properly subclassed with methods defined
            # to specificiation and with standard entry point usage, but
            # non-standard definitions/usage can definitely trigger this
            # self-referential loop.
            raise TypeError(
                "registry '%s' was already recorded in the lineage, "
                "indicating that it may be some (grand)child of itself, which "
                "is an illegal reference in the registry system; previously "
                "resolved lineage is: %r" % (registry.parent.registry_name, [
                    r.registry_name for r in reversed(children)
                ])
            )

        pl = len(registry.parent.registry_name)
        if len(registry.parent.registry_name) > len(registry.registry_name):
            logger.warning(
                "the parent registry '%s' somehow has a longer name than its "
                "child registry '%s'; the underlying registry class may be "
                "constructed in an invalid manner",
                registry.parent.registry_name,
                registry.registry_name,
            )
        elif registry.registry_name[:pl] != registry.parent.registry_name:
            logger.warning(
                "child registry '%s' does not share the same common prefix as "
                "its parent registry '%s'; there may be errors with how the "
                "related registries are set up or constructed",
                registry.registry_name,
                registry.parent.registry_name,
            )
        children.append(registry.parent)
        registry = registry.parent
    # the lineage down from parent to child.
    return iter(reversed(children))
817625
def next_reg_use( type , extra = {} )
      int = @symbol[1,3].to_i
      raise "No more registers #{self}" if int > 11
      sym = "r#{int + 1}".to_sym
      RegisterValue.new( sym , type, extra)
    end
956074
def gen_slot_variables(self, cls: ClassDefinition) -> str:
        
        return '\n\t'.join([self.gen_slot_variable(cls, pk) for pk in self.primary_keys_for(cls)] +
                           [self.gen_slot_variable(cls, slot)
                            for slot in cls.slots
                            if not self.schema.slots[slot].primary_key and not self.schema.slots[slot].identifier])
542445
def _attr_data_(self, slots):
        
        self.__attr_data = type(
            ''.join([type(self).__name__, 'Data']),
            (),
            {
                '__module__': type(self).__module__,
                '__slots__': tuple(set(slots))
            }
        )()
35383
def _set_slots_to_null(self, cls):
        
        if hasattr(cls, "__slots__"):
            for s in cls.__slots__:
                self.__setattr__(s, Null)
        for b in cls.__bases__:
            self._set_slots_to_null(b)
578410
def load_reg(self, reg_type, reg_name, name=''):
        
        ftype = types.FunctionType(reg_type, [])
        return self.asm(ftype, "", "={%s}" % reg_name, [], False, name)
110340
def toRepr (obj):
    
    args  = [ ]
    names = [ ]

    if hasattr(obj, "__dict__"):
        names += getattr(obj, "__dict__").keys()
    if hasattr(obj, "__slots__"):
        names += getattr(obj, "__slots__")

    for name in names:
        value = getattr(obj, name)
        if value is not None:
            if type(value) is str:
                if len(value) > 32:
                    value = value[0:32] + "..."
                value = "'" + value + "'"
        args.append("%s=%s" % (name, str(value)))

    return "%s(%s)" % (obj.__class__.__name__, ", ".join(args))
57490
def get_by_slot(self, parent_object, slot):
        
        placeholder = self.parent(parent_object).get(slot=slot)
        placeholder.parent = parent_object  # fill the reverse cache
        return placeholder
527714
def reset ():
    
    global __prefixes_suffixes, __suffixes_to_types, __types, __rule_names_to_types, __target_suffixes_cache

    __register_features ()

    # Stores suffixes for generated targets.
    __prefixes_suffixes = [property.PropertyMap(), property.PropertyMap()]

    # Maps suffixes to types
    __suffixes_to_types = {}

    # A map with all the registered types, indexed by the type name
    # Each entry is a dictionary with following values:
    # 'base': the name of base type or None if type has no base
    # 'derived': a list of names of type which derive from this one
    # 'scanner': the scanner class registered for this type, if any
    __types = {}

    # Caches suffixes for targets with certain properties.
    __target_suffixes_cache = {}
655910
def gen_postinit(self, cls: ClassDefinition, slotname: str) -> Optional[str]:
        
        rlines: List[str] = []
        slot = self.schema.slots[slotname]
        if slot.alias:
            slotname = slot.alias
        slotname = self.python_name_for(slotname)
        range_type_name = self.range_type_name(slot, cls.name)

        # Generate existence check for required slots.  Note that inherited classes have to check post-init because
        # named variables can't be mixed in the class signature
        if slot.primary_key or slot.identifier or slot.required:
            if cls.is_a:
                rlines.append(f'if self.{slotname} is None:')
                rlines.append(f'\traise ValueError(f"{slotname} must be supplied")')
                rlines.append(f'if not isinstance(self.{slotname}, {range_type_name}):')
                rlines.append(f'\tself.{slotname} = {range_type_name}(self.{slotname})')
        elif slot.range in self.schema.classes or slot.range in self.schema.types:
            if not slot.multivalued:
                rlines.append(f'if self.{slotname} and not isinstance(self.{slotname}, {range_type_name}):')
                # Another really wierd case -- a class that has no properties
                if slot.range in self.schema.classes and not self.all_slots_for(self.schema.classes[slot.range]):
                    rlines.append(f'\tself.{slotname} = {range_type_name}()')
                else:
                    rlines.append(f'\tself.{slotname} = {range_type_name}(self.{slotname})')
            elif slot.inlined:
                slot_range_cls = self.schema.classes[slot.range]
                pkeys = self.primary_keys_for(slot_range_cls)
                if pkeys:
                    # Special situation -- if there are only two values: primary key and value,
                    # we load it is a list, not a dictionary
                    if len(self.all_slots_for(slot_range_cls)) - len(pkeys) == 1:
                        class_init = '(k, v)'
                    else:
                        pkey_name = self.python_name_for(pkeys[0])
                        class_init = f'({pkey_name}=k, **({{}} if v is None else v))'
                    rlines.append(f'for k, v in self.{slotname}.items():')
                    rlines.append(f'\tif not isinstance(v, {range_type_name}):')
                    rlines.append(f'\t\tself.{slotname}[k] = {range_type_name}{class_init}')
            else:
                rlines.append(f'self.{slotname} = [v if isinstance(v, {range_type_name})')
                indent = len(f'self.{slotname} = [') * ' '
                rlines.append(f'{indent}else {range_type_name}(v) for v in self.{slotname}]')
        return '\n\t\t'.join(rlines)
609193
def store_reg(self, value, reg_type, reg_name, name=''):
        
        ftype = types.FunctionType(types.VoidType(), [reg_type])
        return self.asm(ftype, "", "{%s}" % reg_name, [value], True, name)
864073
function resolveSchemaRefs(data, lookup) {
  if (!data || dataCache.has(data)) return data

  if (Array.isArray(data)) {
    return data.map(item => resolveSchemaRefs(item, lookup))
  } else if (typeof data === 'object') {
    if (data.$ref) {
      const resolved = resolveSchemaRef(data.$ref, lookup)
      delete data.$ref
      data = Object.assign({}, resolved, data)
    }
    dataCache.add(data)

    for (let name in data) {
      data[name] = resolveSchemaRefs(data[name], lookup)
    }
  }
  return data
}
590692
def combining_setup(self):
        
        (slot_type, (corner_slot, edge_slot), (corner, edge)) = self.get_slot()
        cycle = ["FR", "RB", "BL", "LF"]
        if slot_type == "SLOTFREE":
            return ("FR", Formula(Step("y") * cycle.index(self.pair) or []))
        elif slot_type == "CSLOTFREE":
            return (cycle[-(cycle.index(edge_slot) - cycle.index(self.pair))], 
                    Formula(Step("y") * cycle.index(edge_slot) or [])) 
        elif slot_type in ("ESLOTFREE", "WRONGSLOT"):
            return (cycle[-(cycle.index(corner_slot) - cycle.index(self.pair))], 
                    Formula(Step("y") * cycle.index(corner_slot) or [])) 
        elif slot_type == "DIFFSLOT":
            if corner_slot != self.pair: corner_slot, edge_slot = edge_slot, corner_slot
            result = Formula(Step("y") * cycle.index(edge_slot) or [])
            result += Formula("R U R'")
            result += Formula(Step("y'") * cycle.index(edge_slot) or [])
            result += Formula(Step("y") * cycle.index(corner_slot) or [])
            if result[-1].face == "y" and result[-2].face == "y":
                result[-2] += result[-1]
                del result[-1]
            return (cycle[-(cycle.index(corner_slot) - cycle.index(self.pair))], result)
        else:
            return (cycle[-cycle.index(self.pair)], Formula())
650399
protected Map<String, Object> resolveGenericTypes(TypeMirror type, Map<String, Object> boundTypes) {
        if (type.getKind().isPrimitive() || type.getKind() == VOID || type.getKind() == ARRAY) {
            return Collections.emptyMap();
        }
        if (type instanceof DeclaredType) {
            DeclaredType declaredType = (DeclaredType) type;
            return resolveGenericTypes(declaredType, (TypeElement) declaredType.asElement(), boundTypes);
        } else if (type instanceof TypeVariable) {
            TypeVariable var = (TypeVariable) type;
            TypeMirror upperBound = var.getUpperBound();
            if (upperBound instanceof DeclaredType) {
                return resolveGenericTypes(upperBound, boundTypes);
            }
        }
        return Collections.emptyMap();
    }