
/***************************************************************************
**
**    $Header:   D:/ECB2S/SRC/LOG/STKINIT.H__   1.2.1.4   17 Apr 1997 16:01:46   ZJRD  $
**
**    $Log:   D:/ECB2S/SRC/LOG/STKINIT.H__  $
** 
**    Rev 1.2.1.4   17 Apr 1997 16:01:46   ZJRD
** No change.
** 
**    Rev 1.2.1.3   16 Apr 1997 10:34:46   ZJRD
** No change.
** 
**    Rev 1.2.1.2   10 Apr 1997 15:44:02   ZJRD
** No change.
** 
**    Rev 1.2.1.1   03 Apr 1997 15:22:36   ZJRD
** No change.
** 
**    Rev 1.2.1.0   28 Mar 1997 10:26:38   ZJRD
** easy pack sld 2.09d
** 
**    Rev 1.1   19 Mar 1997 11:36:30   ZJRD
** No change.
** 
**    Rev 1.0   12 Mar 1997 14:50:40   ZJRD
** Initial revision.
** 
****************************************************************************/

#ifndef _STKINIT_H_

#define _STKINIT_H_

struct STKNode {
    int num;
    int flag;
    U32 desc;
    U32 desc1;
    U32 sp;
    U32 addr;
    U32 addr1;
    struct STKNode *next ;
    struct STKNode *prev;

public :
    STKNode() {
        num = 0;
        flag = 0;
        desc = 0L;
        desc1 = 0L;
        sp = addr = addr1 = 0L;
        next = prev = 0;
    }
};

class stkServer {
private :
    struct STKNode *stkListHeader ;
    struct STKNode *curNode ;
    char *m_buff;
    SYM_DESCRIPTOR m_blockDesc ;
    SYM_DESCRIPTOR m_varDesc ;

public :
    stkServer() {
        stkListHeader = 0;
        curNode = 0;
        m_buff = 0;
        m_blockDesc = NULL_SYMBOL;
        m_varDesc = NULL_SYMBOL;
    }

public :     
    struct STKNode * GetHeader(void) { return stkListHeader; }
    int buildStack();
    int add(struct STKNode *node);
    void deleteAll();
    void DisplayToShell();
    int IsValidVar(char *command,BOOLEAN& isGlobal,SYM_DESCRIPTOR& symDesc);
    void GetNumber(int& num) {
        if ( curNode ) num = curNode->num + 1;
        else num = 0;
    };                          
    int InitStkLocalVar(int nLevel);
    int GetStkLocalVar(SYM_DESCRIPTOR& desc,CString& name);
};

#endif
