Exemple #1
0
/* Initializes the representations registry, building up all of the various
 * representations. */
void REPR_initialize_registry(PARROT_INTERP) {
    PMC *dyn_reg_func;
    
    /* Allocate name to ID map, and anchor it with the GC. */
    repr_name_to_id_map = Parrot_pmc_new(interp, enum_class_Hash);
    Parrot_pmc_gc_register(interp, repr_name_to_id_map);

    /* Add all core representations. */
    register_repr(interp, Parrot_str_new_constant(interp, "KnowHOWREPR"), 
        KnowHOWREPR_initialize(interp));
    register_repr(interp, Parrot_str_new_constant(interp, "P6opaque"), 
        P6opaque_initialize(interp));
    register_repr(interp, Parrot_str_new_constant(interp, "P6int"), 
        P6int_initialize(interp));
    register_repr(interp, Parrot_str_new_constant(interp, "P6num"), 
        P6num_initialize(interp));
    register_repr(interp, Parrot_str_new_constant(interp, "P6str"), 
        P6str_initialize(interp));
    register_repr(interp, Parrot_str_new_constant(interp, "HashAttrStore"), 
        HashAttrStore_initialize(interp));
    register_repr(interp, Parrot_str_new_constant(interp, "Uninstantiable"),
        Uninstantiable_initialize(interp));

    /* Set up object for dynamically registering extra representations. */
    dyn_reg_func = Parrot_pmc_new(interp, enum_class_Pointer);
    VTABLE_set_pointer(interp, dyn_reg_func, REPR_register_dynamic);
    VTABLE_set_pmc_keyed_str(interp, interp->root_namespace,
        Parrot_str_new_constant(interp, "_REGISTER_REPR"), dyn_reg_func);
}
Exemple #2
0
/* Initializes the representations registry, building up all of the various
 * representations. */
void REPR_initialize_registry(PARROT_INTERP) {
    /* Allocate name to ID map, and anchor it with the GC. */
    repr_name_to_id_map = pmc_new(interp, enum_class_Hash);
    Parrot_pmc_gc_register(interp, repr_name_to_id_map);

    /* Add all representations. */
    register_repr(interp, Parrot_str_new_constant(interp, "KnowHOWREPR"), 
        KnowHOWREPR_initialize(interp));
    register_repr(interp, Parrot_str_new_constant(interp, "P6opaque"), 
        P6opaque_initialize(interp));
    register_repr(interp, Parrot_str_new_constant(interp, "P6int"), 
        P6int_initialize(interp));
    register_repr(interp, Parrot_str_new_constant(interp, "P6num"), 
        P6num_initialize(interp));
    register_repr(interp, Parrot_str_new_constant(interp, "P6str"), 
        P6str_initialize(interp));
    register_repr(interp, Parrot_str_new_constant(interp, "HashAttrStore"), 
        HashAttrStore_initialize(interp));
    register_repr(interp, Parrot_str_new_constant(interp, "Uninstantiable"),
        Uninstantiable_initialize(interp));
}
Exemple #3
0
/* Initializes the representations registry, building up all of the various
 * representations. */
void MVM_repr_initialize_registry(MVMThreadContext *tc) {    
    /* Add all core representations. (If order changed, update reprs.h IDs.) */
    register_repr(tc,
        MVM_string_ascii_decode_nt(tc, tc->instance->VMString, "MVMString"),
        MVMString_initialize(tc));
    register_repr(tc,
        MVM_string_ascii_decode_nt(tc, tc->instance->VMString, "VMArray"),
        MVMArray_initialize(tc));
    register_repr(tc,
        MVM_string_ascii_decode_nt(tc, tc->instance->VMString, "VMHash"),
        MVMHash_initialize(tc));
    register_repr(tc,
        MVM_string_ascii_decode_nt(tc, tc->instance->VMString, "MVMCFunction"),
        MVMCFunction_initialize(tc));
    register_repr(tc,
        MVM_string_ascii_decode_nt(tc, tc->instance->VMString, "KnowHOWREPR"),
        MVMKnowHOWREPR_initialize(tc));
    register_repr(tc,
        MVM_string_ascii_decode_nt(tc, tc->instance->VMString, "P6opaque"),
        MVMP6opaque_initialize(tc));
    register_repr(tc,
        MVM_string_ascii_decode_nt(tc, tc->instance->VMString, "MVMCode"),
        MVMCode_initialize(tc));
    register_repr(tc,
        MVM_string_ascii_decode_nt(tc, tc->instance->VMString, "MVMOSHandle"),
        MVMOSHandle_initialize(tc));
    register_repr(tc,
        MVM_string_ascii_decode_nt(tc, tc->instance->VMString, "P6int"),
        P6int_initialize(tc));
    register_repr(tc,
        MVM_string_ascii_decode_nt(tc, tc->instance->VMString, "P6num"),
        P6num_initialize(tc));
    register_repr(tc,
        MVM_string_ascii_decode_nt(tc, tc->instance->VMString, "Uninstantiable"),
        Uninstantiable_initialize(tc));
    register_repr(tc,
        MVM_string_ascii_decode_nt(tc, tc->instance->VMString, "HashAttrStore"),
        HashAttrStore_initialize(tc));
    register_repr(tc,
        MVM_string_ascii_decode_nt(tc, tc->instance->VMString, "KnowHOWAttributeREPR"),
        MVMKnowHOWAttributeREPR_initialize(tc));
    register_repr(tc,
        MVM_string_ascii_decode_nt(tc, tc->instance->VMString, "P6str"),
        P6str_initialize(tc));
    register_repr(tc,
        MVM_string_ascii_decode_nt(tc, tc->instance->VMString, "MVMThread"),
        MVMThread_initialize(tc));
    register_repr(tc,
        MVM_string_ascii_decode_nt(tc, tc->instance->VMString, "VMIter"),
        MVMIter_initialize(tc));
    register_repr(tc,
        MVM_string_ascii_decode_nt(tc, tc->instance->VMString, "MVMContext"),
        MVMContext_initialize(tc));
    register_repr(tc,
        MVM_string_ascii_decode_nt(tc, tc->instance->VMString, "SCRef"),
        MVMSCRef_initialize(tc));
    register_repr(tc,
        MVM_string_ascii_decode_nt(tc, tc->instance->VMString, "Lexotic"),
        MVMLexotic_initialize(tc));
    register_repr(tc,
        MVM_string_ascii_decode_nt(tc, tc->instance->VMString, "MVMCallCapture"),
        MVMCallCapture_initialize(tc));
    register_repr(tc,
        MVM_string_ascii_decode_nt(tc, tc->instance->VMString, "P6bigint"),
        P6bigint_initialize(tc));
    register_repr(tc,
        MVM_string_ascii_decode_nt(tc, tc->instance->VMString, "NFA"),
        MVMNFA_initialize(tc));
}