Changeset 11b18d6c8033bdf184ee5924e576f0de3e5861aa

Show
Ignore:
Timestamp:
04/19/10 18:03:45 (2 years ago)
Author:
Philip Herron <redbrain@…>
Parents:
168c2a5ec263be75f797e77bdf8a7e3011663c1a
Children:
794fb4166890a42ec59270e3441d7ddf500fdbdb
git-committer:
Philip Herron <redbrain@omicron.(none)> / 2010-04-19T18:03:45Z+0100
Message:

compiles now time to fill out the objects

Location:
src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • src/gg_garbage.c

    r8cc1949 r11b18d6  
    4040 
    4141/* Declare the tables */ 
    42 extern crl_stack *crl_parse_stk, *crl_lex_stack; 
     42extern crl_stack_t *crl_parse_stk, *crl_lex_stack; 
    4343// the runtime symbol stack! 
    4444extern crl_context_table *crl_runtime_ctx_table; 
    45 static crl_stack* crl_runtime_gbg = NULL; 
    46  
    47 static void free_hash_table_symbols( crl_table ** ); 
     45static crl_stack_t* crl_runtime_gbg = NULL; 
     46 
     47static void free_hash_table_symbols( crl_table_t ** ); 
    4848 
    4949void crl_garbage_lex_free( void ) 
     
    5252    { 
    5353      char * o; 
    54       while( (o= crl_stack_pop( crl_lex_stack )) ) 
     54      while( (o= crl_dd_stack_pop( crl_lex_stack )) ) 
    5555        { 
    5656          crl_free( o ); 
    5757        } 
    58       crl_stack_free( crl_lex_stack ); 
     58      crl_dd_stack_free( crl_lex_stack ); 
    5959      crl_lex_stack= NULL; 
    6060    } 
     
    6767      crl_debug("garbage collector running...\n"); 
    6868      crl_symbol_obj *p_obj; 
    69       unsigned int i = crl_stack_get_size( crl_runtime_gbg ); 
     69      unsigned int i = crl_dd_stack_get_size( crl_runtime_gbg ); 
    7070      unsigned int idx = 0; 
    7171 
     
    7575          idx++; crl_garbage_free_obj( &p_obj ); 
    7676        } 
    77       crl_stack_free( crl_runtime_gbg ); 
     77      crl_dd_stack_free( crl_runtime_gbg ); 
    7878      crl_runtime_gbg = NULL; 
    7979    } 
     
    8686      if( crl_runtime_gbg ) 
    8787        { 
    88           crl_stack_push( crl_runtime_gbg, (*sym) ); 
     88          crl_dd_stack_push( crl_runtime_gbg, (*sym) ); 
    8989        } 
    9090      else 
    9191        { 
    92           crl_runtime_gbg= (crl_stack*) 
    93             crl_malloc(sizeof(crl_stack)); 
    94           crl_stack_init( &crl_runtime_gbg ); 
    95  
    96           crl_stack_push( crl_runtime_gbg, (*sym) ); 
     92          crl_runtime_gbg= (crl_stack_t *) 
     93            crl_malloc(sizeof(crl_stack_t)); 
     94          crl_dd_stack_init( &crl_runtime_gbg ); 
     95 
     96          crl_dd_stack_push( crl_runtime_gbg, (*sym) ); 
    9797        } 
    9898    } 
     
    117117    { 
    118118      crl_debug("freeing parse stk!\n"); 
    119       crl_stack_free( crl_parse_stk ); 
     119      crl_dd_stack_free( crl_parse_stk ); 
    120120      crl_debug("done!\n"); 
    121121    } 
     
    147147        { 
    148148        case TYPE_LIST: 
    149           crl_garbage_free_hash_table( &((*sym)->op_a.list_table) ); 
     149          crl_fatal("not implemented yet!\n"); 
    150150          break; 
    151151 
     
    169169        { 
    170170        case TYPE_LIST: 
    171           crl_garbage_free_hash_table( &((*sym)->op_b.list_table) ); 
     171          crl_fatal("not implemented yet!\n"); 
    172172          break; 
    173173 
     
    187187          if( (*sym)->op_b.stack_table ) 
    188188            { 
    189               crl_stack *t= (*sym)->op_b.stack_table; 
    190               char * o= crl_stack_pop( t ); 
     189              crl_stack_t *t= (*sym)->op_b.stack_table; 
     190              char * o= crl_dd_stack_pop( t ); 
    191191              while( o ) 
    192192                { 
    193193                  crl_free( o ); 
    194                   o= crl_stack_pop( t ); 
     194                  o= crl_dd_stack_pop( t ); 
    195195                } 
    196               crl_stack_free( t ); 
     196              crl_dd_stack_free( t ); 
    197197            } 
    198198          break; 
     
    201201          if( (*sym)->op_b.stack_table ) 
    202202            { 
    203               crl_stack *t= (*sym)->op_b.stack_table; 
    204               crl_symbol_obj * o= crl_stack_pop( t ); 
     203              crl_stack_t *t= (*sym)->op_b.stack_table; 
     204              crl_symbol_obj * o= crl_dd_stack_pop( t ); 
    205205              while( o ) 
    206206                { 
    207207                  crl_garbage_free_obj( &o ); 
    208                   o= crl_stack_pop( t ); 
     208                  o= crl_dd_stack_pop( t ); 
    209209                } 
    210               crl_stack_free( t ); 
     210              crl_dd_stack_free( t ); 
    211211            } 
    212212          break; 
     
    231231} 
    232232 
    233 void crl_garbage_free_hash_table( crl_table **table ) 
     233void crl_garbage_free_hash_table( crl_table_t ** table ) 
    234234{ 
    235235  crl_debug("freeing hash table!\n"); 
     
    239239 
    240240static 
    241 void free_hash_table_symbols( crl_table **table ) 
     241void free_hash_table_symbols( crl_table_t ** table ) 
    242242{ 
    243243  if( table ) 
     
    292292void crl_garbage_free_context_table( crl_context_table **stack ) 
    293293{ 
    294   signed int len= crl_context_get_table_size( *stack ); 
     294  signed int len= crl_rr_context_get_table_size( *stack ); 
    295295  crl_debug("stack frame size :: '%i'!\n", len ); 
    296296  len--; 
  • src/rr_context.c

    r168c2a5 r11b18d6  
    250250} 
    251251 
    252 bool crl_context_push_function_def( crl_symbol_obj * functor, 
     252bool crl_rr_context_push_function_def( crl_symbol_obj * functor, 
    253253                                    crl_context_table ** context ) 
    254254{ 
     
    277277} 
    278278 
    279 bool crl_context_push_object_def( crl_symbol_obj * object, 
     279bool crl_rr_context_push_object_def( crl_symbol_obj * object, 
    280280                                  crl_context_table ** context ) 
    281281{ 
     
    328328} 
    329329 
    330 void crl_context_init_context( crl_branch_context ** branch ) 
     330void crl_rr_context_init( crl_branch_context ** branch ) 
    331331{ 
    332332  if( branch ) 
     
    369369 **/ 
    370370crl_branch_context * 
    371 crl_context_clone_branch( crl_branch_context ** ctx ) 
     371crl_rr_context_clone_branch( crl_branch_context ** ctx ) 
    372372{ 
    373373  crl_branch_context * retval = (crl_branch_context*) 
     
    387387 
    388388crl_obj_state_t * 
    389 crl_context_clone_obj_state( crl_obj_state_t ** obj_s ) 
     389crl_rr_context_clone_obj_state( crl_obj_state_t ** obj_s ) 
    390390{ 
    391391  crl_debug("clone object state!\n"); 
     
    397397      retval->identifier = crl_strdup( (*obj_s)->identifier ); 
    398398      retval->state = ((*obj_s)->state); 
    399       retval->context = crl_context_clone_branch( &((*obj_s)->context) ); 
     399      retval->context = crl_rr_context_clone_branch( &((*obj_s)->context) ); 
    400400      crl_debug("cloned context!\n"); 
    401401    } 
     
    413413  crl_branch_context *ctx= (crl_branch_context*) 
    414414    crl_malloc(sizeof( crl_branch_context )); 
    415   crl_context_init_context( &ctx ); 
     415  crl_rr_context_init( &ctx ); 
    416416 
    417417  crl_runtime_ctx_table= (crl_context_table*)