~ubuntu-branches/ubuntu/jaunty/aspectc++/jaunty

« back to all changes in this revision

Viewing changes to Puma/gen-release/step1/src/CClassDatabase.cc

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2008-07-07 14:41:02 UTC
  • mfrom: (1.1.3 upstream) (6.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080707144102-lzml7t07f3sl00r5
Tags: 1.0pre4~svn.20080711-1
* new upstream snapshot.
* include all upstream documentation. Clarifying emails regarding
  licensing has been included into debian/copyright.
* reformat description following recomendations of
  http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Description
  (Closes: #480316)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// This file is part of PUMA.
2
 
// Copyright (C) 1999-2003  The PUMA developer team.
3
 
//                                                                
4
 
// This program is free software;  you can redistribute it and/or 
5
 
// modify it under the terms of the GNU General Public License as 
6
 
// published by the Free Software Foundation; either version 2 of 
7
 
// the License, or (at your option) any later version.            
8
 
//                                                                
9
 
// This program is distributed in the hope that it will be useful,
10
 
// but WITHOUT ANY WARRANTY; without even the implied warranty of 
11
 
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
12
 
// GNU General Public License for more details.                   
13
 
//                                                                
14
 
// You should have received a copy of the GNU General Public      
15
 
// License along with this program; if not, write to the Free     
16
 
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
17
 
// MA  02111-1307  USA                                            
18
 
 
19
 
#include "Puma/CEnumeratorInfo.h"
20
 
#include "Puma/CTemplateParamInfo.h"
21
 
#include "Puma/CClassDatabase.h"
22
 
#include "Puma/CAttributeInfo.h"
23
 
#include "Puma/CFunctionInfo.h"
24
 
#include "Puma/CArgumentInfo.h"
25
 
#include "Puma/CTypedefInfo.h"
26
 
#include "Puma/CTemplateInstance.h"
27
 
#include "Puma/CTemplateInfo.h"
28
 
#include "Puma/CObjectInfo.h"
29
 
#include "Puma/CScopeInfo.h"
30
 
#include "Puma/CUnionInfo.h"
31
 
#include "Puma/CClassInfo.h"
32
 
#include "Puma/CFileInfo.h"
33
 
#include "Puma/CEnumInfo.h"
34
 
#include "Puma/CTypeInfo.h"
35
 
#include "Puma/CUsingInfo.h"
36
 
#include "Puma/CNamespaceInfo.h"
37
 
#include "Puma/ErrorStream.h"
38
 
#include "Puma/CProject.h"
39
 
#include "Puma/Token.h"
40
 
#include "Puma/Unit.h"
41
 
#include <iostream>
42
 
#include <string.h>
43
 
#include <stdio.h>
44
 
using namespace std;
45
 
 
46
 
namespace Puma {
47
 
 
48
 
 
49
 
CClassDatabase::~CClassDatabase () {
50
 
  for (int i = 0; i < _Files.length (); i++)
51
 
    delete (CFileInfo*)_Files[i];
52
 
  // delete functions infos of built-in operators
53
 
  multimap<int,CFunctionInfo*>::iterator iter;
54
 
  for (iter = _builtin_ops.begin (); iter != _builtin_ops.end (); ++iter)
55
 
    delete iter->second;
56
 
}
57
 
 
58
 
void CClassDatabase::Insert (CObjectInfo *info) {
59
 
  if (! info || ! info->Name ()) return;
60
 
 
61
 
  if (info->ClassInfo ())
62
 
    _Classes.append (info);
63
 
  else if (info->UnionInfo ())
64
 
    _Unions.append (info);
65
 
  else if (info->EnumInfo ())
66
 
    _Enums.append (info);
67
 
  else if (info->TypedefInfo ())
68
 
    _Typedefs.append (info);
69
 
  else if (info->FunctionInfo ())
70
 
    _Functions.append (info);
71
 
  else if (info->FileInfo ())
72
 
    _Files.append (info);
73
 
  else
74
 
    return; // Unknown!
75
 
 
76
 
  info->ClassDB (this);
77
 
}
78
 
  
79
 
void CClassDatabase::Remove (CObjectInfo *info) {
80
 
  if (! info) return;
81
 
  if (info->ClassInfo ()) {
82
 
    for (long i = ClassInfos (); i > 0; i--)
83
 
      if (_Classes.fetch (i-1) == info)
84
 
        _Classes.remove (i-1);
85
 
  } else if (info->UnionInfo ()) {
86
 
    for (long i = UnionInfos (); i > 0; i--)
87
 
      if (_Unions.fetch (i-1) == info)
88
 
        _Unions.remove (i-1);
89
 
  } else if (info->EnumInfo ()) {
90
 
    for (long i = EnumInfos (); i > 0; i--)
91
 
      if (_Enums.fetch (i-1) == info)
92
 
        _Enums.remove (i-1);
93
 
  } else if (info->TypedefInfo ()) {
94
 
    for (long i = TypedefInfos (); i > 0; i--)
95
 
      if (_Typedefs.fetch (i-1) == info)
96
 
        _Typedefs.remove (i-1);
97
 
  } else if (info->FunctionInfo ()) {
98
 
    for (long i = FunctionInfos (); i > 0; i--)
99
 
      if (_Functions.fetch (i-1) == info)
100
 
        _Functions.remove (i-1);
101
 
  } else if (info->FileInfo ()) {
102
 
    for (long i = FileInfos (); i > 0; i--)
103
 
      if (_Files.fetch (i-1) == info)
104
 
        _Files.remove (i-1);
105
 
  } else 
106
 
    return; // Unknown!
107
 
}
108
 
 
109
 
CFunctionInfo *CClassDatabase::BuiltinOperator (const char *name, int tok,
110
 
  CTypeInfo *rtype, CTypeInfo *t0, CTypeInfo *t1) {
111
 
  CFunctionInfo *info;
112
 
  CTypeList *args;
113
 
  CTypeInfo *type;
114
 
    
115
 
  // first check if this built-in operator already exists ...
116
 
  multimap<int,CFunctionInfo*>::iterator iter, lower, upper;
117
 
  lower = _builtin_ops.lower_bound (tok);
118
 
  upper = _builtin_ops.upper_bound (tok);
119
 
  // check all exisiting operators with the right token type
120
 
  for (iter = lower; iter != upper; ++iter) {
121
 
    info = iter->second;
122
 
    args = info->TypeInfo ()->ArgTypes ();
123
 
    // same number of arguments?
124
 
    if (args->Entries () == (unsigned)((t0?1:0) + (t1?1:0))) {
125
 
      // same parameter type list
126
 
      if ((t0 ? *t0 == *args->Entry (0) : true) &&
127
 
          (t1 ? *t1 == *args->Entry (1) : true)) {
128
 
        if (t0) CTypeInfo::Destroy (t0);
129
 
        if (t1) CTypeInfo::Destroy (t1);
130
 
        if (rtype) CTypeInfo::Destroy (rtype);
131
 
        return info; // operator already exists
132
 
      }
133
 
    }
134
 
  }
135
 
  
136
 
  // the operator object has to be created ...
137
 
    // return type
138
 
  if (! rtype)
139
 
    rtype = &CTYPE_UNDEFINED;
140
 
 
141
 
  // parameter type list
142
 
  args = new CTypeList ((t0?1:0)+(t1?1:0));
143
 
  if (t0) args->AddEntry (t0);
144
 
  if (t1) args->AddEntry (t1);
145
 
  
146
 
  // operator function type
147
 
  type = new CTypeFunction (rtype, args, true);
148
 
 
149
 
  // operator function
150
 
  info = new CFunctionInfo;
151
 
  info->Name (name);
152
 
  info->isOperator (true);
153
 
  info->ObjectInfo ()->TypeInfo (type);
154
 
  type->VirtualType ()->TypeFunction ()->FunctionInfo (info);
155
 
 
156
 
  // create function parameters
157
 
  if (t0) CreateParameter (info, t0);
158
 
  if (t1) CreateParameter (info, t1);
159
 
  
160
 
  // insert the object as a regular object into the class database
161
 
  Insert (info);
162
 
  
163
 
  // insert the object into the map
164
 
  _builtin_ops.insert (multimap<int,CFunctionInfo*>::value_type (tok, info));
165
 
  
166
 
  return info;
167
 
}
168
 
 
169
 
void CClassDatabase::CreateParameter (CFunctionInfo *fi, CTypeInfo *type) const {
170
 
  CArgumentInfo *info;
171
 
  info = fi->newArgument ();
172
 
  info->Name ("<noname>");
173
 
  info->Storage (CStorage::CLASS_AUTOMATIC);
174
 
  info->TypeInfo (type->Duplicate ());
175
 
}
176
 
 
177
 
CObjectInfo *CClassDatabase::ObjectInfo (Token *token) const {
178
 
  unsigned infos = ObjectInfos ();
179
 
  for (unsigned i = 0; i < infos; i++) {
180
 
    CObjectInfo *info = ObjectInfo (i);
181
 
    if (! info->FileInfo ())
182
 
      if (*info->SourceInfo () == token)
183
 
        return info;  
184
 
  }
185
 
  return (CObjectInfo*)0;
186
 
}
187
 
 
188
 
CObjectInfo *CClassDatabase::ObjectInfo (CT_Token *token) const {
189
 
  unsigned infos = ObjectInfos ();
190
 
  for (unsigned i = 0; i < infos; i++) {
191
 
    CObjectInfo *info = ObjectInfo (i);
192
 
    if (! info->FileInfo ())
193
 
      if (*info->SourceInfo () == token)
194
 
        return info;  
195
 
  }
196
 
  return (CObjectInfo*)0;
197
 
}
198
 
 
199
 
CObjectInfo *CClassDatabase::ObjectInfo (unsigned i) const { 
200
 
  if (i < ClassInfos ()) return ClassInfo (i);
201
 
  else i = i - ClassInfos ();
202
 
  if (i < UnionInfos ()) return UnionInfo (i);
203
 
  else i = i - UnionInfos ();
204
 
  if (i < EnumInfos ()) return EnumInfo (i);
205
 
  else i = i - EnumInfos ();
206
 
  if (i < TypedefInfos ()) return TypedefInfo (i);
207
 
  else i = i - TypedefInfos ();
208
 
  if (i < FunctionInfos ()) return FunctionInfo (i);
209
 
  else i = i - FunctionInfos ();
210
 
  if (i < FileInfos ()) return FileInfo (i);
211
 
  return (CObjectInfo*)0; 
212
 
}
213
 
 
214
 
 
215
 
void CClassDatabase::Dump (ostream &out, int level) const {
216
 
  unsigned files = FileInfos ();
217
 
  CStructure *file;
218
 
  int count = 0;
219
 
  
220
 
  for (unsigned i = 0; i < files; i++) {
221
 
    file = FileInfo (i);
222
 
    out << "file " << count++ << " : " << file->Name () << endl;
223
 
    Dump (out, file, 0, level);
224
 
  }
225
 
}
226
 
 
227
 
void CClassDatabase::Dump (ostream &out, CStructure *scope, int ind, int level) const {
228
 
  unsigned num;
229
 
  
230
 
  if (! scope || (ind / 4) > level) 
231
 
    return; 
232
 
  
233
 
  // Template parameter (print on template scope only)
234
 
  num = scope->TemplateParams ();
235
 
  if (num && scope->TemplateInfo ()) {
236
 
    indent (out, ind+2); out << num << " template parameters:" << endl;
237
 
    for (unsigned j = 0; j < num; j++)
238
 
      DumpTemplateParam (out, scope->TemplateParam (j), ind);
239
 
  }
240
 
    
241
 
  // Types
242
 
  num = scope->Types ();
243
 
  if (num) {
244
 
    indent (out, ind+2); out << num << " types:" << endl;
245
 
    for (unsigned j = 0; j < num; j++)
246
 
      DumpType (out, scope->Type (j), ind);
247
 
  }
248
 
    
249
 
  // Namespaces
250
 
  num = scope->Namespaces ();
251
 
  if (num) {
252
 
    indent (out, ind+2); out << num << " namespaces:" << endl;
253
 
    for (unsigned j = 0; j < num; j++) 
254
 
      DumpNamespace (out, scope->Namespace (j), ind);
255
 
  }
256
 
 
257
 
  // Usings
258
 
  num = scope->Usings ();
259
 
  if (num) {
260
 
    indent (out, ind+2); out << num << " usings:" << endl;
261
 
    for (unsigned j = 0; j < num; j++) 
262
 
      DumpUsing (out, scope->Using (j), ind);
263
 
  }
264
 
 
265
 
  // Attributes
266
 
  num = scope->Attributes ();
267
 
  if (num) {
268
 
    indent (out, ind+2); out << num << " attributes: " << endl;
269
 
    for (unsigned j = 0; j < num; j++)
270
 
      DumpAttribute (out, scope->Attribute (j), ind);
271
 
  }
272
 
 
273
 
  // Functions
274
 
  num = scope->Functions ();
275
 
  if (num) {
276
 
    indent (out, ind+2); out << num << " functions:" << endl;
277
 
    for (unsigned j = 0; j < num; j++)
278
 
      DumpFunction (out, scope->Function (j), ind, level);
279
 
  }
280
 
  
281
 
  // Local scopes
282
 
  num = scope->Children ();
283
 
  if (num) {
284
 
    indent (out, ind+2); out << num << " scopes:" << endl;
285
 
    for (unsigned j = 0; j < num; j++) {
286
 
      CStructure *info = scope->Child (j)->Structure ();
287
 
//      if (info && info->Objects () &&
288
 
//          ! (info->FunctionInfo () && ! info->FunctionInfo ()->isFctDef ())) {
289
 
        DumpLocalScope (out, info, ind);
290
 
        Dump (out, info, ind+4, level);
291
 
//      }
292
 
    }
293
 
  }
294
 
}
295
 
 
296
 
void CClassDatabase::DumpLocalScope (ostream &out, CObjectInfo *info, int ind) const {
297
 
  indent (out, ind+4); 
298
 
  if (info->Record () || info->NamespaceInfo () || 
299
 
      info->FunctionInfo () || info->TemplateInfo ()) {
300
 
    if (info->UnionInfo ()) 
301
 
      out << "union";
302
 
    else if (info->ClassInfo ()) 
303
 
      out << (info->ClassInfo ()->isStruct () ? "struct" : "class");
304
 
    else if (info->NamespaceInfo ())
305
 
      out << "namespace";
306
 
    else if (info->FunctionInfo ())
307
 
      out << "function";
308
 
    else if (info->TemplateInfo ())
309
 
      out << "template";
310
 
    out << " : " << info->Name ();
311
 
  } else 
312
 
    out << "block";
313
 
  out << "\t";
314
 
  if (info->ClassInfo ()) {
315
 
    unsigned base_classes = info->ClassInfo ()->BaseClasses ();
316
 
    if (base_classes) {
317
 
      out << "[base classes: ";
318
 
      for (unsigned i = 0; i < base_classes; i++) {
319
 
        CClassInfo *cinfo = info->ClassInfo ()->BaseClass (i)->Class ();
320
 
        if (cinfo && cinfo->TypeInfo ()) {
321
 
          cinfo->TypeInfo ()->TypeText (out);
322
 
          if (i+1 < base_classes)
323
 
            out << ",";
324
 
        }
325
 
      }
326
 
      out << "] ";
327
 
    }
328
 
  }
329
 
  DumpQualities (out, info);
330
 
  out << endl;
331
 
}
332
 
 
333
 
void CClassDatabase::DumpFunction (ostream &out, CFunctionInfo *info, int ind, int level) const {
334
 
//  CArgumentInfo* arg;
335
 
//  unsigned num;
336
 
  
337
 
  indent (out, ind+4); 
338
 
  out << info->Name () << "\t (type: ";
339
 
  info->TypeInfo ()->TypeText (out);
340
 
  out << ") ";
341
 
 
342
 
  if (info->ObjectInfo()->QualifiedScope () && info->ObjectInfo()->QualifiedScope () != info->Scope ()) {
343
 
    out << " [member of ";
344
 
    DumpScopeName (out, info->ObjectInfo()->QualifiedScope ());
345
 
    out << "]";
346
 
  }
347
 
  if (info->isDestructor ()) 
348
 
    out << " [destructor]";
349
 
  else if (info->isConstructor ()) 
350
 
    out << " [constructor]";
351
 
  if (! info->isDefined () && ! info->isBuiltin ())
352
 
    out << " [undefined]";
353
 
  if (info->isOperator () || info->isConversion ())
354
 
    out << " [operator]";
355
 
 
356
 
  DumpQualities (out, info);
357
 
  out << endl;
358
 
 
359
 
  if (level == 0) 
360
 
    return;
361
 
  
362
 
  // dump function arguments
363
 
//  num = info->Arguments ();
364
 
//  if (num) {
365
 
//    indent (out, ind+6); out << num << " arguments:" << endl;
366
 
//    for (unsigned i = 0; i < num; i++) {
367
 
//      arg = info->Argument (i);
368
 
//      indent (out, ind+8); out << arg->Name () << "\t (type: ";
369
 
//      arg->TypeInfo ()->TypeText (out);
370
 
//      out << ") ";
371
 
//      DumpQualities (out, arg);
372
 
//      out << endl;
373
 
//    }
374
 
//  }
375
 
}
376
 
 
377
 
void CClassDatabase::DumpAttribute (ostream &out, CAttributeInfo *info, int ind) const {
378
 
  indent (out, ind+4); 
379
 
  out << info->Name () << "\t (type: ";
380
 
  info->TypeInfo ()->TypeText (out);
381
 
  out << ") ";
382
 
 
383
 
  if (info->ObjectInfo()->QualifiedScope () && info->ObjectInfo()->QualifiedScope () != info->Scope ()) {
384
 
    out << " [member of ";
385
 
    DumpScopeName (out, info->ObjectInfo()->QualifiedScope ());
386
 
    out << "]";
387
 
  }
388
 
  if (info->TypeInfo ()->isVarArray ()) 
389
 
    out << " [dim: variable]";
390
 
  else if ((info->TypeInfo ()->isArray () || info->TypeInfo ()->isBitField ()) && 
391
 
           info->TypeInfo ()->Dimension () != -1) 
392
 
    out << " [dim: " << info->TypeInfo ()->Dimension () << "]";
393
 
  else if (info->EnumeratorInfo ()) 
394
 
    out << " [value: " << info->EnumeratorInfo ()->Value () << "]";
395
 
 
396
 
  DumpQualities (out, info);
397
 
  out << endl;
398
 
}
399
 
 
400
 
void CClassDatabase::DumpType (ostream &out, CObjectInfo *info, int ind) const {
401
 
  indent (out, ind+4); 
402
 
  if (info->TypedefInfo ()) 
403
 
    out << "typedef ";
404
 
  else if (info->UnionInfo ()) 
405
 
    out << "union ";
406
 
  else if (info->EnumInfo ()) 
407
 
    out << "enum ";
408
 
  else if (info->ClassInfo ())
409
 
    out << (info->ClassInfo ()->isStruct () ? "struct " : "class ");
410
 
  out << ": " << info->Name () << "\t";
411
 
  if (info->EnumInfo ()) {
412
 
    out << " (underlying type: ";
413
 
    info->EnumInfo ()->TypeInfo ()->UnderlyingType ()->TypeText (out);
414
 
    out << ") ";
415
 
  } else if (info->TypedefInfo ()) {
416
 
    out << " (type: ";
417
 
    info->TypeInfo ()->TypeText (out);
418
 
    out << ") ";
419
 
  } else if (info->ClassInfo ()) {
420
 
    unsigned base_classes = info->ClassInfo ()->BaseClasses ();
421
 
    if (base_classes) {
422
 
      out << "[base classes: ";
423
 
      for (unsigned i = 0; i < base_classes; i++) {
424
 
        CClassInfo *cinfo = info->ClassInfo ()->BaseClass (i)->Class ();
425
 
        if (cinfo && cinfo->TypeInfo ()) {
426
 
          cinfo->TypeInfo ()->TypeText (out);
427
 
          if (i+1 < base_classes)
428
 
            out << ",";
429
 
        }
430
 
      }
431
 
      out << "] ";
432
 
    }
433
 
  }
434
 
  DumpQualities (out, info);
435
 
  out << endl;
436
 
}
437
 
 
438
 
void CClassDatabase::DumpTemplateParam (ostream &out, CTemplateParamInfo *info, int ind) const {
439
 
  indent (out, ind+4); 
440
 
  out << info->Name () << "\t";
441
 
  if (info->isTemplate ()) 
442
 
    out << " [template] ";
443
 
  else if (info->isTypeParam ()) 
444
 
    out << " [type] ";
445
 
  else 
446
 
    out << " [non-type] ";
447
 
  out << endl;
448
 
}
449
 
 
450
 
void CClassDatabase::DumpNamespace (ostream &out, CNamespaceInfo *info, int ind) const {
451
 
  CNamespaceInfo *nsinfo;
452
 
  indent (out, ind+4); 
453
 
  out << "namespace : " << info->Name () << "\t";
454
 
  if (info->isAlias ()) {
455
 
    nsinfo = info;
456
 
    while (nsinfo->isAlias ()) {
457
 
      nsinfo = (CNamespaceInfo*)nsinfo->NextObject ();
458
 
      if (nsinfo == info) // should never be true
459
 
        break;
460
 
    }
461
 
    out << " [alias of ";
462
 
    DumpScopeName (out, nsinfo);
463
 
    out << "]";
464
 
  }
465
 
  DumpQualities (out, info);
466
 
  out << endl;
467
 
}
468
 
 
469
 
void CClassDatabase::DumpUsing (ostream &out, CUsingInfo *info, int ind) const {
470
 
  CNamespaceInfo *nsinfo = info->Namespace ();
471
 
  indent (out, ind+4); 
472
 
  out << "using namespace " << ": ";
473
 
  DumpScopeName (out, nsinfo);
474
 
  out << endl;
475
 
}
476
 
 
477
 
void CClassDatabase::DumpQualities (ostream &out, CObjectInfo *info) const {
478
 
  if (info->isTemplate ())
479
 
    out << " [template]";
480
 
  if (info->TemplateInfo () && ! info->TemplateInfo ()->isBaseTemplate ())
481
 
    out << " [specialization of " << (void*)info->TemplateInfo ()->BaseTemplate () << "]";
482
 
  if (info->NamespaceInfo () && info->Name () && *info->Name ().c_str() == '%')
483
 
    out << " [instance scope]";
484
 
  if (info->isTemplateInstance ()) {
485
 
    if (info->TemplateInstance ()->isPseudoInstance ())
486
 
      out << " [pseudo instance]";
487
 
    else
488
 
      out << " [instance of " 
489
 
          << (void*)info->TemplateInstance ()->Template () << "]";
490
 
  }
491
 
 
492
 
  // dump member access level
493
 
  if (info->Protection () == CProtection::PROT_PROTECTED) 
494
 
    out << " [protected]";
495
 
  else if (info->Protection () == CProtection::PROT_PRIVATE) 
496
 
    out << " [private]";
497
 
//  else if (info->Protection () == CProtection::PROT_PUBLIC) 
498
 
//    out << " [public]";
499
 
 
500
 
  // dump linkage 
501
 
  if (! (info->Language () == CLanguage::LANG_UNDEFINED)) 
502
 
    out << " [language: " << info->Language ().Text () << "]";
503
 
 
504
 
  // dump type qualities
505
 
  if (info->TypeInfo () && info->TypeInfo ()->isVolatile ()) 
506
 
    out << " [volatile]";
507
 
  if (info->TypeInfo () && info->TypeInfo ()->isConst ()) 
508
 
    out << " [const]";
509
 
 
510
 
  if (info->isBuiltin ())
511
 
    out << " [builtin]";
512
 
  if (info->isInline ()) 
513
 
    out << " [inline]";
514
 
  if (info->isAnonymous ()) 
515
 
    out << " [anonymous]";
516
 
 
517
 
  if (info->isVirtual ()) 
518
 
    out << " [virtual]";
519
 
  if (info->isStatic ()) 
520
 
    out << " [static]";
521
 
  if (info->isExtern ()) 
522
 
    out << " [extern]";
523
 
  if (info->isMutable ()) 
524
 
    out << " [mutable]";
525
 
  if (info->isRegister ()) 
526
 
    out << " [register]";
527
 
 
528
 
  // dump storage class
529
 
  if (info->Storage () == CStorage::CLASS_DYNAMIC) 
530
 
    out << " [dynamic]";
531
 
//  else if (info->Storage () == CStorage::CLASS_STATIC) 
532
 
//    out << " [static]";
533
 
//  else if (info->Storage () == CStorage::CLASS_AUTOMATIC) 
534
 
//    out << " [automatic]";
535
 
 
536
 
  // dump address
537
 
  out << " [" << (void*)info << "]";
538
 
  // dump next linked object
539
 
  if (info->NextObject () != info)
540
 
    out << " [next: " << (void*)info->NextObject () << "]";
541
 
}
542
 
 
543
 
void CClassDatabase::DumpScopeName (ostream &out, CStructure *scope) const {
544
 
  if (scope->FileInfo ())
545
 
    return;
546
 
 
547
 
  CStructure *parent = scope->Parent ()->Structure ();
548
 
  if (parent->isRecord () || parent->isNamespace ()) {
549
 
    DumpScopeName (out, parent);
550
 
    out << "::" << scope->Name ();
551
 
  } else
552
 
    out << scope->Name ();
553
 
}
554
 
 
555
 
void CClassDatabase::indent (ostream &out, int ind) const {
556
 
  for (int i = 0; i < ind; i++)
557
 
    out << " ";
558
 
}
559
 
 
560
 
} // namespace Puma