stage1_2/iec_bison.yy
changeset 811 970c582885bf
parent 810 d9c48ad646f1
child 822 a7d9e0b8636b
child 823 c95f42f28b69
equal deleted inserted replaced
810:d9c48ad646f1 811:970c582885bf
  5690 /* ERROR_CHECK_END */
  5690 /* ERROR_CHECK_END */
  5691 ;
  5691 ;
  5692 
  5692 
  5693 
  5693 
  5694 resource_declaration:
  5694 resource_declaration:
  5695   RESOURCE {variable_name_symtable.push();direct_variable_symtable.push();} resource_name ON resource_type_name
  5695   RESOURCE {variable_name_symtable.push();direct_variable_symtable.push();} resource_name {variable_name_symtable.insert($3, prev_declared_resource_name_token);} ON resource_type_name
  5696    optional_global_var_declarations
  5696    optional_global_var_declarations
  5697    single_resource_declaration
  5697    single_resource_declaration
  5698   END_RESOURCE
  5698   END_RESOURCE
  5699 	{$$ = new resource_declaration_c($3, $5, $6, $7, locloc(@$));
  5699 	{$$ = new resource_declaration_c($3, $6, $7, $8, locloc(@$));
  5700 	 variable_name_symtable.pop();
  5700 	 variable_name_symtable.pop();
  5701 	 direct_variable_symtable.pop();
  5701 	 direct_variable_symtable.pop();
  5702 	 variable_name_symtable.insert($3, prev_declared_resource_name_token);
  5702 	 variable_name_symtable.insert($3, prev_declared_resource_name_token);
  5703 	}
  5703 	}
  5704 /* ERROR_CHECK_BEGIN */
  5704 /* ERROR_CHECK_BEGIN */
  8244 int stage2__(const char *filename, 
  8244 int stage2__(const char *filename, 
  8245              const char *includedir,     /* Include directory, where included files will be searched for... */
  8245              const char *includedir,     /* Include directory, where included files will be searched for... */
  8246              symbol_c **tree_root_ref,
  8246              symbol_c **tree_root_ref,
  8247              bool full_token_loc_        /* error messages specify full token location */
  8247              bool full_token_loc_        /* error messages specify full token location */
  8248             ) {
  8248             ) {
  8249 
       
  8250   char *libfilename = NULL;
  8249   char *libfilename = NULL;
  8251 
  8250 
  8252   if (includedir != NULL) {
  8251   if (includedir != NULL) {
  8253     INCLUDE_DIRECTORIES[0] = includedir;
  8252     INCLUDE_DIRECTORIES[0] = includedir;
  8254   }
  8253   }
  8294   for(int i = 0; standard_function_block_names[i] != NULL; i++)
  8293   for(int i = 0; standard_function_block_names[i] != NULL; i++)
  8295     if (library_element_symtable.find_value(standard_function_block_names[i]) ==
  8294     if (library_element_symtable.find_value(standard_function_block_names[i]) ==
  8296         library_element_symtable.end_value())
  8295         library_element_symtable.end_value())
  8297       library_element_symtable.insert(standard_function_block_names[i], standard_function_block_name_token);
  8296       library_element_symtable.insert(standard_function_block_names[i], standard_function_block_name_token);
  8298 
  8297 
  8299 
       
  8300   /* now parse the input file... */
  8298   /* now parse the input file... */
  8301   #if YYDEBUG
  8299   #if YYDEBUG
  8302     yydebug = 1;
  8300     yydebug = 1;
  8303   #endif
  8301   #endif
  8304   FILE *mainfile = NULL;
  8302   FILE *mainfile = NULL;