equal
deleted
inserted
replaced
265 else: |
265 else: |
266 res += "return return_type_symbol;\n" |
266 res += "return return_type_symbol;\n" |
267 |
267 |
268 return res.replace('\n','\n'+indent) |
268 return res.replace('\n','\n'+indent) |
269 |
269 |
|
270 def get_default_input_type(fdecls): |
|
271 if type(fdecls) != type(tuple()) and len(fdecls) == 1: |
|
272 ParamTypes = fdecls.values()[0] |
|
273 if len(ParamTypes) == 1: |
|
274 ParamType_name, ParamType_value = ParamTypes.items()[0] |
|
275 if not ParamType_name.startswith("ANY") and type(ParamType_value) == type(tuple()): |
|
276 return "&search_constant_type_c::%s_type_name" % ParamType_name.lower() |
|
277 return "NULL" |
|
278 |
270 ################################################################### |
279 ################################################################### |
271 ### ### |
280 ### ### |
272 ### MAIN ### |
281 ### MAIN ### |
273 ### ### |
282 ### ### |
274 ################################################################### |
283 ################################################################### |
344 /**** |
353 /**** |
345 *%s |
354 *%s |
346 */ |
355 */ |
347 case function_%s : |
356 case function_%s : |
348 { |
357 { |
349 symbol_c *last_type_symbol = NULL; |
358 symbol_c *last_type_symbol = %s; |
350 """ %(fname, fname.lower()) |
359 """ %(fname, fname.lower(), get_default_input_type(fdecls)) |
351 indent = " " |
360 indent = " " |
352 |
361 |
353 st_code_gen += recurse_and_indent(fdecls, indent).replace('\n','\n ') |
362 st_code_gen += recurse_and_indent(fdecls, indent).replace('\n','\n ') |
354 |
363 |
355 st_code_gen += """ |
364 st_code_gen += """ |
376 /**** |
385 /**** |
377 *%s |
386 *%s |
378 */ |
387 */ |
379 case function_%s : |
388 case function_%s : |
380 { |
389 { |
381 symbol_c *last_type_symbol = NULL; |
390 symbol_c *last_type_symbol = %s; |
382 """ %(fname, fname.lower()) |
391 """ %(fname, fname.lower(), get_default_input_type(fdecls)) |
383 indent = " " |
392 indent = " " |
384 |
393 |
385 il_code_gen += recurse_and_indent(fdecls, indent, do_il=True).replace('\n','\n ') |
394 il_code_gen += recurse_and_indent(fdecls, indent, do_il=True).replace('\n','\n ') |
386 |
395 |
387 il_code_gen += """ |
396 il_code_gen += """ |
425 /**** |
434 /**** |
426 *%s |
435 *%s |
427 */ |
436 */ |
428 case function_%s : |
437 case function_%s : |
429 { |
438 { |
430 symbol_c *last_type_symbol = NULL; |
439 symbol_c *last_type_symbol = %s; |
431 """ %(fname, fname.lower()) |
440 """ %(fname, fname.lower(), get_default_input_type(fdecls)) |
432 indent = " " |
441 indent = " " |
433 |
442 |
434 search_type_code += recurse_and_indent(fdecls, indent, True).replace('\n','\n ') |
443 search_type_code += recurse_and_indent(fdecls, indent, True).replace('\n','\n ') |
435 |
444 |
436 search_type_code += """ |
445 search_type_code += """ |
458 /**** |
467 /**** |
459 *%s |
468 *%s |
460 */ |
469 */ |
461 case function_%s : |
470 case function_%s : |
462 { |
471 { |
463 symbol_c *last_type_symbol = NULL; |
472 symbol_c *last_type_symbol = %s; |
464 """ %(fname, fname.lower()) |
473 """ %(fname, fname.lower(), get_default_input_type(fdecls)) |
465 indent = " " |
474 indent = " " |
466 |
475 |
467 search_type_code += recurse_and_indent(fdecls, indent, True, True).replace('\n','\n ') |
476 search_type_code += recurse_and_indent(fdecls, indent, True, True).replace('\n','\n ') |
468 |
477 |
469 search_type_code += """ |
478 search_type_code += """ |