#include "common.h" TypeDef::TypeDef( const string &newName, const string &baseName ): newName( newName ), baseName( baseName ) { if( !Type::StringToType( baseName, baseType ) ){ SetError(3, baseName, cp ); return; } } TypeDef::~TypeDef(){ } TypeDefCollection::TypeDefCollection(){ } TypeDefCollection::~TypeDefCollection(){ } void TypeDefCollection::Add( const string &newName, const string &baseName ){ TypeDef typeDef( newName, baseName ); this->push_back( typeDef ); /* TODO: 消す1 //////////////////////// // 循環参照をチェック //////////////////////// int i; string tempName = newName; while(1){ i=GetIndex( tempName ); if(i==-1) break; if( (*this)[i].baseName == newName ){ //循環エラー extern int cp; SetError(124,NULL,cp); //不明な型として、Long型を指定しておく (*this)[i].baseName = "Long"; break; } tempName = (*this)[i].baseName; }*/ } int TypeDefCollection::GetIndex( const string &typeName ) const{ int max = (*this).size(); for( int i=0; i