/* * Stack.h * Author: Hannah C. Tang (hctang@cs) * * Specification of public functions for the Stack struct * (the module parser) * * $Id: Stack.h,v 1.1 2001/12/18 00:24:16 cse466_t Exp $ * */ #ifndef STACK_H #define STACK_H #include "common.h" struct Stack; /* Dynamically allocate and free Stack structs */ struct Stack* Stack_malloc( void ); void Stack_free( struct Stack *pS ); /* Push this (index, value, argument) tuple onto the stack. * Returns Bool_true if successful */ Bool Stack_push( struct Stack *pS, unsigned int index, enum Reader_TokenType t, unsigned int arg ); /* Pop an (index, value, argument) tuple off the stack. * Returns Bool_true if successful */ Bool Stack_pop( struct Stack *pS, unsigned int *pIndex, enum Reader_TokenType *pT, unsigned int *pArg ); /* Return the number of elements in the stack */ unsigned int Stack_getNumElements( const struct Stack *pS ); /* Returns Bool_true if the stack has no elements */ Bool Stack_isEmpty( const struct Stack *pS ); #endif /* STACK_H */