Set the symbol->token member in symbolic_variables_c objects.
authorMario de Sousa <msousa@fe.up.pt>
Mon, 03 Jul 2017 20:28:26 +0100
changeset 1053 e94368340160
parent 1052 f91488700835
child 1054 57c08195c962
Set the symbol->token member in symbolic_variables_c objects.
stage1_2/iec_bison.yy
--- a/stage1_2/iec_bison.yy	Mon Jul 03 20:27:15 2017 +0100
+++ b/stage1_2/iec_bison.yy	Mon Jul 03 20:28:26 2017 +0100
@@ -3535,7 +3535,7 @@
   symbolic_variable
 | prev_declared_direct_variable
 | eno_identifier
-	{$$ = new symbolic_variable_c($1, locloc(@$));}
+	{$$ = new symbolic_variable_c($1, locloc(@$)); $$->token = $1->token;}
 ;
 
 
@@ -3544,15 +3544,15 @@
  *         prev_declared_variable_name | prev_declared_fb_name | prev_declared_global_var_name
  */
   prev_declared_fb_name
-	{$$ = new symbolic_variable_c($1, locloc(@$));}
+	{$$ = new symbolic_variable_c($1, locloc(@$)); $$->token = $1->token;}
 | prev_declared_global_var_name
-	{$$ = new symbolic_variable_c($1, locloc(@$));}
+	{$$ = new symbolic_variable_c($1, locloc(@$)); $$->token = $1->token;}
 | prev_declared_variable_name
-	{$$ = new symbolic_variable_c($1, locloc(@$));}
+	{$$ = new symbolic_variable_c($1, locloc(@$)); $$->token = $1->token;}
 | multi_element_variable
 /*
 | identifier
-	{$$ = new symbolic_variable_c($1, locloc(@$));}
+	{$$ = new symbolic_variable_c($1, locloc(@$)); $$->token = $1->token;}
 */
 | symbolic_variable '^'     
 	/* Dereferencing operator defined in IEC 61131-3 v3. However, implemented here differently then how it is defined in the standard! See following note for explanation! */
@@ -3594,7 +3594,7 @@
 any_symbolic_variable:
 // variable_name -> replaced by any_identifier
   any_identifier
-	{$$ = new symbolic_variable_c($1, locloc(@$));}
+	{$$ = new symbolic_variable_c($1, locloc(@$)); $$->token = $1->token;}
 | any_multi_element_variable
 ;
 
@@ -8388,7 +8388,7 @@
 */
 control_variable: 
   prev_declared_variable_name 
-	{$$ = new symbolic_variable_c($1,locloc(@$));};
+	{$$ = new symbolic_variable_c($1,locloc(@$)); $$->token = $1->token;};
 // control_variable: identifier {$$ = $1;};
 
 /* Integrated directly into for_statement */