23 */ |
23 */ |
24 |
24 |
25 /* Determine the data type of a specific variable instance, including |
25 /* Determine the data type of a specific variable instance, including |
26 * function block instances. |
26 * function block instances. |
27 * A reference to the relevant variable declaration is returned. |
27 * A reference to the relevant variable declaration is returned. |
28 * The variable instance may NOT be a member of a structure of a memeber |
28 * The variable instance may NOT be a member of a structure of a member |
29 * of a structure of an element of an array of ... |
29 * of a structure of an element of an array of ... |
30 * |
30 * |
31 * example: |
31 * example: |
32 * window.points[1].coordinate.x |
32 * window.points[1].coordinate.x |
33 * window.points[1].colour |
33 * window.points[1].colour |
62 this->search_name = NULL; |
62 this->search_name = NULL; |
63 this->current_type_decl = NULL; |
63 this->current_type_decl = NULL; |
64 } |
64 } |
65 |
65 |
66 symbol_c *search_var_instance_decl_c::get_decl(symbol_c *variable_instance_name) { |
66 symbol_c *search_var_instance_decl_c::get_decl(symbol_c *variable_instance_name) { |
|
67 this->current_vartype = none_vt; |
67 this->search_name = variable_instance_name; |
68 this->search_name = variable_instance_name; |
68 return (symbol_c *)search_scope->accept(*this); |
69 return (symbol_c *)search_scope->accept(*this); |
69 } |
70 } |
70 |
71 |
71 unsigned int search_var_instance_decl_c::get_vartype() { |
72 unsigned int search_var_instance_decl_c::get_vartype(void) { |
72 return current_vartype; |
73 return current_vartype; |
73 } |
74 } |
74 |
75 |
75 /***************************/ |
76 /***************************/ |
76 /* B 0 - Programming Model */ |
77 /* B 0 - Programming Model */ |
77 /***************************/ |
78 /***************************/ |
78 void *search_var_instance_decl_c::visit(library_c *symbol) { |
79 void *search_var_instance_decl_c::visit(library_c *symbol) { |
79 /* we do not want to search multiple declaration scopes, |
80 /* we do not want to search multiple declaration scopes, |
80 * so we do not visit all the functions, fucntion blocks, etc... |
81 * so we do not visit all the functions, function blocks, etc... |
81 */ |
82 */ |
82 return NULL; |
83 return NULL; |
83 } |
84 } |
84 |
85 |
85 |
86 |
86 |
87 |
87 /******************************************/ |
88 /******************************************/ |
88 /* B 1.4.3 - Declaration & Initialisation */ |
89 /* B 1.4.3 - Declaration & Initialization */ |
89 /******************************************/ |
90 /******************************************/ |
|
91 |
90 /* edge -> The F_EDGE or R_EDGE directive */ |
92 /* edge -> The F_EDGE or R_EDGE directive */ |
91 // SYM_REF2(edge_declaration_c, edge, var1_list) |
93 // SYM_REF2(edge_declaration_c, edge, var1_list) |
92 // TODO |
94 // TODO |
93 |
95 |
94 void *search_var_instance_decl_c::visit(input_declarations_c *symbol) { |
96 void *search_var_instance_decl_c::visit(input_declarations_c *symbol) { |