static void reset_scanner(GoomSL *gss) { /* {{{ */ gss->num_lines = 0; gss->instr = NULL; iflow_clean(gss->iflow); /* reset variables */ goom_hash_free(gss->vars); gss->vars = goom_hash_new(); gss->currentNS = 0; gss->namespaces[0] = gss->vars; goom_hash_free(gss->structIDS); gss->structIDS = goom_hash_new(); while (gss->nbStructID > 0) { int i; gss->nbStructID--; for(i=0;i<gss->gsl_struct[gss->nbStructID]->nbFields;++i) free(gss->gsl_struct[gss->nbStructID]->fields[i]); free(gss->gsl_struct[gss->nbStructID]); } gss->compilationOK = 1; goom_heap_delete(gss->data_heap); gss->data_heap = goom_heap_new(); } /* }}} */
void gsl_free(GoomSL *gss) { /* {{{ */ iflow_free(gss->iflow); goom_hash_free(gss->vars); goom_hash_free(gss->functions); goom_hash_free(gss->structIDS); free(gss->gsl_struct); goom_heap_delete(gss->data_heap); free(gss->ptrArray); free(gss); } /* }}} */
void iflow_clean(InstructionFlow *_this) { /* {{{ */ /* TODO: clean chaque instruction du flot */ _this->number = 0; goom_hash_free(_this->labels); _this->labels = goom_hash_new(); } /* }}} */
void iflow_free(InstructionFlow *_this) { /* {{{ */ goom_hash_free(_this->labels); free(_this); /*TODO: finir cette fonction */ } /* }}} */