ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
parseStack.c File Reference
#include "parseInt.h"
Include dependency graph for parseStack.c:

Go to the source code of this file.

Classes

struct  ParseStackFnStruct
 DECLARATIONS ///. More...
 
struct  ParseStackOpStruct
 

Functions

Parse_StackFn_tParse_StackFnStart (int nDepth)
 FUNCTION DEFINITIONS ///.
 
int 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)
 
int 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

◆ Parse_StackFnFree()

void Parse_StackFnFree ( Parse_StackFn_t * p)

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

Synopsis [Deletes the stack.]

Description []

SideEffects []

SeeAlso []

Definition at line 136 of file parseStack.c.

137{
138 ABC_FREE( p->pData );
139 ABC_FREE( p );
140}
#define ABC_FREE(obj)
Definition abc_global.h:267
Cube * p
Definition exorList.c:222
Here is the caller graph for this function:

◆ Parse_StackFnIsEmpty()

int Parse_StackFnIsEmpty ( Parse_StackFn_t * p)

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

Synopsis [Checks whether the stack is empty.]

Description []

SideEffects []

SeeAlso []

Definition at line 78 of file parseStack.c.

79{
80 return (int)(p->Top == 0);
81}
Here is the caller graph for this function:

◆ Parse_StackFnPop()

void * Parse_StackFnPop ( Parse_StackFn_t * p)

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

Synopsis [Pops an entry out of the stack.]

Description []

SideEffects []

SeeAlso []

Definition at line 115 of file parseStack.c.

116{
117 if ( p->Top == 0 )
118 {
119 printf( "Parse_StackFnPush(): Trying to extract data from the empty stack!\n" );
120 return NULL;
121 }
122 return p->pData[ --p->Top ];
123}
Here is the caller graph for this function:

◆ Parse_StackFnPush()

void Parse_StackFnPush ( Parse_StackFn_t * p,
void * bFunc )

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

Synopsis [Pushes an entry into the stack.]

Description []

SideEffects []

SeeAlso []

Definition at line 94 of file parseStack.c.

95{
96 if ( p->Top >= p->Size )
97 {
98 printf( "Parse_StackFnPush(): Stack size is too small!\n" );
99 return;
100 }
101 p->pData[ p->Top++ ] = bFunc;
102}
Here is the caller graph for this function:

◆ Parse_StackFnStart()

Parse_StackFn_t * Parse_StackFnStart ( int nDepth)

FUNCTION DEFINITIONS ///.

GLOBAL VARIABLES ///.

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

Synopsis [Starts the stack.]

Description []

SideEffects []

SeeAlso []

Definition at line 57 of file parseStack.c.

58{
61 memset( p, 0, sizeof(Parse_StackFn_t) );
62 p->pData = ABC_ALLOC( void *, nDepth );
63 p->Size = nDepth;
64 return p;
65}
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
typedefABC_NAMESPACE_HEADER_START struct ParseStackFnStruct Parse_StackFn_t
INCLUDES ///.
Definition parseInt.h:41
char * memset()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Parse_StackOpFree()

void Parse_StackOpFree ( Parse_StackOp_t * p)

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

Synopsis [Deletes the stack.]

Description []

SideEffects []

SeeAlso []

Definition at line 235 of file parseStack.c.

236{
237 ABC_FREE( p->pData );
238 ABC_FREE( p );
239}
Here is the caller graph for this function:

◆ Parse_StackOpIsEmpty()

int Parse_StackOpIsEmpty ( Parse_StackOp_t * p)

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

Synopsis [Checks whether the stack is empty.]

Description []

SideEffects []

SeeAlso []

Definition at line 177 of file parseStack.c.

178{
179 return (int)(p->Top == 0);
180}
Here is the caller graph for this function:

◆ Parse_StackOpPop()

int Parse_StackOpPop ( Parse_StackOp_t * p)

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

Synopsis [Pops an entry out of the stack.]

Description []

SideEffects []

SeeAlso []

Definition at line 214 of file parseStack.c.

215{
216 if ( p->Top == 0 )
217 {
218 printf( "Parse_StackOpPush(): Trying to extract data from the empty stack!\n" );
219 return -1;
220 }
221 return p->pData[ --p->Top ];
222}
Here is the caller graph for this function:

◆ Parse_StackOpPush()

void Parse_StackOpPush ( Parse_StackOp_t * p,
int Oper )

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

Synopsis [Pushes an entry into the stack.]

Description []

SideEffects []

SeeAlso []

Definition at line 193 of file parseStack.c.

194{
195 if ( p->Top >= p->Size )
196 {
197 printf( "Parse_StackOpPush(): Stack size is too small!\n" );
198 return;
199 }
200 p->pData[ p->Top++ ] = Oper;
201}
Here is the caller graph for this function:

◆ Parse_StackOpStart()

Parse_StackOp_t * Parse_StackOpStart ( int nDepth)

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

Synopsis [Starts the stack.]

Description []

SideEffects []

SeeAlso []

Definition at line 156 of file parseStack.c.

157{
160 memset( p, 0, sizeof(Parse_StackOp_t) );
161 p->pData = ABC_ALLOC( int, nDepth );
162 p->Size = nDepth;
163 return p;
164}
struct ParseStackOpStruct Parse_StackOp_t
Definition parseInt.h:42
Here is the call graph for this function:
Here is the caller graph for this function: