stage4/generate_c/generate_c_st.cc
changeset 855 a3109442e166
parent 854 13d0b67de111
child 861 443e8243f289
equal deleted inserted replaced
854:13d0b67de111 855:a3109442e166
   860   return NULL;
   860   return NULL;
   861 }
   861 }
   862 
   862 
   863 
   863 
   864 /* fb_name '(' [param_assignment_list] ')' */
   864 /* fb_name '(' [param_assignment_list] ')' */
   865 /* param_assignment_list -> may be NULL ! */
   865 /*    formal_param_list -> may be NULL ! */
   866 //SYM_REF2(fb_invocation_c, fb_name, param_assignment_list)
   866 /* nonformal_param_list -> may be NULL ! */
       
   867 /* NOTE: The parameter 'called_fb_declaration'is used to pass data between stage 3 and stage4 (although currently it is not used in stage 4 */
       
   868 // SYM_REF3(fb_invocation_c, fb_name, formal_param_list, nonformal_param_list, symbol_c *called_fb_declaration;)
   867 void *visit(fb_invocation_c *symbol) {
   869 void *visit(fb_invocation_c *symbol) {
   868   TRACE("fb_invocation_c");
   870   TRACE("fb_invocation_c");
   869   /* first figure out what is the name of the function block type of the function block being called... */
   871   
   870   symbol_c *function_block_type_name = this->search_fb_instance_decl->get_type_name(symbol->fb_name);
   872   /* find the declaration of the function block type being called... */
   871     /* should never occur. The function block instance MUST have been declared... */
   873   symbol_c *fb_decl = symbol->called_fb_declaration;
   872   if (function_block_type_name == NULL) ERROR;
   874   if (fb_decl == NULL) ERROR;
   873 
   875   /* figure out the name of the function block type of the function block being called... */
   874   /* Now find the declaration of the function block type being called... */
   876   symbol_c *function_block_type_name = get_datatype_info_c::get_id(fb_decl);
   875   function_block_declaration_c *fb_decl = function_block_type_symtable.find_value(function_block_type_name);
   877   if (NULL == function_block_type_name) ERROR;
   876     /* should never occur. The function block type being called MUST be in the symtable... */
   878   
   877   if (fb_decl == function_block_type_symtable.end_value()) ERROR;
       
   878 
       
   879   /* loop through each function block parameter, find the value we should pass
   879   /* loop through each function block parameter, find the value we should pass
   880    * to it, and then output the c equivalent...
   880    * to it, and then output the c equivalent...
   881    */
   881    */
   882   function_param_iterator_c fp_iterator(fb_decl);
   882   function_param_iterator_c fp_iterator(fb_decl);
   883   identifier_c *param_name;
   883   identifier_c *param_name;