Consider fb_name_decl_c a non base data type class!
authorMario de Sousa <msousa@fe.up.pt>
Wed, 23 Jan 2013 14:53:14 +0000
changeset 808 7a6b53d61ea3
parent 807 4d71292f8732
child 809 9204559768f1
Consider fb_name_decl_c a non base data type class!
absyntax_utils/search_base_type.cc
absyntax_utils/search_base_type.hh
stage3/fill_candidate_datatypes.cc
stage3/fill_candidate_datatypes.hh
stage3/narrow_candidate_datatypes.cc
stage3/narrow_candidate_datatypes.hh
--- a/absyntax_utils/search_base_type.cc	Wed Jan 23 14:30:03 2013 +0000
+++ b/absyntax_utils/search_base_type.cc	Wed Jan 23 14:53:14 2013 +0000
@@ -372,7 +372,19 @@
 */
 void *search_base_type_c::visit(string_type_declaration_c *symbol)	                {return (void *)symbol;}
 
-  
+
+/******************************************/
+/* B 1.4.3 - Declaration & Initialisation */
+/******************************************/
+/* fb_name_list ':' function_block_type_name ASSIGN structure_initialization */
+/* structure_initialization -> may be NULL ! */
+// SYM_REF3(fb_name_decl_c, fb_name_list, function_block_type_name, structure_initialization)
+// NOTE: Although the fb_name_decl_c is in section ( B 1.4.3 - Declaration & Initialisation), it is also acting
+//       as a datatype declaration, so we need to handle it here!
+void *search_base_type_c::visit(fb_name_decl_c *symbol)	{
+  return symbol->function_block_type_name->accept(*this);
+}
+
 
 /*****************************/
 /* B 1.5.2 - Function Blocks */
--- a/absyntax_utils/search_base_type.hh	Wed Jan 23 14:30:03 2013 +0000
+++ b/absyntax_utils/search_base_type.hh	Wed Jan 23 14:53:14 2013 +0000
@@ -234,6 +234,13 @@
   */
     void *visit(string_type_declaration_c *symbol);
 
+  /******************************************/
+  /* B 1.4.3 - Declaration & Initialisation */
+  /******************************************/
+  /* fb_name_list ':' function_block_type_name ASSIGN structure_initialization */
+  /* structure_initialization -> may be NULL ! */
+    void *visit(fb_name_decl_c *symbol);
+    
   /*****************************/
   /* B 1.5.2 - Function Blocks */
   /*****************************/
--- a/stage3/fill_candidate_datatypes.cc	Wed Jan 23 14:30:03 2013 +0000
+++ b/stage3/fill_candidate_datatypes.cc	Wed Jan 23 14:53:14 2013 +0000
@@ -1255,6 +1255,13 @@
 
 
 
+/* fb_name_list ':' function_block_type_name ASSIGN structure_initialization */
+/* structure_initialization -> may be NULL ! */
+// SYM_REF3(fb_name_decl_c, fb_name_list, function_block_type_name, structure_initialization)
+// NOTE: Although the fb_name_decl_c is in section ( B 1.4.3 - Declaration & Initialisation), it is also acting
+//       as a datatype declaration, so we need to handle it here!
+void *fill_candidate_datatypes_c::visit(fb_name_decl_c *symbol) {return fill_spec_init(symbol, symbol->function_block_type_name, symbol->structure_initialization);}
+
 
 
 /************************************/
--- a/stage3/fill_candidate_datatypes.hh	Wed Jan 23 14:30:03 2013 +0000
+++ b/stage3/fill_candidate_datatypes.hh	Wed Jan 23 14:53:14 2013 +0000
@@ -218,7 +218,7 @@
     void *visit(var1_list_c *symbol);
     void *visit(location_c *symbol);
     void *visit(located_var_decl_c *symbol);
-
+    void *visit(fb_name_decl_c *symbol);
 
     /**************************************/
     /* B 1.5 - Program organization units */
--- a/stage3/narrow_candidate_datatypes.cc	Wed Jan 23 14:30:03 2013 +0000
+++ b/stage3/narrow_candidate_datatypes.cc	Wed Jan 23 14:53:14 2013 +0000
@@ -718,6 +718,14 @@
 }
 
 
+/* fb_name_list ':' function_block_type_name ASSIGN structure_initialization */
+/* structure_initialization -> may be NULL ! */
+// SYM_REF3(fb_name_decl_c, fb_name_list, function_block_type_name, structure_initialization)
+// NOTE: Although the fb_name_decl_c is in section ( B 1.4.3 - Declaration & Initialisation), it is also acting
+//       as a datatype declaration, so we need to handle it here!
+void *narrow_candidate_datatypes_c::visit(fb_name_decl_c *symbol) {return narrow_spec_init(symbol, symbol->function_block_type_name, symbol->structure_initialization);}
+
+
 /************************************/
 /* B 1.5 Program organization units */
 /************************************/
--- a/stage3/narrow_candidate_datatypes.hh	Wed Jan 23 14:30:03 2013 +0000
+++ b/stage3/narrow_candidate_datatypes.hh	Wed Jan 23 14:53:14 2013 +0000
@@ -195,6 +195,7 @@
     void *visit(var1_list_c *symbol);
     void *visit(location_c *symbol);
     void *visit(located_var_decl_c *symbol);
+    void *visit(fb_name_decl_c *symbol);
 
     /**************************************/
     /* B 1.5 - Program organization units */