Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members  

varNodeList.c File Reference

#include "lclintMacros.nf"
#include "llbasic.h"

Go to the source code of this file.

Functions

varNodeList varNodeList_new ()
varNodeList varNodeList_add (varNodeList s, varNode el)
cstring varNodeList_unparse (varNodeList s)
void varNodeList_free (varNodeList s)
varNodeList varNodeList_copy (varNodeList s)


Function Documentation

varNodeList varNodeList_add ( varNodeList s,
varNode el )
 

Definition at line 67 of file varNodeList.c.

Referenced by varNodeList_copy().

00068 {
00069   if (s->nspace <= 0)
00070     varNodeList_grow (s);
00071 
00072   s->nspace--;
00073   s->elements[s->nelements] = el;
00074   s->nelements++;
00075   return s;
00076 }

varNodeList varNodeList_copy ( varNodeList s )
 

Definition at line 128 of file varNodeList.c.

Referenced by quantifierNode_copy().

00129 {
00130   varNodeList ret = varNodeList_new ();
00131 
00132   varNodeList_elements (s, el)
00133     {
00134       ret = varNodeList_add (ret, varNode_copy (el));
00135     } end_varNodeList_elements;
00136 
00137   return ret;
00138 }

void varNodeList_free ( varNodeList s )
 

Definition at line 115 of file varNodeList.c.

Referenced by quantifierNode_free().

00116 {
00117   int i;
00118   for (i = 0; i < s->nelements; i++)
00119     {
00120       varNode_free (s->elements[i]); 
00121     }
00122 
00123   sfree (s->elements);
00124   sfree (s);
00125 }

varNodeList varNodeList_new ( )
 

Definition at line 35 of file varNodeList.c.

Referenced by varNodeList_copy().

00036 {
00037   varNodeList s = (varNodeList) dmalloc (sizeof (*s));
00038 
00039   s->nelements = 0;
00040   s->nspace = varNodeListBASESIZE;
00041   s->elements = (varNode *)
00042     dmalloc (sizeof (*s->elements) * varNodeListBASESIZE);
00043 
00044   return (s);
00045 }

cstring varNodeList_unparse ( varNodeList s )
 

Definition at line 79 of file varNodeList.c.

Referenced by quantifierNodeList_unparse().

00080 {
00081   int i;
00082   cstring st = cstring_undefined;
00083   bool first = TRUE;
00084 
00085   for (i = 0; i < s->nelements; i++)
00086     {
00087       cstring type = cstring_undefined;
00088       varNode current = s->elements[i];
00089 
00090       if (current->isObj)
00091         {
00092           type = cstring_makeLiteral ("obj ");
00093         }
00094 
00095       if (current->type != NULL)
00096         {
00097           type = message (": %q%q", type, lclTypeSpecNode_unparse (current->type));
00098         }
00099 
00100       if (first)
00101         {
00102           st = type;
00103           first = FALSE;
00104         }
00105       else
00106         {
00107           st = message ("%q, %q", st, type);
00108         }
00109     }
00110 
00111   return st;
00112 }


Generated at Fri Nov 3 18:58:22 2000 for LCLint by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000