src/bdd/parse/parseStack.c File Reference

#include "parseInt.h"
Include dependency graph for parseStack.c:

Go to the source code of this file.

Data Structures

struct  ParseStackFnStruct
struct  ParseStackOpStruct

Functions

Parse_StackFn_tParse_StackFnStart (int nDepth)
bool Parse_StackFnIsEmpty (Parse_StackFn_t *p)
void Parse_StackFnPush (Parse_StackFn_t *p, void *bFunc)
void * Parse_StackFnPop (Parse_StackFn_t *p)
void Parse_StackFnFree (Parse_StackFn_t *p)
Parse_StackOp_tParse_StackOpStart (int nDepth)
bool Parse_StackOpIsEmpty (Parse_StackOp_t *p)
void Parse_StackOpPush (Parse_StackOp_t *p, int Oper)
int Parse_StackOpPop (Parse_StackOp_t *p)
void Parse_StackOpFree (Parse_StackOp_t *p)

Function Documentation

void Parse_StackFnFree ( Parse_StackFn_t p  ) 

Function*************************************************************

Synopsis [Deletes the stack.]

Description []

SideEffects []

SeeAlso []

Definition at line 133 of file parseStack.c.

00134 {
00135     FREE( p->pData );
00136     FREE( p );
00137 }

bool Parse_StackFnIsEmpty ( Parse_StackFn_t p  ) 

Function*************************************************************

Synopsis [Checks whether the stack is empty.]

Description []

SideEffects []

SeeAlso []

Definition at line 75 of file parseStack.c.

00076 {
00077     return (bool)(p->Top == 0);
00078 }

void* Parse_StackFnPop ( Parse_StackFn_t p  ) 

Function*************************************************************

Synopsis [Pops an entry out of the stack.]

Description []

SideEffects []

SeeAlso []

Definition at line 112 of file parseStack.c.

00113 {
00114     if ( p->Top == 0 )
00115     {
00116         printf( "Parse_StackFnPush(): Trying to extract data from the empty stack!\n" );
00117         return NULL;
00118     }
00119     return p->pData[ --p->Top ];
00120 }

void Parse_StackFnPush ( Parse_StackFn_t p,
void *  bFunc 
)

Function*************************************************************

Synopsis [Pushes an entry into the stack.]

Description []

SideEffects []

SeeAlso []

Definition at line 91 of file parseStack.c.

00092 {
00093     if ( p->Top >= p->Size )
00094     {
00095         printf( "Parse_StackFnPush(): Stack size is too small!\n" );
00096         return;
00097     }
00098     p->pData[ p->Top++ ] = bFunc;
00099 }

Parse_StackFn_t* Parse_StackFnStart ( int  nDepth  ) 

FUNCTION DEFINITIONS ///Function*************************************************************

Synopsis [Starts the stack.]

Description []

SideEffects []

SeeAlso []

Definition at line 54 of file parseStack.c.

00055 {
00056     Parse_StackFn_t * p;
00057     p = ALLOC( Parse_StackFn_t, 1 );
00058     memset( p, 0, sizeof(Parse_StackFn_t) );
00059     p->pData = ALLOC( void *, nDepth );
00060     p->Size = nDepth;
00061     return p;
00062 }

void Parse_StackOpFree ( Parse_StackOp_t p  ) 

Function*************************************************************

Synopsis [Deletes the stack.]

Description []

SideEffects []

SeeAlso []

Definition at line 232 of file parseStack.c.

00233 {
00234     FREE( p->pData );
00235     FREE( p );
00236 }

bool Parse_StackOpIsEmpty ( Parse_StackOp_t p  ) 

Function*************************************************************

Synopsis [Checks whether the stack is empty.]

Description []

SideEffects []

SeeAlso []

Definition at line 174 of file parseStack.c.

00175 {
00176     return (bool)(p->Top == 0);
00177 }

int Parse_StackOpPop ( Parse_StackOp_t p  ) 

Function*************************************************************

Synopsis [Pops an entry out of the stack.]

Description []

SideEffects []

SeeAlso []

Definition at line 211 of file parseStack.c.

00212 {
00213     if ( p->Top == 0 )
00214     {
00215         printf( "Parse_StackOpPush(): Trying to extract data from the empty stack!\n" );
00216         return -1;
00217     }
00218     return p->pData[ --p->Top ];
00219 }

void Parse_StackOpPush ( Parse_StackOp_t p,
int  Oper 
)

Function*************************************************************

Synopsis [Pushes an entry into the stack.]

Description []

SideEffects []

SeeAlso []

Definition at line 190 of file parseStack.c.

00191 {
00192     if ( p->Top >= p->Size )
00193     {
00194         printf( "Parse_StackOpPush(): Stack size is too small!\n" );
00195         return;
00196     }
00197     p->pData[ p->Top++ ] = Oper;
00198 }

Parse_StackOp_t* Parse_StackOpStart ( int  nDepth  ) 

Function*************************************************************

Synopsis [Starts the stack.]

Description []

SideEffects []

SeeAlso []

Definition at line 153 of file parseStack.c.

00154 {
00155     Parse_StackOp_t * p;
00156     p = ALLOC( Parse_StackOp_t, 1 );
00157     memset( p, 0, sizeof(Parse_StackOp_t) );
00158     p->pData = ALLOC( int, nDepth );
00159     p->Size = nDepth;
00160     return p;
00161 }


Generated on Tue Jan 5 12:19:00 2010 for abc70930 by  doxygen 1.6.1