83 |
82 |
84 |
83 |
85 |
84 |
86 |
85 |
87 bool get_datatype_info_c::is_sfc_initstep(symbol_c *type_symbol) { |
86 bool get_datatype_info_c::is_sfc_initstep(symbol_c *type_symbol) { |
88 symbol_c *type_decl = search_base_type.get_basetype_decl(type_symbol); |
87 symbol_c *type_decl = search_base_type_c::get_basetype_decl(type_symbol); |
89 if (typeid(*type_decl) == typeid(initial_step_c)) {return true;} /* INITIAL_STEP step_name ':' action_association_list END_STEP */ /* A pseudo data type! */ |
88 if (typeid(*type_decl) == typeid(initial_step_c)) {return true;} /* INITIAL_STEP step_name ':' action_association_list END_STEP */ /* A pseudo data type! */ |
90 return false; |
89 return false; |
91 } |
90 } |
92 |
91 |
93 |
92 |
94 |
93 |
95 |
94 |
96 |
95 |
97 bool get_datatype_info_c::is_sfc_step(symbol_c *type_symbol) { |
96 bool get_datatype_info_c::is_sfc_step(symbol_c *type_symbol) { |
98 symbol_c *type_decl = search_base_type.get_basetype_decl(type_symbol); |
97 symbol_c *type_decl = search_base_type_c::get_basetype_decl(type_symbol); |
99 if (typeid(*type_decl) == typeid(initial_step_c)) {return true;} /* INITIAL_STEP step_name ':' action_association_list END_STEP */ /* A pseudo data type! */ |
98 if (typeid(*type_decl) == typeid(initial_step_c)) {return true;} /* INITIAL_STEP step_name ':' action_association_list END_STEP */ /* A pseudo data type! */ |
100 if (typeid(*type_decl) == typeid( step_c)) {return true;} /* STEP step_name ':' action_association_list END_STEP */ /* A pseudo data type! */ |
99 if (typeid(*type_decl) == typeid( step_c)) {return true;} /* STEP step_name ':' action_association_list END_STEP */ /* A pseudo data type! */ |
101 return false; |
100 return false; |
102 } |
101 } |
103 |
102 |
104 |
103 |
105 |
104 |
106 |
105 |
107 bool get_datatype_info_c::is_function_block(symbol_c *type_symbol) { |
106 bool get_datatype_info_c::is_function_block(symbol_c *type_symbol) { |
108 symbol_c *type_decl = search_base_type.get_basetype_decl(type_symbol); |
107 symbol_c *type_decl = search_base_type_c::get_basetype_decl(type_symbol); |
109 if (typeid(*type_decl) == typeid(function_block_declaration_c)) {return true;} /* FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations function_block_body END_FUNCTION_BLOCK */ |
108 if (typeid(*type_decl) == typeid(function_block_declaration_c)) {return true;} /* FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations function_block_body END_FUNCTION_BLOCK */ |
110 return false; |
109 return false; |
111 } |
110 } |
112 |
111 |
113 |
112 |
114 |
113 |
115 |
114 |
116 |
115 |
117 bool get_datatype_info_c::is_subrange(symbol_c *type_symbol) { |
116 bool get_datatype_info_c::is_subrange(symbol_c *type_symbol) { |
118 symbol_c *type_decl = search_base_type.get_basetype_decl(type_symbol); /* NOTE: will work correctly once we update the way search_base_type_c works, by adding a new search_effective_type:c */ |
117 symbol_c *type_decl = search_base_type_c::get_basetype_decl(type_symbol); /* NOTE: will work correctly once we update the way search_base_type_c works, by adding a new search_effective_type:c */ |
119 |
118 |
120 if (typeid(*type_decl) == typeid(subrange_type_declaration_c)) {return true;} /* subrange_type_name ':' subrange_spec_init */ |
119 if (typeid(*type_decl) == typeid(subrange_type_declaration_c)) {return true;} /* subrange_type_name ':' subrange_spec_init */ |
121 if (typeid(*type_decl) == typeid(subrange_spec_init_c)) {return true;} /* subrange_specification ASSIGN signed_integer */ |
120 if (typeid(*type_decl) == typeid(subrange_spec_init_c)) {return true;} /* subrange_specification ASSIGN signed_integer */ |
122 if (typeid(*type_decl) == typeid(subrange_specification_c)) {return true;} /* integer_type_name '(' subrange')' */ |
121 if (typeid(*type_decl) == typeid(subrange_specification_c)) {return true;} /* integer_type_name '(' subrange')' */ |
123 |
122 |
128 |
127 |
129 |
128 |
130 |
129 |
131 |
130 |
132 bool get_datatype_info_c::is_enumerated(symbol_c *type_symbol) { |
131 bool get_datatype_info_c::is_enumerated(symbol_c *type_symbol) { |
133 symbol_c *type_decl = search_base_type.get_basetype_decl(type_symbol); |
132 symbol_c *type_decl = search_base_type_c::get_basetype_decl(type_symbol); |
134 |
133 |
135 if (typeid(*type_decl) == typeid(enumerated_type_declaration_c)) {return true;} /* enumerated_type_name ':' enumerated_spec_init */ |
134 if (typeid(*type_decl) == typeid(enumerated_type_declaration_c)) {return true;} /* enumerated_type_name ':' enumerated_spec_init */ |
136 if (typeid(*type_decl) == typeid(enumerated_spec_init_c)) {return true;} /* enumerated_specification ASSIGN enumerated_value */ |
135 if (typeid(*type_decl) == typeid(enumerated_spec_init_c)) {return true;} /* enumerated_specification ASSIGN enumerated_value */ |
137 if (typeid(*type_decl) == typeid(enumerated_value_list_c)) {return true;} /* enumerated_value_list ',' enumerated_value */ /* once we change the way we handle enums, this will probably become an ERROR! */ |
136 if (typeid(*type_decl) == typeid(enumerated_value_list_c)) {return true;} /* enumerated_value_list ',' enumerated_value */ /* once we change the way we handle enums, this will probably become an ERROR! */ |
138 |
137 |
143 |
142 |
144 |
143 |
145 |
144 |
146 |
145 |
147 bool get_datatype_info_c::is_array(symbol_c *type_symbol) { |
146 bool get_datatype_info_c::is_array(symbol_c *type_symbol) { |
148 symbol_c *type_decl = search_base_type.get_basetype_decl(type_symbol); |
147 symbol_c *type_decl = search_base_type_c::get_basetype_decl(type_symbol); |
149 |
148 |
150 if (typeid(*type_decl) == typeid(array_type_declaration_c)) {return true;} /* identifier ':' array_spec_init */ |
149 if (typeid(*type_decl) == typeid(array_type_declaration_c)) {return true;} /* identifier ':' array_spec_init */ |
151 if (typeid(*type_decl) == typeid(array_spec_init_c)) {return true;} /* array_specification [ASSIGN array_initialization} */ |
150 if (typeid(*type_decl) == typeid(array_spec_init_c)) {return true;} /* array_specification [ASSIGN array_initialization} */ |
152 if (typeid(*type_decl) == typeid(array_specification_c)) {return true;} /* ARRAY '[' array_subrange_list ']' OF non_generic_type_name */ |
151 if (typeid(*type_decl) == typeid(array_specification_c)) {return true;} /* ARRAY '[' array_subrange_list ']' OF non_generic_type_name */ |
153 |
152 |
160 |
159 |
161 |
160 |
162 |
161 |
163 |
162 |
164 bool get_datatype_info_c::is_structure(symbol_c *type_symbol) { |
163 bool get_datatype_info_c::is_structure(symbol_c *type_symbol) { |
165 symbol_c *type_decl = search_base_type.get_basetype_decl(type_symbol); |
164 symbol_c *type_decl = search_base_type_c::get_basetype_decl(type_symbol); |
166 |
165 |
167 if (typeid(*type_decl) == typeid(structure_type_declaration_c)) {return true;} /* structure_type_name ':' structure_specification */ |
166 if (typeid(*type_decl) == typeid(structure_type_declaration_c)) {return true;} /* structure_type_name ':' structure_specification */ |
168 if (typeid(*type_decl) == typeid(initialized_structure_c)) {return true;} /* structure_type_name ASSIGN structure_initialization */ |
167 if (typeid(*type_decl) == typeid(initialized_structure_c)) {return true;} /* structure_type_name ASSIGN structure_initialization */ |
169 if (typeid(*type_decl) == typeid(structure_element_declaration_list_c)) {return true;} /* structure_declaration: STRUCT structure_element_declaration_list END_STRUCT */ /* structure_element_declaration_list structure_element_declaration ';' */ |
168 if (typeid(*type_decl) == typeid(structure_element_declaration_list_c)) {return true;} /* structure_declaration: STRUCT structure_element_declaration_list END_STRUCT */ /* structure_element_declaration_list structure_element_declaration ';' */ |
170 |
169 |