stage4/generate_c/generate_c_il.cc
changeset 844 39c755f41ee8
parent 842 2415912b0aa0
child 851 2c59c2b8fca4
equal deleted inserted replaced
843:f9a059c24aea 844:39c755f41ee8
   837      * have reached the end, and should simply jump out of the for loop.
   837      * have reached the end, and should simply jump out of the for loop.
   838      */
   838      */
   839     if ((param_value == NULL) && (fp_iterator.is_extensible_param())) {
   839     if ((param_value == NULL) && (fp_iterator.is_extensible_param())) {
   840       break;
   840       break;
   841     }
   841     }
       
   842     
       
   843     /* We do not yet support embedded IL lists, so we abort the compiler if we find one */
       
   844     /* Note that in IL function calls the syntax does not allow embeded IL lists, so this check is not necessary here! */
       
   845     /*
       
   846     {simple_instr_list_c *instruction_list = dynamic_cast<simple_instr_list_c *>(param_value);
       
   847      if (NULL != instruction_list) STAGE4_ERROR(param_value, param_value, "The compiler does not yet support formal invocations in IL that contain embedded IL lists. Aborting!");
       
   848     }
       
   849     */
   842     
   850     
   843     if ((param_value == NULL) && (param_direction == function_param_iterator_c::direction_in)) {
   851     if ((param_value == NULL) && (param_direction == function_param_iterator_c::direction_in)) {
   844       /* No value given for parameter, so we must use the default... */
   852       /* No value given for parameter, so we must use the default... */
   845       /* First check whether default value specified in function declaration...*/
   853       /* First check whether default value specified in function declaration...*/
   846       param_value = fp_iterator.default_value();
   854       param_value = fp_iterator.default_value();
  1059      * were implicitly defined!
  1067      * were implicitly defined!
  1060      */
  1068      */
  1061     if ((param_value == NULL) && !fp_iterator.is_en_eno_param_implicit())
  1069     if ((param_value == NULL) && !fp_iterator.is_en_eno_param_implicit())
  1062       param_value = function_call_param_iterator.next_nf();
  1070       param_value = function_call_param_iterator.next_nf();
  1063 
  1071 
       
  1072     /* We do not yet support embedded IL lists, so we abort the compiler if we find one */
       
  1073     {simple_instr_list_c *instruction_list = dynamic_cast<simple_instr_list_c *>(param_value);
       
  1074      if (NULL != instruction_list) STAGE4_ERROR(param_value, param_value, "The compiler does not yet support formal invocations in IL that contain embedded IL lists. Aborting!");
       
  1075     }
       
  1076     
  1064     symbol_c *param_type = fp_iterator.param_type();
  1077     symbol_c *param_type = fp_iterator.param_type();
  1065     if (param_type == NULL) ERROR;
  1078     if (param_type == NULL) ERROR;
  1066     
  1079     
  1067         /* now output the value assignment */
  1080         /* now output the value assignment */
  1068     if (param_value != NULL)
  1081     if (param_value != NULL)
  1225      * of the function declaration is an extensible parameter, we
  1238      * of the function declaration is an extensible parameter, we
  1226      * have reached the end, and should simply jump out of the for loop.
  1239      * have reached the end, and should simply jump out of the for loop.
  1227      */
  1240      */
  1228     if ((param_value == NULL) && (fp_iterator.is_extensible_param())) {
  1241     if ((param_value == NULL) && (fp_iterator.is_extensible_param())) {
  1229       break;
  1242       break;
       
  1243     }
       
  1244     
       
  1245     /* We do not yet support embedded IL lists, so we abort the compiler if we find one */
       
  1246     {simple_instr_list_c *instruction_list = dynamic_cast<simple_instr_list_c *>(param_value);
       
  1247      if (NULL != instruction_list) STAGE4_ERROR(param_value, param_value, "The compiler does not yet support formal invocations in IL that contain embedded IL lists. Aborting!");
  1230     }
  1248     }
  1231     
  1249     
  1232     if ((param_value == NULL) && (param_direction == function_param_iterator_c::direction_in)) {
  1250     if ((param_value == NULL) && (param_direction == function_param_iterator_c::direction_in)) {
  1233       /* No value given for parameter, so we must use the default... */
  1251       /* No value given for parameter, so we must use the default... */
  1234       /* First check whether default value specified in function declaration...*/
  1252       /* First check whether default value specified in function declaration...*/