Allow variables declared inside resources to be referenced by res_name.var_name
authorMario de Sousa <msousa@fe.up.pt>
Fri, 22 Feb 2013 21:09:59 +0000
changeset 811 970c582885bf
parent 810 d9c48ad646f1
child 812 6679b6b21214
Allow variables declared inside resources to be referenced by res_name.var_name
stage1_2/iec_bison.yy
--- a/stage1_2/iec_bison.yy	Wed Feb 13 18:56:25 2013 +0000
+++ b/stage1_2/iec_bison.yy	Fri Feb 22 21:09:59 2013 +0000
@@ -5692,11 +5692,11 @@
 
 
 resource_declaration:
-  RESOURCE {variable_name_symtable.push();direct_variable_symtable.push();} resource_name ON resource_type_name
+  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
    optional_global_var_declarations
    single_resource_declaration
   END_RESOURCE
-	{$$ = new resource_declaration_c($3, $5, $6, $7, locloc(@$));
+	{$$ = new resource_declaration_c($3, $6, $7, $8, locloc(@$));
 	 variable_name_symtable.pop();
 	 direct_variable_symtable.pop();
 	 variable_name_symtable.insert($3, prev_declared_resource_name_token);
@@ -8246,7 +8246,6 @@
              symbol_c **tree_root_ref,
              bool full_token_loc_        /* error messages specify full token location */
             ) {
-
   char *libfilename = NULL;
 
   if (includedir != NULL) {
@@ -8296,7 +8295,6 @@
         library_element_symtable.end_value())
       library_element_symtable.insert(standard_function_block_names[i], standard_function_block_name_token);
 
-
   /* now parse the input file... */
   #if YYDEBUG
     yydebug = 1;