00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "comma/ast/Homonym.h"
00010
00011 using namespace comma;
00012
00013
00014 Homonym::VisibilitySet *Homonym::getOrCreateVisibilitySet()
00015 {
00016 if (!isLoaded()) {
00017
00018 VisibilitySet *set = new VisibilitySet();
00019 Decl *currentDecl;
00020
00021 switch (rep.getInt()) {
00022
00023 default:
00024 assert(false && "Bad type of homonym!");
00025 break;
00026
00027 case HOMONYM_DIRECT:
00028 currentDecl = asDeclaration();
00029 set->directDecls.push_back(currentDecl);
00030 break;
00031
00032 case HOMONYM_IMPORT:
00033 currentDecl = asDeclaration();
00034 set->importDecls.push_back(currentDecl);
00035 break;
00036
00037 case HOMONYM_EMPTY:
00038 break;
00039 }
00040 rep.setPointer(set);
00041 rep.setInt(HOMONYM_LOADED);
00042 }
00043 return asVisibilitySet();
00044 }