Changeset 325 in dev for trunk/abdev/BasicCompiler_Common/src/Delegate.cpp
- Timestamp:
- Sep 25, 2007, 8:56:38 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note:
See TracChangeset
for help on using the changeset viewer.