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

« back to all changes in this revision

Viewing changes to Puma/gen-release/step2/src/CCInstantiation.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:
32
32
#include "Puma/CCParser.h"
33
33
#include "Puma/TokenStream.h"
34
34
#include "Puma/UnitManager.h"
35
 
#include "Puma/CClassDatabase.h"
 
35
#include "Puma/CSemDatabase.h"
36
36
#include "Puma/PreMacroManager.h"
37
37
#include "Puma/CTranslationUnit.h"
38
38
#include "Puma/PreprocessorParser.h"
110
110
  current_scope = cs;
111
111
  
112
112
// TEMPORARY HACK --->
113
 
  if (! ObjectInfo ()->ClassDB ()->Project ()->config ().Option ("--real-instances")) 
 
113
  if (! ObjectInfo ()->SemDB ()->Project ()->config ().Option ("--real-instances")) 
114
114
    real_inst = false;
115
115
// TEMPORARY HACK <---
116
116
 
354
354
 
355
355
 
356
356
void CCInstantiation::createPseudoInstance () {
357
 
  CTemplateInstance *ti;
 
357
  CTemplateInstance *ti = 0;
358
358
  if (ObjectInfo ()->FunctionInfo ()) {
359
359
    instance = makeScope ()->newFunction (true);
360
360
    ti = instance->TemplateInstance ();
372
372
    instance->TemplateParamInfo ()->TemplateTemplate (ObjectInfo ()->TemplateParamInfo ()->TemplateTemplate ());
373
373
    ObjectInfo ()->NextObject (instance);
374
374
    ti = instance->TemplateParamInfo ()->TemplateInstance ();
 
375
  } else {
 
376
    return; // unsupported object type
375
377
  }
376
378
  instance->Name (ObjectInfo ()->Name ());  
377
 
  instance->ClassDB (ObjectInfo ()->ClassDB ());
 
379
  instance->SemDB (ObjectInfo ()->SemDB ());
378
380
  instance->SourceInfo ()->FileInfo (ObjectInfo ()->SourceInfo ()->FileInfo ());
379
381
  instance->SourceInfo ()->StartToken (PointOfInstantiation ()->token_node ());
380
382
  instance->TypeInfo (ObjectInfo ()->TypeInfo ()->Duplicate ());
409
411
 
410
412
  scope = makeScope ();
411
413
  fct_inst = (ObjectInfo ()->FunctionInfo ());
412
 
  project = ObjectInfo ()->ClassDB ()->Project ();
 
414
  project = ObjectInfo ()->SemDB ()->Project ();
413
415
  unit = new CUnit (err);
414
416
  unit->name (scope->Name ());
415
417
 
430
432
  cpp.stream (&stream);
431
433
  cpp.configure (project->config (), false); // do not process --include option
432
434
  // initialize semantic analyzer
433
 
  p.semantic ().init (*ObjectInfo ()->ClassDB (),
 
435
  p.semantic ().init (*ObjectInfo ()->SemDB (),
434
436
    *ObjectInfo ()->SourceInfo ()->FileInfo ()->Primary (), 
435
437
    scope, fct_inst, ! fct_inst, this);   
436
438
  ((ErrorCollector&)p.builder ().err ()).index (0);
549
551
        unit << " = ";
550
552
        copyTree (unit, arg->TemplateArg ());
551
553
      } else if (arg->Value ()) {
552
 
        unit << " = ";
553
 
        if (arg->Value ()->isSigned ())
554
 
          unit << arg->Value ()->convert_to_int ();
555
 
        else if (arg->Value ()->isUnsigned ())
556
 
          unit << arg->Value ()->convert_to_uint ();
557
 
        else 
558
 
          unit << arg->Value ()->convert_to_float ();        
 
554
        unit << " = " << *(arg->Value ());
559
555
      }
560
556
      unit << ";\n" << endu;
561
557
    }
693
689
  scope->NamespaceInfo ()->aroundInstantiation (true);
694
690
  scope->Name (sname.str ().c_str ());
695
691
  scope->TypeInfo (&CTYPE_UNDEFINED);
696
 
  scope->ClassDB (ObjectInfo ()->ClassDB ());
 
692
  scope->SemDB (ObjectInfo ()->SemDB ());
697
693
  scope->SourceInfo ()->FileInfo (ObjectInfo ()->SourceInfo ()->FileInfo ());
698
694
  scope->SourceInfo ()->StartToken (PointOfInstantiation ()->token_node ());
699
695
  return scope;
719
715
  if (arg->Type ()) {
720
716
    arg->Type ()->TypeText (out);
721
717
  } else if (arg->Value ()) {
722
 
    if (arg->Value ()->isSigned ())
723
 
      out << arg->Value ()->convert_to_int ();
724
 
    else if (arg->Value ()->isUnsigned ())
725
 
      out << arg->Value ()->convert_to_uint ();
726
 
    else 
727
 
      out << arg->Value ()->convert_to_float ();
 
718
    out << *(arg->Value ());
728
719
  } else {
729
720
    return false;
730
721
  }