Пример #1
0
/* ::cortex::ic::accumulator::construct() */
cx_int16 ic_accumulator_construct(ic_accumulator _this) {
/* $begin(::cortex::ic::accumulator::construct) */
    char name[15];
    ic_storage(_this)->kind = IC_ACCUMULATOR;
    sprintf(name, "#%d", ic_program_getAccId(ic_program_get()));
    ic_storage(_this)->name = cx_strdup(name);

    ic_scope_addStorage(ic_program_get()->scope, ic_storage(_this));

    return ic_storage_construct(ic_storage(_this));
/* $end */
}
Пример #2
0
/* ::cortex::ic::label::construct() */
cx_int16 ic_label_construct(ic_label _this) {
/* $begin(::cortex::ic::label::construct) */
    ic_node(_this)->kind = IC_LABEL;
    _this->id = ic_program_getLabel(ic_program_get());
    return ic_node_construct(ic_node(_this));
/* $end */
}
Пример #3
0
/* $CORTO_GENERATED
 *
 * accumulator.c
 *
 * Only code written between the begin and end tags will be preserved
 * when the file is regenerated.
 */

#include <corto/ic/ic.h>

corto_int16 _ic_accumulator_construct(
    ic_accumulator this)
{
/* $begin(corto/ic/accumulator/construct) */
    char name[15];
    ic_storage(this)->kind = IC_ACCUMULATOR;
    sprintf(name, "#%d", ic_program_getAccId(ic_program_get()));
    ic_storage(this)->name = corto_strdup(name);

    ic_scope_addStorage(ic_program_get()->scope, ic_storage(this));

    return ic_storage_construct(ic_storage(this));
/* $end */
}