
/***************************************************************************
**
**    $Header:   D:/EPSLDV1/SRC/LOG/STKINIT.H__   1.8   20 Jun 1996 09:25:52   ZJRD  $
**
**    $Log:   D:/EPSLDV1/SRC/LOG/STKINIT.H__  $
** 
**    Rev 1.8   20 Jun 1996 09:25:52   ZJRD
** EasyPack/SLD Version 1.20a
** 
**    Rev 1.6   10 Jun 1996 10:20:30   ZJRD
** EasyPack/SLD Version 1.20
** 
**    Rev 1.4   29 May 1996 09:30:10   ZJRD
** No change.
** 
**    Rev 1.3   16 May 1996 09:07:28   ZJRD
** No change.
** 
**    Rev 1.2   10 May 1996 09:10:26   ZJRD
** No change.
** 
**    Rev 1.1   02 May 1996 10:27:02   ZJRD
** EasyPack/SLD Version 1.92
** 
**    Rev 1.31   18 Apr 1996 12:53:58   Shirley
** No change.
** 
**    Rev 1.30   12 Apr 1996 10:40:48   Shirley
** No change.
** 
**    Rev 1.29   02 Apr 1996 09:23:04   Shirley
** No change.
** 
**    Rev 1.28   15 Feb 1996 08:54:16   Shirley
** No change.
** 
**    Rev 1.27   12 Feb 1996 14:07:12   Shirley
** No change.
** 
**    Rev 1.26   06 Feb 1996 15:33:40   Shirley
** No change.
** 
**    Rev 1.25   06 Feb 1996 13:47:34   Shirley
** No change.
** 
**    Rev 1.24   01 Feb 1996 10:18:50   Shirley
** No change.
** 
**    Rev 1.23   26 Jan 1996 09:14:06   Shirley
** No change.
** 
**    Rev 1.22   25 Jan 1996 13:13:58   Shirley
** No change.
** 
**    Rev 1.21   24 Jan 1996 10:35:16   Shirley
** No change.
** 
**    Rev 1.20   23 Jan 1996 11:26:04   Shirley
** No change.
** 
**    Rev 1.19   18 Jan 1996 10:14:40   Shirley
** No change.
** 
**    Rev 1.18   15 Jan 1996 16:14:04   Shirley
** No change.
** 
**    Rev 1.17   04 Jan 1996 11:15:02   Shirley
** No change.
** 
**    Rev 1.16   30 Nov 1995 09:10:14   Shirley
** No change.
** 
**    Rev 1.15   28 Nov 1995 15:31:04   Shirley
** No change.
** 
**    Rev 1.14   21 Nov 1995 11:24:08   Shirley
** No change.
** 
**    Rev 1.13   13 Nov 1995 09:24:48   Shirley
** No change.
** 
**    Rev 1.12   12 Nov 1995 11:29:04   Shirley
** No change.
** 
**    Rev 1.11   08 Nov 1995 16:32:04   Shirley
** No change.
** 
**    Rev 1.10   08 Nov 1995 12:45:56   Shirley
** No change.
** 
**    Rev 1.9   02 Nov 1995 10:07:02   Shirley
** No change.
** 
**    Rev 1.8   27 Oct 1995 16:51:28   Shirley
** No change.
** 
**    Rev 1.7   27 Oct 1995 13:44:16   Shirley
** No change.
** 
**    Rev 1.6   25 Oct 1995 14:26:04   Shirley
** No change.
** 
**    Rev 1.5   18 Oct 1995 14:48:46   Shirley
** No change.
** 
**    Rev 1.4   13 Oct 1995 13:18:58   Shirley
** No change.
** 
**    Rev 1.3   29 Sep 1995 09:48:48   Shirley
** No change.
** 
**    Rev 1.2   20 Sep 1995 10:57:14   Shirley
** No change.
** 
**    Rev 1.1   15 Sep 1995 09:46:52   Shirley
** No change.
** 
**    Rev 1.0   07 Sep 1995 09:53:36   Shirley
** 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
