Changeset 523 in dev for trunk/ab5.0/abdev/BasicCompiler_Common/src
- Timestamp:
- May 1, 2008, 11:03:14 PM (17 years ago)
- Location:
- trunk/ab5.0/abdev/BasicCompiler_Common/src
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/BasicCompiler_Common/src/BoostSerializationSupport.cpp
r522 r523 53 53 MessageBox( NULL, msg, "XMLシリアライズの例外", MB_OK ); 54 54 } 55 template<class T_xml_schema> bool BoostSerializationSupport<T_xml_schema>::ReadXml( istream& ifs, bool isShowExceptionMessage )55 template<class T_xml_schema> bool BoostSerializationSupport<T_xml_schema>::ReadXml( std::istream& ifs, bool isShowExceptionMessage ) 56 56 { 57 57 bool isSuccessful = false; … … 86 86 return true; 87 87 } 88 template<class T_xml_schema> bool BoostSerializationSupport<T_xml_schema>::WriteXml( ostream& ofs, bool isShowExceptionMessage ) const88 template<class T_xml_schema> bool BoostSerializationSupport<T_xml_schema>::WriteXml( std::ostream& ofs, bool isShowExceptionMessage ) const 89 89 { 90 90 bool isSuccessful = false; … … 119 119 return true; 120 120 } 121 template<class T_xml_schema> bool BoostSerializationSupport<T_xml_schema>::ReadXml( const st ring &xmlFilePath, bool isShowExceptionMessage )121 template<class T_xml_schema> bool BoostSerializationSupport<T_xml_schema>::ReadXml( const std::string &xmlFilePath, bool isShowExceptionMessage ) 122 122 { 123 123 // 入力アーカイブの作成 … … 131 131 return result; 132 132 } 133 template<class T_xml_schema> bool BoostSerializationSupport<T_xml_schema>::WriteXml( const st ring &xmlFilePath, bool isShowExceptionMessage ) const133 template<class T_xml_schema> bool BoostSerializationSupport<T_xml_schema>::WriteXml( const std::string &xmlFilePath, bool isShowExceptionMessage ) const 134 134 { 135 135 // 出力アーカイブの作成 … … 201 201 } 202 202 203 template<class T_xml_schema> bool BoostSerializationSupport<T_xml_schema>::ReadBinaryFile( const st ring &filePath, bool isShowExceptionMessage )204 { 205 // 入力アーカイブの作成 206 std::ifstream ifs( filePath.c_str(), ios::in |ios::binary );203 template<class T_xml_schema> bool BoostSerializationSupport<T_xml_schema>::ReadBinaryFile( const std::string &filePath, bool isShowExceptionMessage ) 204 { 205 // 入力アーカイブの作成 206 std::ifstream ifs( filePath.c_str(), std::ios::in | std::ios::binary ); 207 207 208 208 bool isSuccessful = false; … … 239 239 return true; 240 240 } 241 template<class T_xml_schema> bool BoostSerializationSupport<T_xml_schema>::WriteBinaryFile( const st ring &filePath, bool isShowExceptionMessage ) const241 template<class T_xml_schema> bool BoostSerializationSupport<T_xml_schema>::WriteBinaryFile( const std::string &filePath, bool isShowExceptionMessage ) const 242 242 { 243 243 // 出力アーカイブの作成 244 std::ofstream ofs( filePath.c_str(), ios::out |ios::binary );244 std::ofstream ofs( filePath.c_str(), std::ios::out | std::ios::binary ); 245 245 246 246 bool isSuccessful = false; … … 283 283 284 284 // 入力アーカイブの作成 285 std::istringstream iss( binaryString, ios::in |ios::binary );285 std::istringstream iss( binaryString, std::ios::in | std::ios::binary ); 286 286 287 287 try{ … … 306 306 { 307 307 // 出力アーカイブの作成 308 std::ostringstream oss( "", ios::out |ios::binary );308 std::ostringstream oss( "", std::ios::out | std::ios::binary ); 309 309 310 310 bool isSuccessful = false; … … 332 332 /* 333 333 ビルドに時間がかかるので外しておく 334 template<class T_xml_schema> bool BoostSerializationSupport<T_xml_schema>::ReadText( const st ring &filePath, bool isShowExceptionMessage )334 template<class T_xml_schema> bool BoostSerializationSupport<T_xml_schema>::ReadText( const std::string &filePath, bool isShowExceptionMessage ) 335 335 { 336 336 // 入力アーカイブの作成 … … 370 370 return true; 371 371 } 372 template<class T_xml_schema> bool BoostSerializationSupport<T_xml_schema>::WriteText( const st ring &filePath, bool isShowExceptionMessage ) const372 template<class T_xml_schema> bool BoostSerializationSupport<T_xml_schema>::WriteText( const std::string &filePath, bool isShowExceptionMessage ) const 373 373 { 374 374 // 出力アーカイブの作成 -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Class.cpp
r513 r523 1099 1099 } 1100 1100 1101 const CClass *Classes::Find( const NamespaceScopes &namespaceScopes, const st ring &name ) const1101 const CClass *Classes::Find( const NamespaceScopes &namespaceScopes, const std::string &name ) const 1102 1102 { 1103 1103 if( namespaceScopes.size() == 0 && name == "Object" ){ … … 1145 1145 return NULL; 1146 1146 } 1147 const CClass *Classes::Find( const st ring &fullName ) const1147 const CClass *Classes::Find( const std::string &fullName ) const 1148 1148 { 1149 1149 char AreaName[VN_SIZE] = ""; //オブジェクト変数 -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Compiler.cpp
r465 r523 15 15 } 16 16 17 bool Compiler::StringToType( const st ring &typeName, Type &type ){17 bool Compiler::StringToType( const std::string &typeName, Type &type ){ 18 18 type.SetIndex( -1 ); 19 19 … … 85 85 } 86 86 87 const st ring &nextTypeName = typeName.substr( 1 );87 const std::string &nextTypeName = typeName.substr( 1 ); 88 88 89 89 if( !StringToType( nextTypeName, type ) ){ … … 166 166 } 167 167 168 const st ring Compiler::TypeToString( const Type &type )168 const std::string Compiler::TypeToString( const Type &type ) 169 169 { 170 170 if( PTR_LEVEL( type.GetBasicType() ) ){ … … 173 173 tempType.PtrLevelDown(); 174 174 175 return (st ring)"*" + TypeToString( tempType );175 return (std::string)"*" + TypeToString( tempType ); 176 176 } 177 177 else if( type.IsObject() || type.IsStruct() ){ … … 202 202 if( lpszTypeName ) 203 203 { 204 return (const st ring)lpszTypeName;204 return (const std::string)lpszTypeName; 205 205 } 206 206 } … … 208 208 compiler.errorMessenger.Output(1, NULL, cp); 209 209 210 return (st ring)"(null)";210 return (std::string)"(null)"; 211 211 } -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Const.cpp
r509 r523 49 49 } 50 50 51 void Consts::Add( const NamespaceScopes &namespaceScopes, const st ring &name , char *Expression)51 void Consts::Add( const NamespaceScopes &namespaceScopes, const std::string &name , char *Expression) 52 52 { 53 53 _int64 i64data; … … 67 67 Put( newconst ); 68 68 } 69 void Consts::Add(const NamespaceScopes &namespaceScopes, const st ring &name, int value){69 void Consts::Add(const NamespaceScopes &namespaceScopes, const std::string &name, int value){ 70 70 CConst *newconst = new CConst( namespaceScopes, name, value); 71 71 … … 74 74 } 75 75 76 CConst *Consts::GetObjectPtr( const st ring &name ){76 CConst *Consts::GetObjectPtr( const std::string &name ){ 77 77 char ObjName[VN_SIZE]; //オブジェクト変数 78 78 char NestMember[VN_SIZE]; //入れ子メンバ -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Delegate.cpp
r477 r523 214 214 values.insert( std::map<std::string,std::string>::value_type( 215 215 "#call_method_begin#", 216 (st ring)"Function Call(" + dg.paramStr + ") As " + dg.returnTypeName216 (std::string)"Function Call(" + dg.paramStr + ") As " + dg.returnTypeName 217 217 ) ); 218 218 … … 228 228 values.insert( std::map<std::string,std::string>::value_type( 229 229 "#call_method_begin#", 230 (st ring)"Sub Call(" + dg.paramStr + ")"230 (std::string)"Sub Call(" + dg.paramStr + ")" 231 231 ) ); 232 232 … … 244 244 } 245 245 /* 246 ofstream ofs( ( Jenga::Common::Environment::GetAppDir() + "\\generated_delegate_code.log" ).c_str() );246 std::ofstream ofs( ( Jenga::Common::Environment::GetAppDir() + "\\generated_delegate_code.log" ).c_str() ); 247 247 ofs << destSource; 248 248 ofs.close(); -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Enum.cpp
r465 r523 170 170 BOOST_FOREACH( const EnumInfo &enumInfo, thisEnumInfoCollection ) 171 171 { 172 BOOST_FOREACH( const st ring &namespaceStr, enumInfo.GetNamespaceScopes() ){172 BOOST_FOREACH( const std::string &namespaceStr, enumInfo.GetNamespaceScopes() ){ 173 173 sprintf(buffer+length,"Namespace %s\n",namespaceStr.c_str()); 174 174 length+=lstrlen(buffer+length); … … 214 214 length+=lstrlen(buffer+length); 215 215 216 BOOST_FOREACH( const st ring &namespaceStr, enumInfo.GetNamespaceScopes() ){216 BOOST_FOREACH( const std::string &namespaceStr, enumInfo.GetNamespaceScopes() ){ 217 217 lstrcpy( buffer+length, "End Namespace\n" ); 218 218 length+=lstrlen(buffer+length); … … 230 230 // ログを生成 231 231 Jenga::Common::Logger logger( Jenga::Common::Environment::GetAppDir() + "\\enum_generated.log", false ); 232 logger << buffer << endl;232 logger << buffer << std::endl; 233 233 #endif 234 234 -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Messenger.cpp
r502 r523 25 25 26 26 // 標準出力 27 std::cout << message << endl;27 std::cout << message << std::endl; 28 28 } 29 29 int Messenger::GetNextErrorLine() -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Method.cpp
r465 r523 103 103 return false; 104 104 } 105 void Methods::Enum( const char *methodName, vector<const UserProc *> &subs ) const105 void Methods::Enum( const char *methodName, std::vector<const UserProc *> &subs ) const 106 106 { 107 107 //オブジェクトのメンバ関数の場合 … … 114 114 } 115 115 } 116 void Methods::Enum( BYTE idOperatorCalc, vector<const UserProc *> &subs ) const116 void Methods::Enum( BYTE idOperatorCalc, std::vector<const UserProc *> &subs ) const 117 117 { 118 118 //オブジェクトのメンバ関数の場合 -
trunk/ab5.0/abdev/BasicCompiler_Common/src/ObjectModule.cpp
r522 r523 48 48 #include <boost/serialization/version.hpp> 49 49 #include <boost/serialization/is_abstract.hpp> 50 #include <boost/serialization/serialization.hpp> 51 #include <boost/serialization/nvp.hpp> 52 #include <boost/serialization/export.hpp> 50 53 51 54 #include <jenga/include/jenga.h> … … 113 116 boost::archive::xml_iarchive ia(ifs); 114 117 #else 115 std::ifstream ifs( filePath.c_str(), ios::in |ios::binary );118 std::ifstream ifs( filePath.c_str(), std::ios::in | std::ios::binary ); 116 119 boost::archive::binary_iarchive ia(ifs); 117 120 #endif … … 146 149 boost::archive::xml_oarchive oa(ofs); 147 150 #else 148 std::ofstream ofs( filePath.c_str(), ios::out |ios::binary );151 std::ofstream ofs( filePath.c_str(), std::ios::out | std::ios::binary ); 149 152 boost::archive::binary_oarchive oa(ofs); 150 153 #endif … … 181 184 boost::archive::xml_iarchive ia(iss); 182 185 #else 183 std::istringstream iss( str, ios::in |ios::binary );186 std::istringstream iss( str, std::ios::in | std::ios::binary ); 184 187 boost::archive::binary_iarchive ia(iss); 185 188 #endif … … 215 218 boost::archive::xml_oarchive oa(oss); 216 219 #else 217 std::ostringstream oss( "", ios::out |ios::binary );220 std::ostringstream oss( "", std::ios::out | std::ios::binary ); 218 221 boost::archive::binary_oarchive oa(oss); 219 222 #endif -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Procedure.cpp
r511 r523 458 458 if( this->pParentClass && isStatic == false ){ 459 459 //オブジェクトメンバの場合は、第一パラメータを_System_LocalThis引き渡し用として利用 460 st ring name = "_System_LocalThis";460 std::string name = "_System_LocalThis"; 461 461 Type type( DEF_PTR_VOID ); 462 462 this->realParams.push_back( new Parameter( name, type ) ); … … 467 467 //※第一パラメータ(Thisポインタありの場合は第二パラメータ)を戻り値用の参照宣言にする 468 468 469 st ring name = this->GetName();469 std::string name = this->GetName(); 470 470 if(name[0]==1&&name[1]==ESC_OPERATOR){ 471 471 name="_System_ReturnValue"; … … 1004 1004 } 1005 1005 1006 int ProcPointers::Add( const st ring &typeExpression )1006 int ProcPointers::Add( const std::string &typeExpression ) 1007 1007 { 1008 1008 DWORD dwProcType = (DWORD)typeExpression[2]; 1009 const st ring ¶mStr = typeExpression.substr( 3 );1009 const std::string ¶mStr = typeExpression.substr( 3 ); 1010 1010 1011 1011 Procedure::Kind kind = Procedure::Sub; -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Source.cpp
r519 r523 1 1 #include "stdafx.h" 2 2 3 const st ring BasicSource::generateDirectiveName = "#generate";3 const std::string BasicSource::generateDirectiveName = "#generate"; 4 4 5 5 6 6 class CDefine{ 7 vector<string> names;7 std::vector<std::string> names; 8 8 public: 9 9 CDefine( int majorVer ); … … 138 138 } 139 139 BOOL CDefine::undef(char *name){ 140 vector<string>::iterator i = names.begin();141 BOOST_FOREACH( const st ring &temp, names ){140 std::vector<std::string>::iterator i = names.begin(); 141 BOOST_FOREACH( const std::string &temp, names ){ 142 142 if( temp == name ){ 143 143 names.erase( i ); … … 152 152 153 153 //重複チェック 154 BOOST_FOREACH( const st ring &temp, names ){154 BOOST_FOREACH( const std::string &temp, names ){ 155 155 if( temp == name ){ 156 156 return 1; … … 390 390 391 391 392 bool Text::ReadFile( const st ring &filePath ){392 bool Text::ReadFile( const std::string &filePath ){ 393 393 //ファイルオープン 394 394 HANDLE hFile=CreateFile(filePath.c_str(),GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); … … 519 519 } 520 520 521 bool BasicSource::ReadFile_InIncludeDirective( const st ring &filePath ){521 bool BasicSource::ReadFile_InIncludeDirective( const std::string &filePath ){ 522 522 if( !Text::ReadFile( filePath ) ){ 523 523 return false; … … 854 854 } 855 855 856 bool BasicSource::ReadFile( const st ring &filePath ){856 bool BasicSource::ReadFile( const std::string &filePath ){ 857 857 if( !Text::ReadFile( filePath ) ){ 858 858 return false; … … 902 902 } 903 903 904 bool BasicSource::Generate( const st ring &genName, const char *genBuffer ){904 bool BasicSource::Generate( const std::string &genName, const char *genBuffer ){ 905 905 const int genBufferLength = lstrlen( genBuffer ); 906 906 -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Type.cpp
r465 r523 2 2 3 3 #include <Class.h> 4 5 using namespace std;6 4 7 5 const int Type::basicTypeList[] = { … … 27 25 }; 28 26 29 const st ring Type::basicTypeNameList[] = {27 const std::string Type::basicTypeNameList[] = { 30 28 "Byte", 31 29 "SByte", … … 53 51 } 54 52 55 bool Type::StringToBasicType( const st ring &typeName, int &basicType ){53 bool Type::StringToBasicType( const std::string &typeName, int &basicType ){ 56 54 for( int i=0; ; i++ ){ 57 55 if( basicTypeList[i] == DEF_NON ){ … … 615 613 616 614 617 const st ring BlittableType::GetCreateStaticMethodFullName() const615 const std::string BlittableType::GetCreateStaticMethodFullName() const 618 616 { 619 617 return pClass->GetNamespaceScopes().ToString() + "." + pClass->GetName() + "._Create"; -
trunk/ab5.0/abdev/BasicCompiler_Common/src/TypeDef.cpp
r507 r523 4 4 #include <Compiler.h> 5 5 6 TypeDef::TypeDef( const NamespaceScopes &namespaceScopes, const st ring &name, conststring &baseName, int nowLine )6 TypeDef::TypeDef( const NamespaceScopes &namespaceScopes, const std::string &name, const std::string &baseName, int nowLine ) 7 7 : Symbol( namespaceScopes, name ) 8 8 , baseName( baseName ) … … 14 14 } 15 15 /* 16 bool TypeDef::IsEqualSymbol( const NamespaceScopes &namespaceScopes, const st ring &name ) const16 bool TypeDef::IsEqualSymbol( const NamespaceScopes &namespaceScopes, const std::string &name ) const 17 17 { 18 18 if( GetName() != name ){ … … 21 21 return compiler.GetNamespaceSupporter().IsSameAreaNamespace( this->namespaceScopes, namespaceScopes ); 22 22 } 23 bool TypeDef::IsEqualSymbol( const st ring &fullName ) const23 bool TypeDef::IsEqualSymbol( const std::string &fullName ) const 24 24 { 25 25 char AreaName[VN_SIZE] = ""; //オブジェクト変数 … … 52 52 TypeDefCollection::~TypeDefCollection(){ 53 53 } 54 void TypeDefCollection::Add( const NamespaceScopes &namespaceScopes, const st ring &name, conststring &baseName, int nowLine ){54 void TypeDefCollection::Add( const NamespaceScopes &namespaceScopes, const std::string &name, const std::string &baseName, int nowLine ){ 55 55 TypeDef typeDef( namespaceScopes, name, baseName, nowLine ); 56 56 this->push_back( typeDef ); 57 57 } 58 int TypeDefCollection::GetIndex( const NamespaceScopes &namespaceScopes, const st ring &name ) const{58 int TypeDefCollection::GetIndex( const NamespaceScopes &namespaceScopes, const std::string &name ) const{ 59 59 int max = (int)(*this).size(); 60 60 for( int i=0; i<max; i++ ){ … … 65 65 return -1; 66 66 } 67 int TypeDefCollection::GetIndex( const st ring &fullName ) const{67 int TypeDefCollection::GetIndex( const std::string &fullName ) const{ 68 68 char AreaName[VN_SIZE] = ""; //オブジェクト変数 69 69 char NestName[VN_SIZE] = ""; //入れ子メンバ … … 73 73 } 74 74 75 void TypeDefCollection::Add( const NamespaceScopes &namespaceScopes, const st ring &expression, int nowLine ){75 void TypeDefCollection::Add( const NamespaceScopes &namespaceScopes, const std::string &expression, int nowLine ){ 76 76 int i; 77 77 char temporary[VN_SIZE]; -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Variable.cpp
r511 r523 4 4 #include <Variable.h> 5 5 6 Variable::Variable( const st ring &name, const Type &type, bool isConst, bool isRef, const std::string ¶mStrForConstructor, bool hasInitData )6 Variable::Variable( const std::string &name, const Type &type, bool isConst, bool isRef, const std::string ¶mStrForConstructor, bool hasInitData ) 7 7 : Symbol( ActiveBasic::Compiler::LexicalAnalyzer::FullNameToSymbol( name ) ) 8 8 , type( type ) … … 15 15 { 16 16 } 17 Variable::Variable( const NamespaceScopes &namespaceScopes, const st ring &name, const Type &type, bool isConst, bool isRef, const std::string ¶mStrForConstructor, bool hasInitData )17 Variable::Variable( const NamespaceScopes &namespaceScopes, const std::string &name, const Type &type, bool isConst, bool isRef, const std::string ¶mStrForConstructor, bool hasInitData ) 18 18 : Symbol( namespaceScopes, name ) 19 19 , type( type )
Note:
See TracChangeset
for help on using the changeset viewer.