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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
// This file is part of PUMA.
// Copyright (C) 1999-2003 The PUMA developer team.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of
// the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public
// License along with this program; if not, write to the Free
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
// MA 02111-1307 USA
#ifndef __CTypeArray_h__
#define __CTypeArray_h__
#ifndef __CTypeInfo_h__
#warning !!! DO NOT INCLUDE THIS FILE !!!
#warning !!! INCLUDE FILE "CTypeInfo.h" INSTEAD !!!
#endif
namespace Puma {
class CTypeArray : public CTypeInfo {
long int _Size;
bool _isFixed;
CTypeQualified *_Quals;
CTypeTemplateParam *_DepDim;
bool _hasDim;
protected:
CTypeArray (CTypeInfo *, CTypeQualified *, TypeId);
public:
CTypeArray (CTypeInfo *, CTypeQualified * = 0, bool has_dimension = false);
~CTypeArray ();
void Dimension (long int);
long int Dimension () const;
void isFixed (bool);
bool isFixed () const;
void hasDimension (bool);
bool hasDimension () const;
CTypeQualified *Qualifiers () const;
void DepDim (CTypeTemplateParam *);
CTypeTemplateParam *DepDim () const;
};
inline CTypeArray::CTypeArray (CTypeInfo *base, CTypeQualified *quals, bool has_dimension) :
CTypeInfo (base, CTypeInfo::TYPE_ARRAY),
_Size (0),
_isFixed (false),
_Quals (quals),
_DepDim (0),
_hasDim (has_dimension)
{}
inline CTypeArray::CTypeArray (CTypeInfo *base, CTypeQualified *quals, CTypeInfo::TypeId id) :
CTypeInfo (base, id),
_Size (0),
_isFixed (false),
_Quals (quals),
_DepDim (0),
_hasDim (false)
{}
inline CTypeArray::~CTypeArray ()
{ if (_Quals) CTypeInfo::Destroy (_Quals); }
inline void CTypeArray::Dimension (long int d)
{ _Size = d; }
inline long int CTypeArray::Dimension () const
{ return _Size; }
inline void CTypeArray::isFixed (bool v)
{ _isFixed = v; }
inline bool CTypeArray::isFixed () const
{ return _isFixed; }
inline void CTypeArray::hasDimension (bool v)
{ _hasDim = v; }
inline bool CTypeArray::hasDimension () const
{ return _hasDim || _Size != 0; }
inline CTypeQualified *CTypeArray::Qualifiers () const
{ return _Quals; }
inline void CTypeArray::DepDim (CTypeTemplateParam *tp)
{ _DepDim = tp; }
inline CTypeTemplateParam *CTypeArray::DepDim () const
{ return _DepDim; }
} // namespace Puma
#endif /* __CTypeArray_h__ */
|