75
76
virtual bool operator ==(const MatchType &) const;
76
77
inline bool operator !=(const MatchType &t) const { return !(*this == t); }
78
// print the string representation of this type
79
//! print the string representation of this type
79
80
virtual void print (ostream &, const char* = 0, bool = false) const = 0;
81
// check whether this is a function type
82
//! check whether this is a function type
82
83
virtual bool is_function () const { return false; }
83
// check whether this is an array type
84
//! check whether this is an array type
84
85
virtual bool is_array () const { return false; }
85
// check whether this type is 'void'
86
//! check whether this type is 'void'
86
87
virtual bool is_void () const { return false; }
88
//! check whether this type is primitive
89
virtual bool is_primitive () const { return false; }
90
//! check whether this type is a reference
91
virtual bool is_reference () const { return false; }
88
// create a clone of this match type
93
//! create a clone of this match type
89
94
virtual MatchType *clone () const = 0;
91
// get the base type if this is a derived type
96
//! get the base type if this is a derived type
92
97
virtual MatchType *base () const { return 0; }
94
99
// perform a type match
95
100
virtual bool matches (CTypeInfo *ctype) const = 0;
101
virtual bool matches (const MatchType &type) const = 0;
97
103
// adjust the argument types according to �8.3.5.2 and �8.3.5.3 of ISO C++
98
104
virtual void adjust_args (bool &f, bool &a, bool &q, bool &v) {}
100
106
// converts the type into an MTQual if it is one
101
107
virtual MTQual *qualified () { return 0; }
108
virtual const MTQual *qualified () const { return 0; }
104
111
// should later become "MatchType"
158
165
bool matches (CTypeInfo *ctype) const {
159
166
return _type_info->matches (ctype);
168
bool matches (MatchTypeRef type) const {
169
return _type_info->matches (*type.type_info ());
162
172
// adjust the argument types according to �8.3.5.2 and �8.3.5.3 of ISO C++
163
173
void adjust_args (bool &f, bool &a, bool &q, bool &v) {
167
177
// print the string representation of this type
168
void print (ostream &os) const {
169
_type_info->print (os);
178
void print (ostream &os, const char *prefix = 0) const {
179
_type_info->print (os, prefix);
172
182
// check and get specific properties of this type
180
190
bool is_function () const { return _type_info->is_function (); }
181
191
bool is_array () const { return _type_info->is_array (); }
182
192
bool is_void () const { return _type_info->is_void(); }
193
bool is_primitive () const { return _type_info->is_primitive(); }
194
bool is_reference () const { return _type_info->is_reference(); }
184
196
MatchTypeRef base () const {
185
197
MatchType *b = _type_info->base ();
186
198
return b ? MatchTypeRef (b->clone ()) : MatchTypeRef ();