slist.cpp revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
/*
* SList.C
*
* SOFTWARE RIGHTS
*
* We reserve no LEGAL rights to SORCERER -- SORCERER is in the public
* domain. An individual or company may do whatever they wish with
* source code distributed with SORCERER or the code generated by
* SORCERER, including the incorporation of SORCERER, or its output, into
* commerical software.
*
* We encourage users to develop software with SORCERER. However, we do
* ask that credit is given to us for developing SORCERER. By "credit",
* we mean that if you incorporate our source code into one of your
* programs (commercial product, research project, or otherwise) that you
* acknowledge this fact somewhere in the documentation, research report,
* etc... If you like SORCERER and have developed a nice tool with the
* output, please mention that you developed it using SORCERER. In
* addition, we ask that this header remain intact in our source code.
* As long as these guidelines are kept, we expect to continue enhancing
* this system and expect to make other tools available as they are
* completed.
*
* PCCTS 1.33
* Terence Parr
* Parr Research Corporation
* with Purdue University and AHPCRC, University of Minnesota
* 1992-2000
*/
#define ANTLR_SUPPORT_CODE
#include "SList.h"
#include "pccts_stdarg.h" // MR23
/* Iterate over a list of elements; returns ptr to a new element
* in list upon every call and NULL when no more are left.
* Very useful like this:
*
* cursor = mylist;
* while ( (p=mylist->iterate(&cursor)) ) {
* // place with element p
* }
*
* The cursor must be initialized to point to the list to iterate over.
*/
void *SList::
{
void *e;
return e;
}
/* add an element to end of list. */
void SList::
add(void *e)
{
p = new SListNode;
p->setElem(e);
{
}
else /* find end of list */
{
tail = p;
}
}
void SList::
lfree()
{
SListNode *p,*q;
{
q = p->next();
free(p);
}
}
{
SListNode *p;
{
}
return t;
}
// MR23
{
return iRet;
}