-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstackfun.hpp
More file actions
executable file
·79 lines (71 loc) · 2.17 KB
/
stackfun.hpp
File metadata and controls
executable file
·79 lines (71 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#ifndef STACKFUN_HPP
#define STACKFUN_HPP
#include"all.hpp"
class execProcCls ;
class stringCls;
class savedInCallFunctionCls{
int indexProc;
stringCls nameProc;
execProcCls *exeProc;
stringCls nameFile;
public:
int getIndex(void){return indexProc;}
execProcCls *getProc(void){ return exeProc;};
stringCls getNameFile(void){return nameFile;}
stringCls getNameProc(void){ return nameProc ;}
savedInCallFunctionCls(int i1,stringCls n1,execProcCls *ep1,stringCls nf)
{
indexProc=i1;
nameProc=n1;
exeProc=ep1;
nameFile=nf;
}
savedInCallFunctionCls( void)
{
indexProc=-1;
exeProc=long(0);
}
};
#include"stackcls.hpp"
class stackOfCallFunctionCls : public stackCls<savedInCallFunctionCls>{
int noVInStack ;
int maxVal;
void error(char *pp1)
{cout <<"maxVal is "<<maxVal<<endl; myDebugKey(noVInStack,pp1);exitProgram(0) ; }
public :
stackOfCallFunctionCls(int sz=MAX_NESTED_CALL_FUNCTION):stackCls<savedInCallFunctionCls>(sz)
{noVInStack = 0 ; maxVal = sz ;}
int getSize(void){return noVInStack;}
void push(savedInCallFunctionCls v1)
{
noVInStack++;
if(noVInStack < maxVal)
Push(v1);
else
error(" standard stack of function overflow in STACKVAL.HPP" );
}
savedInCallFunctionCls pop(void)
{
if(noVInStack)
noVInStack -- ;
else
error("standard stack of function underflow end of stack encounter in STACKVAL.HPP ");
return Pop();
}
savedInCallFunctionCls top(void)
{return Top();}
valBool getProcFindName(int indexOfFindNameUp,stringCls <Name);
void getProcAddName(int indexOfFindNameUp,stringCls <name,variableValue &vv1);
valBool getProcArrName(int indexOfFindNameUp,stringCls <Name);
void getProcAddArrName(int indexOfFindNameUp,stringCls <Name,variableValue &vv1);
// valBool getProcFindStemName(int indexOfFindNameUp,stringCls <Name);
// void getProcAddStemName(int indexOfFindNameUp,stringCls <Name,variableValue &vv1);
execProcCls *getiProc(int indexOfFindNameUp)
{
execProcCls *ep1=NULL;
if(indexOfFindNameUp<noVInStack)
ep1=getIndex(noVInStack-indexOfFindNameUp-1).getProc();
return ep1;
}
};
#endif