# HG changeset patch # User lbessard # Date 1244632852 -7200 # Node ID 0941a912dcae0a0afa623a41aeafd4e413f9cf4f # Parent 00b83e15eb439077bb459f9943851fc76e57e246 Adding support for parsing standard function in standard function blocks code generation diff -r 00b83e15eb43 -r 0941a912dcae 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())