Changeset 131 for trunk/ORBit2-2.14.0/src/idl-compiler
- Timestamp:
- Dec 1, 2006, 10:21:43 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ORBit2-2.14.0/src/idl-compiler/orbit-idl-c-headers.c
r124 r131 972 972 } 973 973 974 974 975 /* 975 976 This function puts out something like the following in the *.h file: 976 977 977 #define WPFolder_wpEchoString( ) \978 WPObject_wpEchoString( )978 #define WPFolder_wpEchoString(nomSelf, a, b, ...) \ 979 WPObject_wpEchoString((WPObject*) nomSelf, a, b, ...) 979 980 */ 980 981 static void … … 1002 1003 overriden. */ 1003 1004 if(!strcmp(overridenMethodName, IDL_IDENT(IDL_OP_DCL(curop).ident).str)){ 1004 fprintf(ioi->of, "#define %s_%s() \\\n %s_%s()\n", 1005 realid, IDL_IDENT(IDL_OP_DCL(curop).ident).str, 1006 id, IDL_IDENT(IDL_OP_DCL(curop).ident).str); 1005 IDL_tree sub; 1006 1007 //fprintf(ioi->of, "#define %s_%s() \\\n %s_%s()\n", 1008 // realid, IDL_IDENT(IDL_OP_DCL(curop).ident).str, 1009 // id, IDL_IDENT(IDL_OP_DCL(curop).ident).str); 1010 fprintf(ioi->of, "#define %s_%s(nomSelf, ", 1011 realid, IDL_IDENT(IDL_OP_DCL(curop).ident).str); 1012 for (sub = IDL_OP_DCL (curop).parameter_dcls; sub; sub = IDL_LIST (sub).next) { 1013 IDL_tree parm = IDL_LIST (sub).data; 1014 fprintf (ioi->of, "%s, ", IDL_IDENT (IDL_PARAM_DCL (parm).simple_declarator).str); 1015 } 1016 fprintf(ioi->of, "ev) \\\n"); 1017 fprintf(ioi->of, " %s_%s((%s*) nomSelf, ", 1018 id, IDL_IDENT(IDL_OP_DCL(curop).ident).str, id); 1019 for (sub = IDL_OP_DCL (curop).parameter_dcls; sub; sub = IDL_LIST (sub).next) { 1020 IDL_tree parm = IDL_LIST (sub).data; 1021 fprintf (ioi->of, "%s, ", IDL_IDENT (IDL_PARAM_DCL (parm).simple_declarator).str); 1022 } 1023 fprintf(ioi->of, "ev)\n"); 1007 1024 } 1008 1025 break; … … 1135 1152 } 1136 1153 1137 1138 1154 static void 1139 1155 ch_output_stub_protos(IDL_tree tree, OIDL_Run_Info *rinfo, OIDL_C_Info *ci) … … 1198 1214 VoyagerOutputClassDataStructMember(ci->fh, cur, ""); 1199 1215 fprintf(ci->fh, ";\n"); 1200 }1201 else1202 {1203 #if 01204 /* FIXME:1205 This is only a debug method to be thrown out... */1206 fprintf(ci->fh, "/* DEBUG: Overriden method ");1207 fprintf(ci->fh, "%s, %s, %s: %d */\n", IDL_IDENT (IDL_OP_DCL (cur).ident).str,1208 __FILE__, __FUNCTION__, __LINE__);1209 #endif1210 1216 } 1211 1217 break; … … 1247 1253 fprintf(ci->fh, "} %sClassData;\n\n", id); 1248 1254 1249 /***** Print introduced method for possible postprocessing ***/ 1255 1256 /******* Print introduced method for possible postprocessing *******/ 1250 1257 for(sub = IDL_INTERFACE(tree).body; sub; sub = IDL_LIST(sub).next) { 1251 1258 IDL_tree cur; … … 1272 1279 }/* for */ 1273 1280 fprintf(ci->fh, "\n"); 1274 /***** Print introduced method for possible postprocessing***/1275 1276 /***** Output overriden methods***/1281 /******* Print introduced method for possible postprocessing *******/ 1282 1283 /******* Output overriden methods *******/ 1277 1284 for(sub = IDL_INTERFACE(tree).body; sub; sub = IDL_LIST(sub).next) { 1278 1285 IDL_tree cur; … … 1290 1297 /* There's an overriden method here */ 1291 1298 *ptr='\0'; 1299 fprintf(ci->fh, "/* %s, %s line %d */\n", __FILE__, __FUNCTION__, __LINE__); 1292 1300 fprintf(ci->fh, "/* OVERRIDE_METHOD: "); 1293 1301 fprintf(ci->fh, "%s %s */\n", IDL_IDENT (IDL_OP_DCL (cur).ident).str, id ); … … 1295 1303 fprintf(ci->fh, "#undef %s_%s\n", id, IDL_IDENT (IDL_OP_DCL (cur).ident).str); 1296 1304 fprintf(ci->fh, "#endif\n"); 1305 1297 1306 /* Try to find the interface introducing this method */ 1298 1307 … … 1303 1312 ioi.realif = tree; 1304 1313 ioi.chrOverridenMethodName=IDL_IDENT (IDL_OP_DCL (cur).ident).str; 1305 IDL_tree_traverse_parents(IDL_INTERFACE(tree).inheritance_spec, (GFunc)VoyagerOutputOverridenMethod, &ioi); 1314 IDL_tree_traverse_parents(IDL_INTERFACE(tree).inheritance_spec, 1315 (GFunc)VoyagerOutputOverridenMethod, &ioi); 1306 1316 } 1307 1317 *ptr='_'; … … 1314 1324 }/* for */ 1315 1325 fprintf(ci->fh, "\n"); 1316 /***** Output overriden methods***/1326 /******* Output overriden methods *******/ 1317 1327 1318 1328 /* */ … … 1325 1335 } 1326 1336 1337 /* 1338 This function writes the params of methods. The typespec is not written. 1339 This function is useful for putting parameters into macros. 1340 */ 1341 static void 1342 VoyagerOutputMethodParamsNoTypeSpec(FILE *of, IDL_tree tree, const char *nom_prefix) 1343 { 1344 IDL_tree curitem; 1345 1346 g_assert (IDL_NODE_TYPE(tree) == IDLN_OP_DCL); 1347 1348 /* add the parms */ 1349 for(curitem = IDL_OP_DCL(tree).parameter_dcls; 1350 curitem; curitem = IDL_LIST(curitem).next) { 1351 IDL_tree tr; 1352 1353 tr = IDL_LIST(curitem).data; 1354 /* Write list of params */ 1355 if(IDL_NODE_TYPE(tr) == IDLN_PARAM_DCL) 1356 { 1357 fprintf(of, " %s,", IDL_IDENT(IDL_PARAM_DCL(tr).simple_declarator).str); 1358 } 1359 } 1360 return ; 1361 } 1362 1327 1363 static void 1328 1364 ch_output_inherited_protos(IDL_tree curif, InheritedOutputInfo *ioi) … … 1342 1378 switch(IDL_NODE_TYPE(curop)) { 1343 1379 case IDLN_OP_DCL: 1344 /* Only output methods which are not overriden */ 1380 /* Only output methods which are not overriden. Overriden methods are also 1381 put into the data but they're marked with __OVERRIDE__. */ 1345 1382 if(!strstr(IDL_IDENT (IDL_OP_DCL (curop).ident).str, "__OVERRIDE__")) 1346 1383 { 1347 1384 fprintf(ioi->of, "/* %s, %s line %d */\n", __FILE__, __FUNCTION__, __LINE__); 1348 fprintf(ioi->of, "#define %s_%s %s_%s\n", 1349 realid, IDL_IDENT(IDL_OP_DCL(curop).ident).str, 1350 id, IDL_IDENT(IDL_OP_DCL(curop).ident).str); 1385 // fprintf(ioi->of, "#define %s_%s %s_%s\n", 1386 // realid, IDL_IDENT(IDL_OP_DCL(curop).ident).str, 1387 // id, IDL_IDENT(IDL_OP_DCL(curop).ident).str); 1388 fprintf(ioi->of, "#define %s_%s(nomSelf,",realid, IDL_IDENT(IDL_OP_DCL(curop).ident).str); 1389 VoyagerOutputMethodParamsNoTypeSpec(ioi->of, curop, ""); 1390 fprintf(ioi->of, " ev) \\\n %s_%s((%s*) nomSelf,", 1391 id, IDL_IDENT(IDL_OP_DCL(curop).ident).str, id); 1392 VoyagerOutputMethodParamsNoTypeSpec(ioi->of, curop, ""); 1393 fprintf(ioi->of, " ev)\n"); 1351 1394 } 1352 1395 break;
Note:
See TracChangeset
for help on using the changeset viewer.
