Changeset 118 for trunk/ORBit2-2.14.0/src/idl-compiler
- Timestamp:
- Nov 26, 2006, 7:07:59 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ORBit2-2.14.0/src/idl-compiler/orbit-idl-c-skelimpl.c
r117 r118 55 55 char* chrOverridenMethodName; 56 56 } InheritedOutputInfo; 57 58 typedef struct { 59 FILE *of; 60 IDL_tree realif; 61 char* chrOverridenMethodName; 62 char* chrClassName; 63 } InheritedOutputInfo2; 57 64 58 65 static const char *passnames[] = { … … 223 230 } 224 231 225 #if 0226 static227 void VoyagerWriteParamsForParentCall (FILE *of,228 IDL_tree op)229 {230 IDL_tree sub;231 232 g_assert (IDL_NODE_TYPE(op) == IDLN_OP_DCL);233 234 fprintf (of, "(nomSelf, ");235 236 for (sub = IDL_OP_DCL (op).parameter_dcls; sub; sub = IDL_LIST (sub).next) {237 IDL_tree parm = IDL_LIST (sub).data;238 fprintf (of, "/**/ %s, ", IDL_IDENT (IDL_PARAM_DCL (parm).simple_declarator).str);239 }240 fprintf (of, " ev)");241 }242 #endif243 244 245 232 /* 246 233 This function is called for each parent to check if the current parent introduced the … … 249 236 */ 250 237 static 251 void VoyagerDoWrite ParamsForOverridenMethod(IDL_tree curif, InheritedOutputInfo*ioi)238 void VoyagerDoWriteOverridenMethodDeclaration(IDL_tree curif, InheritedOutputInfo2 *ioi) 252 239 { 253 240 IDL_tree curitem; … … 271 258 272 259 g_assert (IDL_NODE_TYPE(curop) == IDLN_OP_DCL); 260 261 /* return typespec */ 262 orbit_cbe_write_param_typespec (ioi->of, curop); 263 264 /* The methodname */ 265 fprintf (ioi->of, " %s%s_%s", "NOMLINK impl_", 266 ioi->chrClassName, overridenMethodName); 267 268 fprintf (ioi->of, "(%s* nomSelf, ", ioi->chrClassName); 273 269 274 270 /* Write the params including the typespec */ … … 278 274 orbit_cbe_write_param_typespec (ioi->of, parm); 279 275 280 fprintf (ioi->of, " %s, \n", IDL_IDENT (IDL_PARAM_DCL (parm).simple_declarator).str);276 fprintf (ioi->of, " %s, ", IDL_IDENT (IDL_PARAM_DCL (parm).simple_declarator).str); 281 277 } 282 278 } … … 295 291 */ 296 292 static void 297 VoyagerWriteParamsForOverridenMethod(FILE *of, 298 IDL_tree op, 299 const char *nom_prefix, 300 gboolean for_epv) 301 { 293 VoyagerWriteOverridenMethodDeclaration(FILE *of, 294 IDL_tree op, 295 const char *nom_prefix, 296 gboolean for_epv) 297 { 298 char *id; 302 299 char * id2; 303 300 char * ptr; … … 305 302 306 303 g_assert (IDL_NODE_TYPE(op) == IDLN_OP_DCL); 304 305 id = IDL_ns_ident_to_qstring ( 306 IDL_IDENT_TO_NS (IDL_INTERFACE ( 307 IDL_get_parent_node (op, IDLN_INTERFACE, NULL)).ident), "_", 0); 307 308 308 309 id2=g_strdup(IDL_IDENT (IDL_OP_DCL (op).ident).str); … … 313 314 314 315 if(IDL_INTERFACE(tmptree).inheritance_spec) { 315 InheritedOutputInfo ioi;316 InheritedOutputInfo2 ioi; 316 317 317 318 ioi.of = of; 318 319 ioi.realif = tmptree; 319 320 ioi.chrOverridenMethodName=id2; 320 IDL_tree_traverse_parents(IDL_INTERFACE(tmptree).inheritance_spec, (GFunc)VoyagerDoWriteParamsForOverridenMethod, &ioi); 321 ioi.chrClassName=id; /* The current class name. In the called function the parent is searched introducing the method. 322 When this parent is found, the current class info isn't easy to get again but it's needed. */ 323 324 IDL_tree_traverse_parents(IDL_INTERFACE(tmptree).inheritance_spec, (GFunc)VoyagerDoWriteOverridenMethodDeclaration, &ioi); 321 325 } 322 326 g_free(id2); 327 g_free(id); 323 328 } 324 329 … … 802 807 #if USE_LIBIDL_CODE 803 808 fprintf(ski->of, "static "); 804 #else 805 fprintf(ski->of, "NOM_Scope "); 809 fprintf(ski->of, " impl_%s(impl_POA_%s *servant,\n", id, id2); 806 810 #endif 807 orbit_cbe_write_param_typespec(ski->of, ski->tree); 808 #if USE_LIBIDL_CODE 809 fprintf(ski->of, " impl_%s(impl_POA_%s *servant,\n", id, id2); 810 #else 811 if(bOverriden) 812 fprintf(ski->of, " NOMLINK impl_%s_%s(%s *nomSelf,\n", 813 id2, gstr->str, id2); 814 else 815 fprintf(ski->of, " NOMLINK impl_%s_%s(%s *nomSelf,\n", 816 id2, IDL_IDENT(IDL_OP_DCL(ski->tree).ident).str, id2); 817 #endif 811 818 812 /* Output the params */ 819 813 if(bOverriden) 820 814 { 821 fprintf(ski->of, "/* Params should end here ... */\n"); 815 /* Overriden method */ 816 fprintf(ski->of, "NOM_Scope "); 817 #if 0 818 fprintf(ski->of, " NOMLINK impl_%s_%s(%s *nomSelf,\n", 819 id2, gstr->str, id2); 820 #endif 822 821 op = ski->tree; 823 VoyagerWrite ParamsForOverridenMethod(ski->of,824 op,825 "",826 FALSE);822 VoyagerWriteOverridenMethodDeclaration(ski->of, 823 op, 824 "", 825 FALSE); 827 826 828 827 for(curitem = IDL_OP_DCL(ski->tree).parameter_dcls; … … 834 833 else 835 834 { 835 fprintf(ski->of, "NOM_Scope "); 836 837 orbit_cbe_write_param_typespec(ski->of, ski->tree); 838 fprintf(ski->of, " NOMLINK impl_%s_%s(%s *nomSelf,\n", 839 id2, IDL_IDENT(IDL_OP_DCL(ski->tree).ident).str, id2); 840 836 841 op = ski->tree; 837 842 for(curitem = IDL_OP_DCL(ski->tree).parameter_dcls;
Note:
See TracChangeset
for help on using the changeset viewer.
