Adding support for parsing standard function in standard function blocks code generation
authorlbessard
Wed, 10 Jun 2009 13:20:52 +0200
changeset 191 0941a912dcae
parent 190 00b83e15eb43
child 192 c6c2a3d487ac
Adding support for parsing standard function in standard function blocks code generation
stage1_2/iec.y
--- a/stage1_2/iec.y	Wed Jun 10 13:19:51 2009 +0200
+++ b/stage1_2/iec.y	Wed Jun 10 13:20:52 2009 +0200
@@ -7656,6 +7656,10 @@
   FILE *in_file = NULL, *lib_file = NULL;
   char *libfilename = NULL;
 	
+	for(int i = 0; standard_function_names[i] != NULL; i++)
+    if (library_element_symtable.find_value(standard_function_names[i]) ==
+        library_element_symtable.end_value())
+      library_element_symtable.insert(standard_function_names[i], standard_function_name_token);
 
   if((in_file = fopen(filename, "r")) == NULL) {
     char *errmsg = strdup2("Error opening main file ", filename);
@@ -7704,11 +7708,6 @@
   /* if by any chance the library is not complete, we
    * now add the missing reserved keywords to the list!!!
    */
-  for(int i = 0; standard_function_names[i] != NULL; i++)
-    if (library_element_symtable.find_value(standard_function_names[i]) ==
-        library_element_symtable.end_value())
-      library_element_symtable.insert(standard_function_names[i], standard_function_name_token);
-
   for(int i = 0; standard_function_block_names[i] != NULL; i++)
     if (library_element_symtable.find_value(standard_function_block_names[i]) ==
         library_element_symtable.end_value())