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

letDeclNodeList.c File Reference

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

Go to the source code of this file.

Functions

letDeclNodeList letDeclNodeList_new ()
letDeclNodeList letDeclNodeList_add (letDeclNodeList s, letDeclNode el)
cstring letDeclNodeList_unparse (letDeclNodeList s)
void letDeclNodeList_free (letDeclNodeList s)


Function Documentation

letDeclNodeList letDeclNodeList_add ( letDeclNodeList s,
letDeclNode el )
 

Definition at line 69 of file letDeclNodeList.c.

00070 {
00071   llassert (letDeclNodeListBASESIZE > 0);
00072 
00073   if (s->nspace <= 0)
00074     letDeclNodeList_grow (s);
00075 
00076   s->nspace--;
00077   s->elements[s->nelements] = el;
00078   s->nelements++;
00079 
00080   return s;
00081 }

void letDeclNodeList_free ( letDeclNodeList s )
 

Definition at line 107 of file letDeclNodeList.c.

Referenced by fcnNode_free().

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

letDeclNodeList letDeclNodeList_new ( )
 

Definition at line 36 of file letDeclNodeList.c.

Referenced by fcnNode_fromDeclarator().

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

cstring letDeclNodeList_unparse ( letDeclNodeList s )
 

Definition at line 84 of file letDeclNodeList.c.

Referenced by fcnNode_unparse().

00085 {
00086   cstring st = cstring_undefined;
00087 
00088   letDeclNodeList_elements (s, current)
00089   {
00090     st = message ("%qlet %s", st, ltoken_getRawString (current->varid));
00091 
00092     if (current->sortspec != NULL)
00093       {
00094         st = message ("%q: %q", st, lclTypeSpecNode_unparse (current->sortspec));
00095       }
00096     else
00097       {
00098         st = message ("%q ", st);
00099       }
00100     st = message ("%q = %q\n", st, termNode_unparse (current->term));
00101   } end_letDeclNodeList_elements;
00102 
00103   return st;
00104 }


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