Changeset 325 in dev for trunk/abdev/BasicCompiler_Common/src
- Timestamp:
- Sep 25, 2007, 8:56:38 AM (17 years ago)
- Location:
- trunk/abdev/BasicCompiler_Common/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/src/Class.cpp
r322 r325 589 589 590 590 return 0; 591 } 592 593 const ::Delegate &CClass::GetDelegate() const 594 { 595 const ::Delegate *dg = compiler.GetObjectModule().meta.GetDelegates().GetHashArrayElement( GetName().c_str() ); 596 while( dg ) 597 { 598 if( dg->IsEqualSymbol( GetNamespaceScopes(), GetName() ) ){ 599 //名前空間とクラス名が一致した 600 return *dg; 601 } 602 dg = dg->GetChainNext(); 603 } 604 605 Jenga::Throw( "CClass::GetDelegateメソッドに失敗" ); 606 static ::Delegate dummy; 607 return dummy; 591 608 } 592 609 -
trunk/abdev/BasicCompiler_Common/src/Delegate.cpp
r322 r325 120 120 121 121 std::map<std::string,std::string> values; 122 values.insert( std::map<std::string,std::string>::value_type( "name", dg.GetName() ) ); 123 values.insert( std::map<std::string,std::string>::value_type( "params", "" ) ); 122 123 if( dg.GetNamespaceScopes().size() ) 124 { 125 std::string namespaceScopesCommandStr = ""; 126 std::string endNamespaceScopesCommandStr = ""; 127 BOOST_FOREACH( const std::string &namespaceStr, dg.GetNamespaceScopes() ) 128 { 129 if( namespaceScopesCommandStr.size() ) 130 { 131 namespaceScopesCommandStr += ":"; 132 endNamespaceScopesCommandStr += ":"; 133 } 134 namespaceScopesCommandStr += "Namespace " + namespaceStr; 135 endNamespaceScopesCommandStr += "End Namespace"; 136 } 137 138 values.insert( std::map<std::string,std::string>::value_type( 139 "#namespace_begin#", 140 namespaceScopesCommandStr 141 ) ); 142 values.insert( std::map<std::string,std::string>::value_type( 143 "#namespace_end#", 144 endNamespaceScopesCommandStr 145 ) ); 146 } 147 else 148 { 149 values.insert( std::map<std::string,std::string>::value_type( "#namespace_begin#", "" ) ); 150 values.insert( std::map<std::string,std::string>::value_type( "#namespace_end#", "" ) ); 151 } 152 153 values.insert( std::map<std::string,std::string>::value_type( "#name#", dg.GetName() ) ); 154 155 std::string paramsStr = dg.Params().GetString(); 156 157 if( dg.IsFunction() ) 158 { 159 values.insert( std::map<std::string,std::string>::value_type( 160 "#call_method_begin#", 161 (string)"Function Call(" + paramsStr + ") As " + compiler.TypeToString( dg.ReturnType() ) 162 ) ); 163 164 values.insert( std::map<std::string,std::string>::value_type( 165 "#call_method_end#", 166 "End Function" 167 ) ); 168 169 values.insert( std::map<std::string,std::string>::value_type( "#result#", "Call=" ) ); 170 } 171 else 172 { 173 values.insert( std::map<std::string,std::string>::value_type( 174 "#call_method_begin#", 175 (string)"Sub Call(" + paramsStr + ")" 176 ) ); 177 178 values.insert( std::map<std::string,std::string>::value_type( 179 "#call_method_end#", 180 "End Sub" 181 ) ); 182 183 values.insert( std::map<std::string,std::string>::value_type( "#result#", "" ) ); 184 } 185 186 values.insert( std::map<std::string,std::string>::value_type( "#params#", paramsStr ) ); 187 124 188 destSource += sourceTemplate.GetResult( values ); 125 189 } 190 191 ts( destSource.c_str() ); 126 192 } -
trunk/abdev/BasicCompiler_Common/src/Parameter.cpp
r322 r325 159 159 return true; 160 160 } 161 162 std::string Parameters::GetString() const 163 { 164 std::string result; 165 166 const Parameters ¶ms = *this; 167 BOOST_FOREACH( const Parameter *pParam, params ) 168 { 169 if( result.size() ) 170 { 171 result += ","; 172 } 173 174 result += pParam->GetVarName() + " As " + compiler.TypeToString( *pParam ); 175 } 176 return result; 177 } -
trunk/abdev/BasicCompiler_Common/src/Source.cpp
r322 r325 1048 1048 while( true ) 1049 1049 { 1050 std::string::size_type index = result.find( "#" + it->first + "#");1050 std::string::size_type index = result.find( it->first ); 1051 1051 if( index == std::string::npos ) 1052 1052 { … … 1054 1054 } 1055 1055 1056 result = result.substr( 0, index ) + it->second + result.substr( index + it->first.length() + 2);1056 result = result.substr( 0, index ) + it->second + result.substr( index + it->first.length() ); 1057 1057 } 1058 1058 it++;
Note:
See TracChangeset
for help on using the changeset viewer.