-
Notifications
You must be signed in to change notification settings - Fork 1
/
stmt2.hpp
executable file
·82 lines (79 loc) · 1.41 KB
/
stmt2.hpp
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
80
81
82
#ifndef CONTSTMT_HPP
#define CONTSTMT_HPP
#include"all.hpp"
#include"exprcont.hpp"
class containStmtCls {
EinstructionWord eiw ;
int lineStmt ;
int noEcs,noVint,maxEcs ,maxVint;
exprContainCls **ecs ;
int *valInt ;
containStmtCls(containStmtCls &);
void operator=(containStmtCls &);
public:
void init(void)
{
eiw = NoInstr ;
noEcs = noVint = lineStmt = 0 ;
ecs = valInt = (long)0;
}
containStmtCls(void)
{init();maxEcs = maxVint = 0 ; }
containStmtCls(int ne1 ,int nv1 )
{ int i ;
init() ;
ecs = new (exprContainCls *)[maxEcs = ne1] ;
for(i = 0;i<maxEcs;i++)
*(ecs + i ) = long(0) ;
valInt = new int[maxVint = nv1];
}
getNoExpr(void) ;
~containStmtCls(void)
{
if(ecs)
{
for(int i=0 ;i<noEcs;i++)
if(*(ecs+i))
delete[] *(ecs+i) ;
delete[] ecs ;
}
if(valInt)
delete[] valInt;
}
/*
void clear(void)
{
if(ecs)
{
for(int i=0 ;i<noEcs;i++)
if(*(ecs+i))
delete[] *(ecs+i) ;
delete[] ecs ;
}
if(valInt)
delete[] valInt;
init();
}
*/
void addExpr(exprContainCls *e1 , int ii1)
{
if(ii1<maxEcs)
*(ecs+ii1) = e1 ;
else
{
myDebugKey(0," in exprContainCls::addExr ") ;
exit(0);
}
}
void addValInt(int v1 , int ii1)
{
if(ii1 <maxVint)
*(valInt + ii1) = v1 ;
else
{
myDebugKey(0," in exprContainCls::addVint ") ;
exit(0);
}
}
};
#endif