|
5 | 5 | # for conversion of module content into configuration file format. |
6 | 6 | # |
7 | 7 | # COPYRIGHT: Copyright (C) 2021-2023 Kamil Deć github.com/deckamil |
8 | | -# DATE: 13 JUN 2023 |
| 8 | +# DATE: 23 JUN 2023 |
9 | 9 | # |
10 | 10 | # LICENSE: |
11 | 11 | # This file is part of Mod Code Generator (MCG). |
@@ -287,40 +287,45 @@ def convert_specific_action_node_arity_1(self, sorted_node, operator): |
287 | 287 | # This method converts module action node into configuration file. |
288 | 288 | def convert_action_node(self, sorted_node): |
289 | 289 |
|
290 | | - # if sorted node contains ADD action |
| 290 | + # depending on the type of action, covert module node into configuration file. |
291 | 291 | if sorted_node.name[0:3] == "ADD": |
292 | | - # convert ADD action |
293 | 292 | self.convert_specific_action_node_arity_n(sorted_node, "+") |
294 | 293 |
|
295 | | - # if sorted node contains SUB action |
296 | 294 | elif sorted_node.name[0:3] == "SUB": |
297 | | - # convert SUB action |
298 | 295 | self.convert_specific_action_node_arity_n(sorted_node, "-") |
299 | 296 |
|
300 | | - # if sorted node contains MUL action |
301 | 297 | elif sorted_node.name[0:3] == "MUL": |
302 | | - # convert MUL action |
303 | 298 | self.convert_specific_action_node_arity_n(sorted_node, "*") |
304 | 299 |
|
305 | | - # if sorted node contains DIV action |
306 | 300 | elif sorted_node.name[0:3] == "DIV": |
307 | | - # convert DIV action |
308 | 301 | self.convert_specific_action_node_arity_n(sorted_node, "/") |
309 | 302 |
|
310 | | - # if sorted node contains AND action |
311 | 303 | elif sorted_node.name[0:3] == "AND": |
312 | | - # convert DIV action |
313 | 304 | self.convert_specific_action_node_arity_n(sorted_node, "&&") |
314 | 305 |
|
315 | | - # if sorted node contains OR action |
| 306 | + elif sorted_node.name[0:3] == "NOT": |
| 307 | + self.convert_specific_action_node_arity_1(sorted_node, "!") |
| 308 | + |
316 | 309 | elif sorted_node.name[0:2] == "OR": |
317 | | - # convert DIV action |
318 | 310 | self.convert_specific_action_node_arity_n(sorted_node, "||") |
319 | 311 |
|
320 | | - # if sorted node contains NOT action |
321 | | - elif sorted_node.name[0:3] == "NOT": |
322 | | - # convert DIV action |
323 | | - self.convert_specific_action_node_arity_1(sorted_node, "!") |
| 312 | + elif sorted_node.name[0:2] == "EQ": |
| 313 | + self.convert_specific_action_node_arity_n(sorted_node, "==") |
| 314 | + |
| 315 | + elif sorted_node.name[0:2] == "NE": |
| 316 | + self.convert_specific_action_node_arity_n(sorted_node, "!=") |
| 317 | + |
| 318 | + elif sorted_node.name[0:2] == "GT": |
| 319 | + self.convert_specific_action_node_arity_n(sorted_node, ">") |
| 320 | + |
| 321 | + elif sorted_node.name[0:2] == "LT": |
| 322 | + self.convert_specific_action_node_arity_n(sorted_node, "LT") |
| 323 | + |
| 324 | + elif sorted_node.name[0:2] == "GE": |
| 325 | + self.convert_specific_action_node_arity_n(sorted_node, ">=") |
| 326 | + |
| 327 | + elif sorted_node.name[0:2] == "LE": |
| 328 | + self.convert_specific_action_node_arity_n(sorted_node, "<=") |
324 | 329 |
|
325 | 330 | # Description: |
326 | 331 | # This method converts module data node into configuration file. |
|
0 commit comments