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

initDeclNodeList.c File Reference

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

Go to the source code of this file.

Functions

initDeclNodeList initDeclNodeList_new ()
initDeclNodeList initDeclNodeList_add (initDeclNodeList s, initDeclNode el)
cstring initDeclNodeList_unparse (initDeclNodeList s)
void initDeclNodeList_free (initDeclNodeList s)


Function Documentation

initDeclNodeList initDeclNodeList_add ( initDeclNodeList s,
initDeclNode el )
 

Definition at line 68 of file initDeclNodeList.c.

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

void initDeclNodeList_free ( initDeclNodeList s )
 

Definition at line 108 of file initDeclNodeList.c.

Referenced by varDeclarationNode_free().

00109 {
00110   int i;
00111   for (i = 0; i < s->nelements; i++)
00112     {
00113       initDeclNode_free (s->elements[i]);
00114     }
00115 
00116   sfree (s->elements);
00117   sfree (s);
00118 }

initDeclNodeList initDeclNodeList_new ( )
 

Definition at line 36 of file initDeclNodeList.c.

00037 {
00038   initDeclNodeList s = (initDeclNodeList) dmalloc (sizeof (*s));
00039   
00040   s->nelements = 0;
00041   s->nspace = initDeclNodeListBASESIZE;
00042   s->elements = (initDeclNode *)
00043     dmalloc (sizeof (*s->elements) * initDeclNodeListBASESIZE);
00044 
00045   return (s);
00046 }

cstring initDeclNodeList_unparse ( initDeclNodeList s )
 

Definition at line 81 of file initDeclNodeList.c.

Referenced by constDeclarationNode_unparse(), varDeclarationNodeList_unparse(), and varDeclarationNode_unparse().

00082 {
00083   cstring st = cstring_undefined;
00084   bool first = TRUE;
00085 
00086   initDeclNodeList_elements (s, current)
00087   {
00088     if (first)
00089       {
00090         first = FALSE;
00091         st = declaratorNode_unparse (current->declarator);
00092       }
00093     else
00094       {
00095         st = message ("%q, %q", st, declaratorNode_unparse (current->declarator));
00096       }
00097 
00098     if (current->value != (termNode) 0)
00099       {
00100         st = message ("%q = %q", st, termNode_unparse (current->value));
00101       }
00102   } end_initDeclNodeList_elements;
00103 
00104   return st;
00105 }


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