stage3/constant_folding.cc
changeset 973 f86d5d6bb04e
parent 970 0ede7ca157e2
child 974 a47c2df5ae3d
equal deleted inserted replaced
972:bc90dd4bbf4f 973:f86d5d6bb04e
  1388 */
  1388 */
  1389 /* enumvalue_symtable is filled in by enum_declaration_check_c, during stage3 semantic verification, with a list of all enumerated constants declared inside this POU */
  1389 /* enumvalue_symtable is filled in by enum_declaration_check_c, during stage3 semantic verification, with a list of all enumerated constants declared inside this POU */
  1390 // SYM_REF4(resource_declaration_c, resource_name, resource_type_name, global_var_declarations, resource_declaration, 
  1390 // SYM_REF4(resource_declaration_c, resource_name, resource_type_name, global_var_declarations, resource_declaration, 
  1391 //          enumvalue_symtable_t enumvalue_symtable; localvar_symbmap_t localvar_symbmap; localvar_symbvec_t localvar_symbvec;)
  1391 //          enumvalue_symtable_t enumvalue_symtable; localvar_symbmap_t localvar_symbmap; localvar_symbvec_t localvar_symbvec;)
  1392 void *constant_folding_c::visit(resource_declaration_c *symbol) {
  1392 void *constant_folding_c::visit(resource_declaration_c *symbol) {
  1393 	values.clear(); /* Clear global map */
  1393 	values.push(); /* Create inner scope */
  1394 	/* Add initial value of all declared variables into Values map. */
  1394 	/* Add initial value of all declared variables into Values map. */
  1395 	function_pou_ = false;
  1395 	function_pou_ = false;
  1396 	return iterator_visitor_c::visit(symbol); // let the base iterator class handle the rest (basically iterate through the whole configuration and do the constant folding!
  1396 	iterator_visitor_c::visit(symbol); // let the base iterator class handle the rest (basically iterate through the whole configuration and do the constant folding!
       
  1397 	values.pop(); /* Delete inner scope */
       
  1398 	return NULL;
  1397 }
  1399 }
  1398 
  1400 
  1399 
  1401 
  1400 
  1402 
  1401 /* task_configuration_list program_configuration_list */
  1403 /* task_configuration_list program_configuration_list */