absyntax/absyntax.cc
changeset 1041 56ebe2a31b5b
parent 965 c9eeb67ba939
child 1043 4165b7189c32
equal deleted inserted replaced
1040:e8563dcaefca 1041:56ebe2a31b5b
    97   if (NULL == elements) ERROR_MSG("out of memory");
    97   if (NULL == elements) ERROR_MSG("out of memory");
    98   add_element(elem); 
    98   add_element(elem); 
    99 }
    99 }
   100 
   100 
   101 
   101 
       
   102 /* get element in position pos of the list */
       
   103 symbol_c *list_c::get_element(int pos) {return elements[pos];}
       
   104 
   102 /* append a new element to the end of the list */
   105 /* append a new element to the end of the list */
   103 void list_c::add_element(symbol_c *elem) {
   106 void list_c::add_element(symbol_c *elem) {
   104   // printf("list_c::add_element()\n");
   107   // printf("list_c::add_element()\n");
   105   if (c <= n)
   108   if (c <= n)
   106     if (!(elements=(symbol_c**)realloc(elements,(c+=LIST_CAP_INCR)*sizeof(symbol_c *))))
   109     if (!(elements=(symbol_c**)realloc(elements,(c+=LIST_CAP_INCR)*sizeof(symbol_c *))))